From d037147c23e676a6792fd96a907cf304f51e1eb1 Mon Sep 17 00:00:00 2001 From: Ade Date: Fri, 15 Aug 2014 20:16:26 +1200 Subject: [PATCH] Manage Unmatched fix Potential fix for https://github.com/rembo10/headphones/issues/1808 --- headphones/webserve.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/headphones/webserve.py b/headphones/webserve.py index 7a8314c7..f40206a6 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -460,8 +460,9 @@ class WebInterface(object): have_album_dictionary.append(have_dict) headphones_albums = myDB.select('SELECT ArtistName, AlbumTitle from albums ORDER BY ArtistName') for albums in headphones_albums: - headphones_dict = { 'ArtistName' : albums['ArtistName'], 'AlbumTitle' : albums['AlbumTitle'] } - headphones_album_dictionary.append(headphones_dict) + if albums['ArtistName'] and albums['AlbumTitle']: + headphones_dict = { 'ArtistName' : albums['ArtistName'], 'AlbumTitle' : albums['AlbumTitle'] } + headphones_album_dictionary.append(headphones_dict) #unmatchedalbums = [f for f in have_album_dictionary if f not in [x for x in headphones_album_dictionary]] check = set([(cleanName(d['ArtistName']).lower(), cleanName(d['AlbumTitle']).lower()) for d in headphones_album_dictionary])