kllk
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled

This commit is contained in:
nose
2025-12-24 17:58:57 -08:00
parent d7fc8c4576
commit df24a0cb44
47 changed files with 8039 additions and 82 deletions

View File

@@ -141,8 +141,8 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
try:
import cmdlet_catalog as _catalog
CMDLET.arg[0].choices = _normalize_choice_list(_catalog.list_cmdlet_names())
metadata = _catalog.list_cmdlet_metadata()
CMDLET.arg[0].choices = _normalize_choice_list(_catalog.list_cmdlet_names(config=config))
metadata = _catalog.list_cmdlet_metadata(config=config)
except Exception:
CMDLET.arg[0].choices = []
metadata = {}

View File

@@ -1104,10 +1104,11 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
# Use config from context or load it
config_data = config if config else {}
storage_path = get_local_storage_path(config_data)
if not storage_path:
debug("Local storage path not configured.")
return 1
storage_path = get_local_storage_path(config_data) or _default_state_dir()
try:
Path(storage_path).mkdir(parents=True, exist_ok=True)
except Exception:
pass
with LocalLibrarySearchOptimizer(storage_path) as db:
if db.save_playlist(playlist_name, clean_items):
@@ -1720,12 +1721,14 @@ CMDLET = Cmdlet(
CmdletArg(
name="save",
type="flag",
description="Save current playlist to database"
description="Save current playlist to database",
requires_db=True,
),
CmdletArg(
name="load",
type="flag",
description="List saved playlists"
description="List saved playlists",
requires_db=True,
),
CmdletArg(
name="current",

View File

@@ -1,7 +1,6 @@
"""Worker cmdlet: Display workers table in ResultTable format."""
from __future__ import annotations
import json
import sys
from dataclasses import dataclass
from datetime import datetime, timezone
@@ -22,11 +21,11 @@ CMDLET = Cmdlet(
summary="Display workers table in result table format.",
usage=".worker [status] [-limit N] [@N]",
arg=[
CmdletArg("status", description="Filter by status: running, completed, error (default: all)"),
CmdletArg("limit", type="integer", description="Limit results (default: 100)"),
CmdletArg("@N", description="Select worker by index (1-based) and display full logs"),
CmdletArg("-id", description="Show full logs for a specific worker"),
CmdletArg("-clear", type="flag", description="Remove completed workers from the database"),
CmdletArg("status", description="Filter by status: running, completed, error (default: all)", requires_db=True),
CmdletArg("limit", type="integer", description="Limit results (default: 100)", requires_db=True),
CmdletArg("@N", description="Select worker by index (1-based) and display full logs", requires_db=True),
CmdletArg("-id", description="Show full logs for a specific worker", requires_db=True),
CmdletArg("-clear", type="flag", description="Remove completed workers from the database", requires_db=True),
],
detail=[
"- Shows all background worker tasks and their output",
@@ -63,7 +62,7 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
selection_requested = bool(selection_indices) and isinstance(result, list) and len(result) > 0
if _has_help_flag(args_list):
log(json.dumps(CMDLET, ensure_ascii=False, indent=2))
ctx.emit(CMDLET.__dict__)
return 0
options = _parse_worker_args(args_list)