1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-15 06:32:16 +00:00

Fix for files without tag

Closes #6
This commit is contained in:
spl0k 2013-10-26 13:13:19 +02:00 committed by Emory P
parent a4c989c36a
commit a629910046
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ def list_artists():
# According to the API page, there are no parameters?
indexes = {}
for artist in Artist.query.all():
index = artist.name[0].upper()
index = artist.name[0].upper() if artist.name else '?'
if index in map(str, xrange(10)):
index = '#'
elif index not in string.letters:

View File

@ -80,7 +80,7 @@ class Scanner:
tr.disc = self.__try_read_tag(tag, 'discnumber', 1, lambda x: int(x[0].split('/')[0]))
tr.number = self.__try_read_tag(tag, 'tracknumber', 1, lambda x: int(x[0].split('/')[0]))
tr.title = self.__try_read_tag(tag, 'title')
tr.title = self.__try_read_tag(tag, 'title', '')
tr.year = self.__try_read_tag(tag, 'date', None, lambda x: int(x[0].split('-')[0]))
tr.genre = self.__try_read_tag(tag, 'genre')
tr.duration = int(tag.info.length)