@@ -518,9 +518,9 @@ def album_info(release: Dict) -> beets.autotag.hooks.AlbumInfo:
518518 if (any (config ['musicbrainz' ]['external_ids' ].get ().values ())
519519 and release .get ('url-relation-list' )):
520520 discogs_url , bandcamp_url , spotify_url = None , None , None
521- deezer_url , beatport_url = None , None
521+ deezer_url , beatport_url , tidal_url = None , None , None
522522 fetch_discogs , fetch_bandcamp , fetch_spotify = False , False , False
523- fetch_deezer , fetch_beatport = False , False
523+ fetch_deezer , fetch_beatport , fetch_tidal = False , False , False
524524
525525 if config ['musicbrainz' ]['external_ids' ]['discogs' ].get ():
526526 fetch_discogs = True
@@ -532,6 +532,8 @@ def album_info(release: Dict) -> beets.autotag.hooks.AlbumInfo:
532532 fetch_deezer = True
533533 if config ['musicbrainz' ]['external_ids' ]['beatport' ].get ():
534534 fetch_beatport = True
535+ if config ['musicbrainz' ]['external_ids' ]['tidal' ].get ():
536+ fetch_tidal = True
535537
536538 for url in release ['url-relation-list' ]:
537539 if fetch_discogs and url ['type' ] == 'discogs' :
@@ -549,6 +551,9 @@ def album_info(release: Dict) -> beets.autotag.hooks.AlbumInfo:
549551 if fetch_beatport and 'beatport.com' in url ['target' ]:
550552 log .debug ('Found link to Beatport release via MusicBrainz' )
551553 beatport_url = url ['target' ]
554+ if fetch_tidal and 'tidal.com' in url ['target' ]:
555+ log .debug ('Found link to Tidal release via MusicBrainz' )
556+ tidal_url = url ['target' ]
552557
553558 if discogs_url :
554559 info .discogs_albumid = extract_discogs_id_regex (discogs_url )
@@ -563,6 +568,8 @@ def album_info(release: Dict) -> beets.autotag.hooks.AlbumInfo:
563568 if beatport_url :
564569 info .beatport_album_id = MetadataSourcePlugin ._get_id (
565570 'album' , beatport_url , beatport_id_regex )
571+ if tidal_url :
572+ info .tidal_album_id = tidal_url .split ('/' )[- 1 ]
566573
567574 extra_albumdatas = plugins .send ('mb_album_extract' , data = release )
568575 for extra_albumdata in extra_albumdatas :
0 commit comments