huge refactor of the entire codebase, with the goal of improving maintainability, readability, and extensibility. This commit includes changes to almost every file in the project, including:
This commit is contained in:
+18
-21
@@ -199,10 +199,10 @@ class SharedArgs:
|
||||
type="string",
|
||||
description="http parser",
|
||||
)
|
||||
PROVIDER = CmdletArg(
|
||||
name="provider",
|
||||
PLUGIN = CmdletArg(
|
||||
name="plugin",
|
||||
type="string",
|
||||
description="selects provider",
|
||||
description="selects plugin",
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
@@ -538,10 +538,13 @@ class Cmdlet:
|
||||
elif low in flags.get('tag', set()):
|
||||
# handle tag
|
||||
"""
|
||||
return {
|
||||
arg.name: self.get_flags(arg.name)
|
||||
for arg in self.arg
|
||||
}
|
||||
registry: Dict[str, set[str]] = {}
|
||||
for arg in self.arg:
|
||||
try:
|
||||
registry[arg.name] = {str(flag).lower() for flag in arg.to_flags()}
|
||||
except Exception:
|
||||
registry[arg.name] = {flag.lower() for flag in self.get_flags(arg.name)}
|
||||
return registry
|
||||
|
||||
|
||||
# Tag groups cache (loaded from JSON config file)
|
||||
@@ -642,10 +645,14 @@ def parse_cmdlet_args(args: Sequence[str],
|
||||
else:
|
||||
flagged_args.append(spec)
|
||||
|
||||
# Register all prefix variants for flagged lookup
|
||||
arg_spec_map[canonical_name.lower()] = canonical_name # bare name
|
||||
arg_spec_map[f"-{canonical_name}".lower()] = canonical_name # single dash
|
||||
arg_spec_map[f"--{canonical_name}".lower()] = canonical_name # double dash
|
||||
# Register all supported flag variants, including legacy aliases.
|
||||
arg_spec_map[canonical_name.lower()] = canonical_name # bare canonical name
|
||||
try:
|
||||
for flag in spec.to_flags():
|
||||
arg_spec_map[str(flag).lower()] = canonical_name
|
||||
except Exception:
|
||||
arg_spec_map[f"-{canonical_name}".lower()] = canonical_name
|
||||
arg_spec_map[f"--{canonical_name}".lower()] = canonical_name
|
||||
|
||||
# Parse arguments
|
||||
i = 0
|
||||
@@ -3143,16 +3150,6 @@ def register_url_with_local_library(
|
||||
"""
|
||||
# Folder store removed; local library URL registration is disabled.
|
||||
return False
|
||||
|
||||
|
||||
try:
|
||||
# Provider-specific implementation lives with the provider code.
|
||||
from Provider.tidal_manifest import resolve_tidal_manifest_path
|
||||
except Exception: # pragma: no cover
|
||||
def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
_ = item
|
||||
return None
|
||||
|
||||
def check_url_exists_in_storage(
|
||||
urls: Sequence[str],
|
||||
storage: Any,
|
||||
|
||||
Reference in New Issue
Block a user