Procházet zdrojové kódy

fix clear pattern bug

Tuan Nguyen před 1 rokem
rodič
revize
205ffdad56
2 změnil soubory, kde provedl 3 přidání a 4 odebrání
  1. 3 3
      app.py
  2. 0 1
      templates/index.html

+ 3 - 3
app.py

@@ -221,7 +221,7 @@ def run_theta_rho_files(
             print(f"Running pattern {idx + 1} of {len(file_paths)}: {path}")
             run_theta_rho_file(path)
 
-            if idx < len(file_paths) - 1:
+            if clear_pattern and idx < len(file_paths) - 1:
                 if stop_requested:
                     print("Execution stopped before running the next clear pattern.")
                     return
@@ -665,8 +665,8 @@ def run_playlist():
 
     # Validate clear_pattern
     valid_patterns = ["clear_in", "clear_out", "clear_sideway", "random"]
-    if clear_pattern not in valid_patterns and clear_pattern is not None:
-        return jsonify({"success": False, "error": f"'clear_pattern' must be one of {valid_patterns} or null"}), 400
+    if clear_pattern not in valid_patterns:
+        clear_pattern = None
 
     # Validate run_mode
     if run_mode not in ["single", "indefinite"]:

+ 0 - 1
templates/index.html

@@ -702,7 +702,6 @@
                     body: JSON.stringify({
                         playlist_name: playlistName,
                         pause_time: pauseTime,
-                        clear_between_files: clearPattern !== null,
                         clear_pattern: clearPattern,
                         run_mode: runMode, // 'single' or 'indefinite'
                         shuffle: shuffle      // true or false