mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-21 20:29:27 +00:00
Fixes Issue 811 by detecting and failing early if getHybridRelease gets an empty fullreleaselist passed into it.
This commit is contained in:
@@ -251,7 +251,13 @@ def addArtisttoDB(artistid, extrasonly=False):
|
||||
myDB.upsert("alltracks", newValueDict, controlValueDict)
|
||||
|
||||
# Basically just do the same thing again for the hybrid release
|
||||
hybridrelease = getHybridRelease(fullreleaselist)
|
||||
# This may end up being called with an empty fullreleaselist
|
||||
try:
|
||||
hybridrelease = getHybridRelease(fullreleaselist)
|
||||
except Exception, e:
|
||||
errors = True
|
||||
logger.warn('Unable to get hybrid release information for %s: %s' % (rg['title'],e))
|
||||
continue
|
||||
|
||||
# Use the ReleaseGroupID as the ReleaseID for the hybrid release to differentiate it
|
||||
# We can then use the condition WHERE ReleaseID == ReleaseGroupID to select it
|
||||
@@ -584,6 +590,8 @@ def getHybridRelease(fullreleaselist):
|
||||
"""
|
||||
Returns a dictionary of best group of tracks from the list of releases & earliest release date
|
||||
"""
|
||||
if len(fullreleaselist) == 0:
|
||||
raise Exception("getHybridRelease was called with an empty fullreleaselist")
|
||||
sortable_release_list = []
|
||||
|
||||
for release in fullreleaselist:
|
||||
|
||||
Reference in New Issue
Block a user