Permalink
Browse files

If the id3 for the mp3 file doesn't contain tracknumber, it uses the …

…ordering of the files instead.
  • Loading branch information...
1 parent f2cda85 commit 8d4fc11c16a44ee5abfe64e71f974674d55ae52b @raqqa raqqa committed Feb 25, 2011
Showing with 5 additions and 2 deletions.
  1. +4 −1 src/Track.py
  2. +1 −1 src/templates/album_template_1.tmpl
View
@@ -18,7 +18,10 @@ def __init__(self, apath):
self.audio = MP3(apath)
try:
'''MP3'''
- self.track = self.audio.tags["TRCK"][0]
+ try:
+ self.track = self.audio.tags["TRCK"][0]
+ except:
+ self.track = 0
self.title = self.audio.tags["TIT2"][0]
self.album = self.audio["TALB"][0]
self.artist = self.audio["TPE1"][0]
@@ -11,7 +11,7 @@ Length: $album.calclength()
#if float($album.calcfilesize()) < 1000
Size: $album.calcfilesize() MB
#end if
-#if $album.getpreset() != ""
+#if $album.getpreset() != "" and $album.getpreset() != None:
Preset: $album.getpreset()
#end if
[/title]

0 comments on commit 8d4fc11

Please sign in to comment.