mpdlcd icon indicating copy to clipboard operation
mpdlcd copied to clipboard

Internet radio streams ID tags

Open podly opened this issue 11 years ago • 0 comments

mpdlcd has a nice feature to use alternate tags if it can't find correct value in basic one. However most internet radio station use values coded a little different than in mp3 files.

In most cases radios use 'artist' tag for their radio station name and 'title' tag for artist and song name in one field. So, my suggestion is to correct mpdwrapper.py in this way:

class MPDSong(object):

    BASE_TAGS = (
        SongTag('artist', u" ", 'albumartist', 'composer', 'performer', 'name'),
#        SongTag('title', u" ", 'name'),
#        SongTag('name', u" ", 'title'),
        SongTag('title', u" "),
        SongTag('name', u" "),
        SongTag('time', u"--:--"),
        SongTag('file', u" "),
    )

    def __init__(self, **kwargs):
        # Each tag may be multi-valued, keep only the first one.
        self.tags = dict((k.lower(), v[0]) for k, v in kwargs.items())
        for tag in self.BASE_TAGS:
            self.tags[tag.name] = tag.get(self.tags)

in this way it is possible to set in configuration file displaying radio station name and artist-song name. It would be also great to have a little flexibility with this in configuration file.

podly avatar Sep 03 '14 21:09 podly