From ecae9d0996ea8a836002eb62422786d1579538f6 Mon Sep 17 00:00:00 2001 From: Ade Date: Sun, 7 Dec 2014 16:04:06 +1300 Subject: [PATCH] Default artist latest album details MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For manually added albums where the artist doesn’t exist, default latest artist details from the added album --- headphones/importer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/headphones/importer.py b/headphones/importer.py index 4730a8c7..c02f508f 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -600,6 +600,17 @@ def addReleaseById(rid, rgid=None): newValueDict['IncludeExtras'] = 1 newValueDict['Extras'] = headphones.CONFIG.EXTRAS + if 'title' in release_dict: + newValueDict['LatestAlbum'] = release_dict['title'] + elif 'rg_title' in release_dict: + newValueDict['LatestAlbum'] = release_dict['rg_title'] + + if 'date' in release_dict: + newValueDict['ReleaseDate'] = release_dict['date'] + + if rgid: + newValueDict['AlbumID'] = rgid + myDB.upsert("artists", newValueDict, controlValueDict) elif not artist_exists and not release_dict: