]> git.parisson.com Git - deefuzzer.git/commitdiff
fix mp3 metadata write
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 9 Jul 2010 09:54:12 +0000 (09:54 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 9 Jul 2010 09:54:12 +0000 (09:54 +0000)
tools/mp3.py

index 7d6a0ef947370a08f34aa51d5c621aa1b0d43298..24a12da2f9807c59ebc8b4d2868afb6281f971b0 100644 (file)
@@ -106,10 +106,25 @@ class Mp3:
         """Write all ID3v2.4 tags by mapping dub2id3_dict dictionnary with the
             respect of mutagen classes and methods"""
 
-        m = MP3(self.media)
-        m.add_tags()
-        m.tags['TIT2'] = id3.TIT2(encoding=2, text=u'text')
-        m.save()
+        self.mp3.add_tags()
+        self.mp3.tags['TIT2'] = id3.TIT2(encoding=2, text=u'text')
+        self.mp3.save()
+
+        #media_id3 = id3.ID3(self.media)
+        #for tag in self.metadata.keys():
+            #if tag in self.dub2id3_dict.keys():
+                #frame_text = self.dub2id3_dict[tag]
+                #value = self.metadata[tag]
+                #frame = mutagen.id3.Frames[frame_text](3,value)
+            #try:
+                #media_id3.add(frame)
+            #except:
+                #raise IOError('ExporterError: cannot tag "'+tag+'"')
+
+        #try:
+            #media_id3.save()
+        #except:
+            #raise IOError('ExporterError: cannot write tags')
 
         media = id3.ID3(self.media)
         media.add(id3.TIT2(encoding=3, text=self.metadata['title'].decode('utf8')))