A present-but-empty PUBLIC_HOST_AUDIO_URL (e.g. `PUBLIC_HOST_AUDIO_URL=` in a
compose file) bypassed the default and stayed blank, so the UI built
root-relative audio links like `app.url/song.mp3` that 404'd, while video links
kept working off PUBLIC_HOST_URL.
Backend: a blank PUBLIC_HOST_AUDIO_URL now inherits PUBLIC_HOST_URL, matching the
README ("same as PUBLIC_HOST_URL but for audio downloads"). Both blank still
stays blank, so intentional root serving is preserved.
Frontend: buildDownloadLink and buildChapterDownloadLink fall back to
PUBLIC_HOST_URL when the audio host is blank.
Added backend and UI regression tests, both verified red against the unfixed
code.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The playlist/channel processing loop now sets playlist_count,
playlist_autonumber, n_entries, and __last_playlist_index on each
video entry so that templates like %(playlist_autonumber)s,
%(playlist_count)s, and %(playlist_index&{} - |)s resolve correctly
instead of showing NA.
Also updates _compact_persisted_entry to preserve n_entries and
__last_playlist_index across restarts.
Fixes#692
Agent-Logs-Url: https://github.com/alexta69/metube/sessions/b5aeb55a-3197-4a14-b8b4-96c9a67796e8
Co-authored-by: alexta69 <7450369+alexta69@users.noreply.github.com>
Replace the hand-rolled _outtmpl_substitute_field() / _compile_outtmpl_pattern()
with a new _resolve_outtmpl_fields() that delegates to yt-dlp's
YoutubeDL.evaluate_outtmpl(). This gives playlist/channel output templates
access to yt-dlp's full template syntax: defaults (%(field|fallback)s),
conditional formatting (%(field&prefix {})s), math (%(field+N)d),
datetime formatting (%(field>%Y-%m-%d)s), and more.
Only field references whose root name matches the targeted prefix (e.g.
"playlist" or "channel") are resolved; all other references remain as
template placeholders for yt-dlp to fill during the actual download.
Agent-Logs-Url: https://github.com/alexta69/metube/sessions/0ae5ff34-540f-4fc8-a81c-358fb92b7c15
Co-authored-by: alexta69 <7450369+alexta69@users.noreply.github.com>