This commit is contained in:
nose
2025-12-06 00:10:19 -08:00
parent 5482ee5586
commit f29709d951
20 changed files with 1353 additions and 419 deletions

View File

@@ -632,6 +632,16 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
debug("MPV is starting up...")
return 0
else:
# Do not auto-launch MPV when no action/inputs were provided; avoid surprise startups
no_inputs = not any([
result, url_arg, index_arg, clear_mode, play_mode,
pause_mode, save_mode, load_mode, current_mode, list_mode
])
if no_inputs:
debug("MPV is not running. Skipping auto-launch (no inputs).", file=sys.stderr)
return 1
debug("MPV is not running. Starting new instance...")
_start_mpv([], config=config)
return 0
@@ -716,8 +726,6 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
is_current = item.get("current", False)
title = _extract_title_from_item(item)
store = _infer_store_from_playlist_item(item)
filename = item.get("filename", "") if isinstance(item, dict) else ""
display_loc = _format_playlist_location(filename)
# Truncate if too long
if len(title) > 80:
@@ -727,7 +735,6 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
row.add_column("Current", "*" if is_current else "")
row.add_column("Store", store)
row.add_column("Title", title)
row.add_column("Filename", display_loc)
table.set_row_selection_args(i, [str(i + 1)])