get tidal tags during download, without needing to go through the enrichment pipeline
This commit is contained in:
parent
1f4e8e5e3b
commit
e78dd7f593
6 changed files with 24 additions and 0 deletions
BIN
Music/hifi/_NSYNC/Celebrity/01 - Pop.flac
Normal file
BIN
Music/hifi/_NSYNC/Celebrity/01 - Pop.flac
Normal file
Binary file not shown.
BIN
Music/hifi/_NSYNC/Celebrity/cover.jpg
Normal file
BIN
Music/hifi/_NSYNC/Celebrity/cover.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
BIN
Music/tidal/_NSYNC/Celebrity/01 - Pop.flac
Normal file
BIN
Music/tidal/_NSYNC/Celebrity/01 - Pop.flac
Normal file
Binary file not shown.
BIN
Music/tidal/_NSYNC/Celebrity/cover.jpg
Normal file
BIN
Music/tidal/_NSYNC/Celebrity/cover.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
|
|
@ -1063,6 +1063,22 @@ def embed_source_ids(audio_file, metadata: dict, context: dict = None, runtime=N
|
|||
pp["hifi_copyright"] = cached_meta["copyright"]
|
||||
source_order = [s for s in source_order if s != "hifi"]
|
||||
|
||||
# If this download came from Tidal, use cached metadata from the download
|
||||
# pipeline instead of re-searching the Tidal API.
|
||||
if cached_meta.get("source") == "tidal":
|
||||
if _tag_enabled(cfg, "tidal.embed_tags"):
|
||||
if cfg.get("tidal.tags.track_id", True) and cached_meta.get("track_id"):
|
||||
pp["id_tags"]["TIDAL_TRACK_ID"] = str(cached_meta["track_id"])
|
||||
if cfg.get("tidal.tags.artist_id", True) and cached_meta.get("artist_id"):
|
||||
pp["id_tags"]["TIDAL_ARTIST_ID"] = str(cached_meta["artist_id"])
|
||||
if cfg.get("tidal.tags.isrc", True) and cached_meta.get("isrc"):
|
||||
pp["tidal_isrc"] = cached_meta["isrc"]
|
||||
if cfg.get("tidal.tags.bpm", True) and cached_meta.get("bpm"):
|
||||
pp["tidal_bpm"] = cached_meta["bpm"]
|
||||
if cfg.get("tidal.tags.copyright", True) and cached_meta.get("copyright"):
|
||||
pp["tidal_copyright"] = cached_meta["copyright"]
|
||||
source_order = [s for s in source_order if s != "tidal"]
|
||||
|
||||
db = get_database()
|
||||
|
||||
for source_name in source_order:
|
||||
|
|
|
|||
|
|
@ -432,6 +432,14 @@ class TidalDownloadClient:
|
|||
title=title,
|
||||
album=album_name,
|
||||
track_number=track.track_num,
|
||||
_source_metadata={
|
||||
'source': 'tidal',
|
||||
'track_id': track.id,
|
||||
'artist_id': track.artist.id if track.artist else None,
|
||||
'isrc': track.isrc or None,
|
||||
'bpm': track.bpm if track.bpm and track.bpm > 0 else None,
|
||||
'copyright': track.copyright or None,
|
||||
},
|
||||
)
|
||||
|
||||
return track_result
|
||||
|
|
|
|||
Loading…
Reference in a new issue