Author: duncan
Date: Sat Oct 28 21:41:39 2006
New Revision: 8498
Modified:
branches/rel-1/freevo/src/util/extendedmeta.py
branches/rel-1/freevo/src/util/misc.py
Log:
Added try except blocks for when eye3D raises an exception
Modified: branches/rel-1/freevo/src/util/extendedmeta.py
==============================================================================
--- branches/rel-1/freevo/src/util/extendedmeta.py (original)
+++ branches/rel-1/freevo/src/util/extendedmeta.py Sat Oct 28 21:41:39 2006
@@ -213,7 +213,10 @@
def extract_image(self, path):
for i in util.match_files(path, ['mp3']):
try:
- id3 = eyeD3.Mp3AudioFile( i )
+ id3 = eyeD3.Mp3AudioFile(i)
+ except eyeD3.InvalidAudioFormatException:
+ print 'Cannot get tag for \"%s\"' % (String(i))
+ continue
except:
continue
myname = vfs.getoverlay(os.path.join(path, 'cover.jpg'))
Modified: branches/rel-1/freevo/src/util/misc.py
==============================================================================
--- branches/rel-1/freevo/src/util/misc.py (original)
+++ branches/rel-1/freevo/src/util/misc.py Sat Oct 28 21:41:39 2006
@@ -323,21 +323,24 @@
def tagmp3 (filename, title=None, artist=None, album=None, track=None,
tracktotal=None, year=None):
"""
- use eyeD3 directly from inside mkka.metadata to
+ use eyeD3 directly from inside kaa.metadata to
set the tag. We default to 2.3 since even
though 2.4 is the accepted standard now, more
players support 2.3
"""
import kaa.metadata.audio.eyeD3 as eyeD3
- tag = eyeD3.Tag(String(filename))
- tag.header.setVersion(eyeD3.ID3_V2_3)
- if artist: tag.setArtist(String(artist))
- if album: tag.setAlbum(String(album))
- if title: tag.setTitle(String(title))
- if track: tag.setTrackNum((track,tracktotal)) # eyed3 accepts None for
tracktotal
- if year: tag.setDate(year)
- tag.update()
+ try:
+ tag = eyeD3.Tag(String(filename))
+ tag.header.setVersion(eyeD3.ID3_V2_3)
+ if artist: tag.setArtist(String(artist))
+ if album: tag.setAlbum(String(album))
+ if title: tag.setTitle(String(title))
+ if track: tag.setTrackNum((track,tracktotal)) # eyed3 accepts None
for tracktotal
+ if year: tag.setDate(year)
+ tag.update()
+ except:
+ print 'Cannot tag \"%s\"' % (String(filename))
return
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog