mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Merge remote-tracking branch 'doskir/master' into develop
This commit is contained in:
+6
-10
@@ -285,14 +285,7 @@ def getReleaseGroup(rgid):
|
|||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
if not releaseResult:
|
if not releaseResult:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
#skip releases that do not have any release date associated with them
|
|
||||||
#if we don't do this the albums will get the release date "None" and will
|
|
||||||
#automatically be set to wanted if "Automatically Mark Upcoming Albums as Wanted" is set
|
|
||||||
#because None is not a valid date and will never be in the past so it is always upcoming
|
|
||||||
if 'date' not in releaseResult:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if releaseGroup['type'] == 'live' and releaseResult['status'] != 'Official':
|
if releaseGroup['type'] == 'live' and releaseResult['status'] != 'Official':
|
||||||
logger.debug('%s is not an official live album. Skipping' % releaseResult.name)
|
logger.debug('%s is not an official live album. Skipping' % releaseResult.name)
|
||||||
@@ -342,7 +335,7 @@ def getReleaseGroup(rgid):
|
|||||||
'asin': unicode(releaseResult.get('asin')) if 'asin' in releaseResult else None,
|
'asin': unicode(releaseResult.get('asin')) if 'asin' in releaseResult else None,
|
||||||
'trackscount': totalTracks,
|
'trackscount': totalTracks,
|
||||||
'releaseid': unicode(releaseResult.get('id')),
|
'releaseid': unicode(releaseResult.get('id')),
|
||||||
'releasedate': unicode(releaseResult.get('date')),
|
'releasedate': unicode(releaseResult.get('date')) if 'date' in releaseResult else None,
|
||||||
'format': format,
|
'format': format,
|
||||||
'country': country
|
'country': country
|
||||||
}
|
}
|
||||||
@@ -350,6 +343,9 @@ def getReleaseGroup(rgid):
|
|||||||
releaselist.append(release_dict)
|
releaselist.append(release_dict)
|
||||||
#necessary to make dates that miss the month and/or day show up after full dates
|
#necessary to make dates that miss the month and/or day show up after full dates
|
||||||
def getSortableReleaseDate(releaseDate):
|
def getSortableReleaseDate(releaseDate):
|
||||||
|
if releaseDate == None:
|
||||||
|
return 'None';#change this value to change the sorting behaviour of none, returning 'None' will put it at the top
|
||||||
|
#which was normal behaviour for pre-ngs versions
|
||||||
if releaseDate.count('-') == 2:
|
if releaseDate.count('-') == 2:
|
||||||
return releaseDate
|
return releaseDate
|
||||||
elif releaseDate.count('-') == 1:
|
elif releaseDate.count('-') == 1:
|
||||||
@@ -366,7 +362,7 @@ def getReleaseGroup(rgid):
|
|||||||
a = multikeysort(releaselist, ['-hasasin', 'country', 'format', 'trackscount_delta'])
|
a = multikeysort(releaselist, ['-hasasin', 'country', 'format', 'trackscount_delta'])
|
||||||
|
|
||||||
release_dict = {'releaseid' :a[0]['releaseid'],
|
release_dict = {'releaseid' :a[0]['releaseid'],
|
||||||
'releasedate' : unicode(releaselist[0]['releasedate']),
|
'releasedate' : releaselist[0]['releasedate'],
|
||||||
'trackcount' : a[0]['trackscount'],
|
'trackcount' : a[0]['trackscount'],
|
||||||
'tracks' : a[0]['tracks'],
|
'tracks' : a[0]['tracks'],
|
||||||
'asin' : a[0]['asin'],
|
'asin' : a[0]['asin'],
|
||||||
|
|||||||
Reference in New Issue
Block a user