File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
backend/beets_flask/server/routes/library Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -839,6 +839,20 @@ def _rep_Album(
839839 out ["sources" ].append (source )
840840 keys = [k for k in keys if k not in f_keys ]
841841
842+ # The mb source might be duplicated in other sources, e.g. spotify,
843+ # We delete the mb source if it is a duplicate of another source.
844+ mb_source = next (filter (lambda s : s ["source" ] == "mb" , out ["sources" ]), None )
845+ if mb_source and len (out ["sources" ]) > 1 :
846+ for source in out ["sources" ]:
847+ if source ["source" ] == "mb" :
848+ continue
849+
850+ if source ["album_id" ] == mb_source ["album_id" ]:
851+ # delete mb source
852+ out ["sources" ] = list (
853+ filter (lambda s : s ["source" ] != "mb" , out ["sources" ])
854+ )
855+
842856 for key in keys :
843857 if key == "name" :
844858 out [key ] = album .album
You can’t perform that action at this time.
0 commit comments