Add --except PATTERN option and update documentation
- --except filters albums by directory name (glob or substring, repeatable) - README.md: new options table entries, new cover sources, updated pipeline, corrected test count (33), added batch example - BEDIENUNGSANLEITUNG.md: new options table, sections E (batch+except), F (--status), LASTFM_API_KEY env var, corrected test count Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd6c0ae185
commit
0ca05e91d4
3 changed files with 77 additions and 9 deletions
|
|
@ -10,6 +10,7 @@ Pipeline pro Album:
|
|||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import fnmatch
|
||||
import importlib.util
|
||||
import os
|
||||
import sys
|
||||
|
|
@ -361,6 +362,10 @@ def main() -> None:
|
|||
help="Bibliotheksstatus anzeigen (fehlende Cover, schlechte Tags) — nichts schreiben")
|
||||
parser.add_argument("--skip-complete", action="store_true", dest="skip_complete",
|
||||
help="Alben überspringen die bereits Cover + gute Tags haben")
|
||||
parser.add_argument("--except", action="append", dest="exclude_patterns",
|
||||
metavar="PATTERN", default=[],
|
||||
help="Album ausschließen dessen Verzeichnisname das Muster enthält\n"
|
||||
"(Glob oder Substring, mehrfach verwendbar, z.B. --except 'Abba*')")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
@ -402,6 +407,20 @@ def main() -> None:
|
|||
skipped_upfront = before - len(album_dirs)
|
||||
print(f"⏭️ {skipped_upfront}/{before} Alben bereits vollständig — übersprungen.")
|
||||
|
||||
# --except: Alben nach Namensmuster ausschließen
|
||||
if args.exclude_patterns:
|
||||
before_exc = len(album_dirs)
|
||||
def _is_excluded(d: Path) -> bool:
|
||||
name = d.name
|
||||
return any(
|
||||
fnmatch.fnmatch(name, pat) or pat in name
|
||||
for pat in args.exclude_patterns
|
||||
)
|
||||
album_dirs = [d for d in album_dirs if not _is_excluded(d)]
|
||||
excluded_count = before_exc - len(album_dirs)
|
||||
patterns_str = ", ".join(repr(p) for p in args.exclude_patterns)
|
||||
print(f"🚫 {excluded_count}/{before_exc} Alben ausgeschlossen ({patterns_str}).")
|
||||
|
||||
print(f"🎵 {len(album_dirs)} Album-Verzeichnisse gefunden.")
|
||||
if os.getenv("OLLAMA_HOST") or True: # Ollama always attempted
|
||||
print("🤖 LLM-Resolve: Ollama → OpenRouter (kein Claude)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue