feat: always embed an album tag (default 'Unknown Album')
Downloads with no album (regular YouTube videos, fan edits, etc) left a blank album, which trips up players like Plexamp. yt_download now appends --parse-metadata "%(album|Unknown Album)s:%(meta_album)s" so the native/resolved album is kept when present, else 'Unknown Album' is embedded. Applies to all download paths (search, playlist, single URL). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -102,3 +102,11 @@ def test_yt_download_returns_true_on_zero_exit(monkeypatch):
|
||||
|
||||
def test_yt_download_dry_run_returns_true():
|
||||
assert mf.yt_download("u", "/tmp/x", "best", True) is True
|
||||
|
||||
|
||||
def test_yt_download_always_sets_album_default(monkeypatch):
|
||||
captured = {}
|
||||
monkeypatch.setattr(mf.os, "makedirs", lambda *a, **k: None)
|
||||
monkeypatch.setattr(mf.subprocess, "run", lambda cmd, **k: captured.update(cmd=cmd) or _CP(""))
|
||||
mf.yt_download("u", "/tmp/x", "best", False)
|
||||
assert "%(album|Unknown Album)s:%(meta_album)s" in captured["cmd"]
|
||||
|
||||
Reference in New Issue
Block a user