]> git.parisson.com Git - deefuzzer.git/commitdiff
fix metadata read, add author
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 9 Jul 2010 08:53:48 +0000 (08:53 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 9 Jul 2010 08:53:48 +0000 (08:53 +0000)
example/myfuzz.xml
tools/mp3.py

index ca933211124b936daa1d945907e0e690f7710a42..872e5a7dee9b7cf1e3a7663da271f83ff270b477 100644 (file)
@@ -88,6 +88,8 @@
             <mode>0</mode>
             <!-- The URL of the station to relay -->
             <url>http://anotherdomain.com:8000/stream.mp3</url>
+            <!-- The default author of the relay streams -->
+            <author>Me</author>
         </relay>
         <record>
             <!-- If '1', the stream will be recorded, '0' does nothing -->
index 9d61dae3c06412425920a911b886a7cd1a5a2308..7d6a0ef947370a08f34aa51d5c621aa1b0d43298 100644 (file)
@@ -69,18 +69,8 @@ class Mp3:
         self.info = self.mp3.info
         self.bitrate = int(str(self.info.bitrate)[:-3])
         self.length = datetime.timedelta(0,self.info.length)
-        try:
-            self.metadata = self.get_file_metadata()
-        except:
-            self.metadata = {'title': '',
-                    'artist': '',
-                    'album': '',
-                    'date': '',
-                    'comment': '',
-                    'genre': '',
-                    'copyright': '',
-                    }
-        
+        self.metadata = self.get_file_metadata()
+
         self.description = self.get_description()
         self.mime_type = self.get_mime_type()
         self.media_info = get_file_info(self.media)
@@ -110,13 +100,12 @@ class Mp3:
                 metadata[key] = self.mp3[key][0]
             except:
                 metadata[key] = ''
-        self.mp3.close()
         return metadata
-            
+
     def write_tags(self):
         """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')