From 5cbeb934dbc769c924787f900d3db1a6508a2d09 Mon Sep 17 00:00:00 2001 From: kaliko Date: Thu, 17 Dec 2020 15:50:18 +0100 Subject: [PATCH] MPD client: Update name and aliases in case of discrepancy When MPD library returns an artist name different from the name used in the query, an alias is add in addition to name update. --- sima/mpdclient.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sima/mpdclient.py b/sima/mpdclient.py index 0c2e0b2..a022949 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -390,8 +390,11 @@ class MPD(MPDClient): if len(library) > 1: self.log.debug('I got "%s" searching for %r', library, artist) elif len(library) == 1 and library[0] != artist.name: + new_alias = artist.name self.log.info('Update artist name %s->%s', artist, library[0]) + self.log.debug('Also add alias for %s: %s', artist, new_alias) artist = Artist(name=library[0], mbid=artist.mbid) + artist.add_alias(new_alias) # Fetches remaining artists for potential match artists = self._cache['nombid_artists'] else: # not using MusicBrainzIDs -- 2.39.2