This commit is contained in:
nose
2025-12-17 17:42:46 -08:00
parent d2e7385280
commit 76691dbbf5
9 changed files with 762 additions and 119 deletions

View File

@@ -869,13 +869,9 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
start_opts: Dict[str, Any] = {"borderless": borderless, "mpv_log_path": mpv_log_path}
# Initialize Store registry for detecting Hydrus instance names
# Store registry is only needed for certain playlist listing/inference paths.
# Keep it lazy so a simple `.pipe <url> -play` doesn't trigger Hydrus/API calls.
file_storage = None
try:
from Store import Store
file_storage = Store(config)
except Exception as e:
debug(f"Warning: Could not initialize Store registry: {e}", file=sys.stderr)
# Initialize mpv_started flag
mpv_started = False
@@ -1313,6 +1309,13 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
debug("MPV playlist is empty.")
return 0
if file_storage is None:
try:
from Store import Store
file_storage = Store(config)
except Exception as e:
debug(f"Warning: Could not initialize Store registry: {e}", file=sys.stderr)
# Use the loaded playlist name if available, otherwise default
# Note: current_playlist_name is defined in the load_mode block if a playlist was loaded
try: