stream: show the source provider of the current track

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-07-04 11:04:45 +08:00
commit bfa7cc1046
3 changed files with 40 additions and 5 deletions

View file

@ -29,7 +29,13 @@ def annotate_uri(path: Path, track: Track) -> str:
def esc(value: str) -> str:
return value.replace("\\", "\\\\").replace('"', '\\"')
fields = [f'title="{esc(track.title)}"', f'artist="{esc(track.artist)}"']
fields = [
f'title="{esc(track.title)}"',
f'artist="{esc(track.artist)}"',
# Provider that produced the track (subsonic, ytdlp…), surfaced by the
# stream so the player can show a discreet source indicator.
f'origin="{esc(track.origin)}"',
]
# Web page the track was pulled from, so the player can link back to the
# source. Only http(s) locators qualify (yt-dlp tracks); a Subsonic song id
# is opaque and points at no public page.