From a6299100463d056e192e7f0721e85057109e052d Mon Sep 17 00:00:00 2001 From: spl0k Date: Sat, 26 Oct 2013 13:13:19 +0200 Subject: [PATCH] Fix for files without tag Closes #6 --- api/browse.py | 2 +- scanner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/browse.py b/api/browse.py index e9b7831..df1b691 100755 --- a/api/browse.py +++ b/api/browse.py @@ -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: diff --git a/scanner.py b/scanner.py index 70aedfb..41bb84e 100755 --- a/scanner.py +++ b/scanner.py @@ -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)