YetAnotherNerd / whatlastgenre

Improve genre metadata of audio files based on tags from various music sites.
http://yetanothernerd.github.io/whatlastgenre
MIT License
79 stars 20 forks source link

[Request] only one genre tag field with separator for vorbis comment files (ogg, flac) #9

Closed sekisushai closed 8 years ago

sekisushai commented 8 years ago

Hello, The parameter id3v23sep in config file works only for ID3 tag. Is it possible to make it work for vorbis comment tags, i.e. instead of having several genre tag fields, only one with the separator. I'm asking this feature cause most of the players don't recognize a second or more genre tag for vorbis comment tags and display only the first one in their gui.

Thanks

YetAnotherNerd commented 8 years ago

the id3v23sep config option is a compatibility option that uses id3v2.3 instead of id3v2.4 for older devices that cannot handle id3v2.4 tags you should use id3v2.4 tags, which support multi-valued tags (without separators) just like vorbis comments do if your favourite gui application doesn't support proper display of multi-valued metadata tags, you should file an issue there

sekisushai commented 8 years ago

Yes I got your point, the players should support proper display of multi-valued metadata tags.... unfortunately it's not the case here (amarok). Several requests were done for that but with no success yet... As I don't want to change the player, I was wondering if it was possible to force all the genre tags into one (which is displayed by the gui), a bit like the id3v23sep parameter.. I know it's against the vorbis comment philosophy, but I don't know any player which display correctly the multi-valued genre tags under Linux.

YetAnotherNerd commented 8 years ago

i don't feel like this is a feature that should be added, however, this is open source, so hack the code to do whatever you like:

diff --git a/wlg/whatlastgenre.py b/wlg/whatlastgenre.py
--- a/wlg/whatlastgenre.py
+++ b/wlg/whatlastgenre.py
@@ -695,7 +695,7 @@ def work_directory(wlg, path):
     genres, release = wlg.query_album(metadata)
     # update album metadata
     if genres:
-        album.set_meta('genre', genres)
+        album.set_meta('genre', ', '.join(sorted(genres)))
         print("Genres:  %s" % ', '.join(genres).encode('utf-8'))
     if release and wlg.conf.args.release:
         release_info = []