tags 563286 + patch
thanks

On Fri, Jan 01, 2010 at 07:47:28PM +0100, Olivier Berger wrote:
> 
> Please add support for ID3 tags versions above 1 for mp3 files.
> 
> 

FYI, the following patch uses python-eyed3 to add missing basic tags for id3v2 
tags.

It may be used by adding a patched version of the plugin in 
/home/olivier/.musiclibrarian/plugins/id3file.py

Hope this helps.

Best regards,
-- 
Olivier BERGER 
(OpenPGP: 1024D/B4C5F37F)
http://www.olivierberger.com/weblog/
--- /usr/share/musiclibrarian/plugins/id3file.py	2004-10-26 00:28:20.000000000 +0200
+++ /home/olivier/.musiclibrarian/plugins/id3file.py	2010-01-01 19:52:00.000000000 +0100
@@ -1,6 +1,8 @@
 # id3file.py - Read tags from ID3 files.
 
-import ID3
+import ID3    
+# Add support for more ID3 tags
+import eyeD3
 from musiclibrarian import genreset
 import musiclibrarian.musicfile
 
@@ -47,6 +49,14 @@
         # will do, so it's copied below
         d=id3file.as_dict()
 
+        # if ID3 v1 didn't work, then try with more recent variants
+        if not d.has_key('TITLE'):
+            tag = eyeD3.Tag()
+            tag.link(fn)
+            d['TITLE'] = tag.getTitle()
+            d['ARTIST'] = tag.getArtist()
+            d['ALBUM'] = tag.getAlbum()
+
         # This works around a bug in some versions of python-id3,
         # where only trailing NULs are stripped.  (some broken
         # software produced incorrectly formatted tags, where values

Reply via email to