archseer / ruby-mpd

ruby-mpd is a powerful object-oriented Music Player Daemon library, forked from librmpd.
GNU General Public License v2.0
83 stars 32 forks source link

Some genres have cryptic ids instead of text #47

Closed Phrogz closed 8 years ago

Phrogz commented 8 years ago
s = M.where(genre:'(123)').first
s.genre         #=> "(123)"
s.file          #=> "Beelzebubs/Foster Street/08 Comfortably Numb.mp3"
phrogz$ eyeD3 "Beelzebubs/Foster Street/08 Comfortably Numb.mp3" | grep genre
track: 8        genre: A Cappella (id 123)

I'd like to get the genre name, not the id, in my Song instances. Is this possible?

archseer commented 8 years ago

Hmm, this is due to the old id3 standard of storing the genre as an id. The reason eyeD3 displays it properly is because it manually converts it. Here's a mapping table: http://php.net/manual/en/function.id3-get-genre-list.php

We could probably include that in the gem.

Phrogz commented 8 years ago

Thanks, I confirm that using mpc I see the same ID-based result coming back from MPD. I'll look on creating a pull request for the mapping.