Force comparison of MBID (#1370)
authorMelvyn Harbour <melharbour@gmail.com>
Mon, 17 Jun 2024 17:48:03 +0000 (18:48 +0100)
committerGitHub <noreply@github.com>
Mon, 17 Jun 2024 17:48:03 +0000 (19:48 +0200)
music_assistant/server/helpers/compare.py

index 8abd1945626f72fa10feb5601c7e828872bd5967..fc75c747e0f64dd80f8dfcfeedbf16a0815ad006 100644 (file)
@@ -112,6 +112,10 @@ def compare_track(
     # return early on exact item_id match
     if compare_item_ids(base_item, compare_item):
         return True
+    # return early on MBID match to avoid issues with ISRC
+    # (https://github.com/music-assistant/hass-music-assistant/issues/2316)
+    if base_item.mbid and compare_item.mbid:
+        return base_item.mbid == compare_item.mbid
     # return early on (un)matched external id
     external_id_match = compare_external_ids(base_item.external_ids, compare_item.external_ids)
     if external_id_match is not None: