From 58bc5947cd4398722b29a402dbed7c23d01b5426 Mon Sep 17 00:00:00 2001 From: rxsegrxup Date: Tue, 11 Mar 2014 12:30:35 -0400 Subject: [PATCH] Allow for albums with no AlbumTitle or ArtistName If an album is in the db with incomplete information allow the page to be accessible so it can be deleted. --- headphones/webserve.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index 130a17b6..372a2b49 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -110,7 +110,14 @@ class WebInterface(object): album = myDB.action('SELECT * from albums WHERE AlbumID=?', [AlbumID]).fetchone() tracks = myDB.select('SELECT * from tracks WHERE AlbumID=? ORDER BY CAST(TrackNumber AS INTEGER)', [AlbumID]) description = myDB.action('SELECT * from descriptions WHERE ReleaseGroupID=?', [AlbumID]).fetchone() - title = album['ArtistName'] + ' - ' + album['AlbumTitle'] + if not album['ArtistName']: + title = ' - ' + else: + title = album['ArtistName'] + ' - ' + if not album['AlbumTitle']: + title = title + "" + else: + title = title + album['AlbumTitle'] return serve_template(templatename="album.html", title=title, album=album, tracks=tracks, description=description) albumPage.exposed = True