X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fmpdclient.py;h=5c32b775feb9906c6317e44172db3cb9838655ea;hb=f822f2e502b8ae6b1d20cf1d17db533e09b6c0b5;hp=0f91380b43da135aa8dfd6631f35f1c513f26f81;hpb=d68801c922c83bdb1c97279b41f9925981b523e5;p=mpd-sima.git diff --git a/sima/mpdclient.py b/sima/mpdclient.py index 0f91380..5c32b77 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -33,7 +33,7 @@ from .utils.leven import levenshtein_ratio class PlayerError(Exception): - """Fatal error in poller.""" + """Fatal error in the player.""" # Some decorators @@ -124,6 +124,13 @@ class MPD(MPDClient): needed_tags = {'Artist', 'Album', 'AlbumArtist', 'Title', 'Track'} needed_mbid_tags = {'MUSICBRAINZ_ARTISTID', 'MUSICBRAINZ_ALBUMID', 'MUSICBRAINZ_ALBUMARTISTID', 'MUSICBRAINZ_TRACKID'} + MPD_supported_tags = {'Artist', 'ArtistSort', 'Album', 'AlbumSort', 'AlbumArtist', + 'AlbumArtistSort', 'Title', 'Track', 'Name', 'Genre', + 'Date', 'OriginalDate', 'Composer', 'Performer', + 'Conductor', 'Work', 'Grouping', 'Disc', 'Label', + 'MUSICBRAINZ_ARTISTID', 'MUSICBRAINZ_ALBUMID', + 'MUSICBRAINZ_ALBUMARTISTID', 'MUSICBRAINZ_TRACKID', + 'MUSICBRAINZ_RELEASETRACKID', 'MUSICBRAINZ_WORKID'} database = None def __init__(self, daemon): @@ -383,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 @@ -467,7 +477,7 @@ class MPD(MPDClient): looking for albums for Artist_B returns wrongly this album. """ # First, look for all potential albums - self.log.debug('Searching album for "%s"', artist) + self.log.debug('Searching album for "%r"', artist) if artist.aliases: self.log.debug('Searching album for %s aliases: "%s"', artist, artist.aliases)