X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fmpdclient.py;h=b50df91fca637f961f3335637ee06274094aa25a;hb=f76a5c2fce5c9a515efb93991c53ce8e0edaf197;hp=6bbe63dd7b97816a4ccd52cbdcef3efa795c3d99;hpb=3b4178f64c0785435930537c1e14edb7ad458008;p=mpd-sima.git diff --git a/sima/mpdclient.py b/sima/mpdclient.py index 6bbe63d..b50df91 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -149,7 +149,7 @@ class MPD(MPDClient): # ConnectionError and ProtocolError are always fatal. Others may not # be, but we don't know how to handle them here, so treat them as if # they are instead of ignoring them. - except MPDError as err: + except PlayerError as err: raise PlayerError(f'Could not connect to "{host}:{port}": {err}') from err if password: try: @@ -162,9 +162,9 @@ class MPD(MPDClient): if cmd not in available_cmd: self.disconnect() raise PlayerError(f'Could connect to "{host}", but command "{cmd}" not available') - self.tagtypes('clear') + self.tagtypes_clear() for tag in MPD.needed_tags: - self.tagtypes('enable', tag) + self.tagtypes_enable(tag) ltt = set(map(str.lower, self.tagtypes())) needed_tags = set(map(str.lower, MPD.needed_tags)) if len(needed_tags & ltt) != len(MPD.needed_tags): @@ -172,7 +172,7 @@ class MPD(MPDClient): self.log.warning('Tags needed: %s', needed_tags) raise PlayerError('Missing mandatory metadata!') for tag in MPD.needed_mbid_tags: - self.tagtypes('enable', tag) + self.tagtypes_enable(tag) # Controls use of MusicBrainzIdentifier if self.config.getboolean('sima', 'musicbrainzid'): ltt = set(self.tagtypes()) @@ -422,12 +422,6 @@ class MPD(MPDClient): if SimaStr(artist.name) == name and name != artist.name: self.log.debug('add alias for %s: %s', artist, name) artist.add_alias(name) - 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