Some more bug fixes: tracks could only be on one release, newznab hanging

This commit is contained in:
Remy
2011-07-17 03:02:29 -07:00
parent fc7e1a55e0
commit 9011d3e449
3 changed files with 18 additions and 11 deletions
+2 -2
View File
@@ -171,12 +171,12 @@ def addArtisttoDB(artistid):
for track in release['tracks']:
controlValueDict = {"TrackID": track['id']}
controlValueDict = {"TrackID": track['id'],
"AlbumID": rg['id']}
newValueDict = {"ArtistID": artistid,
"ArtistName": artist['artist_name'],
"AlbumTitle": rg['title'],
"AlbumASIN": release['asin'],
"AlbumID": rg['id'],
"TrackTitle": track['title'],
"TrackDuration": track['duration'],
}
+4 -6
View File
@@ -86,11 +86,9 @@ def searchNZB(albumid=None):
searchURL = headphones.NEWZNAB_HOST + '/api?' + urllib.urlencode(params)
logger.info(u"Parsing results from "+searchURL)
try:
d = feedparser.parse(searchURL)
except Exception, e:
logger.error('Error parsing data from ' + headphones.NEWZNAB_HOST + ' : ' + str(e))
d = feedparser.parse(searchURL)
logger.debug('Parsing complete. Found %i results' % len(d.entries))
for item in d.entries:
try:
@@ -154,7 +152,7 @@ def searchNZB(albumid=None):
logger.info(u"Found best result: %s (%s) - %s" % (bestqual[0], bestqual[2], helpers.bytes_to_mb(bestqual[1])))
downloadurl = bestqual[2]
if headphones.SAB_HOST and not headphones.BLACKHOLE:
linkparams = {}
+12 -3
View File
@@ -575,7 +575,10 @@ class WebInterface(object):
logger.info(u"Headphones is shutting down...")
threading.Timer(2, headphones.shutdown).start()
page = [templates._shutdownheader % 10]
page.append('Shutting down Headphones...')
page.append(templates._logobar)
page.append(templates._nav)
page.append('<div class="table"><div class="configtable">Shutting down Headphones...</div></div>')
page.append(templates._footer % headphones.CURRENT_VERSION)
return page
shutdown.exposed = True
@@ -584,7 +587,10 @@ class WebInterface(object):
logger.info(u"Headphones is restarting...")
threading.Timer(2, headphones.shutdown, [True]).start()
page = [templates._shutdownheader % 20]
page.append('Restarting Headphones...')
page.append(templates._logobar)
page.append(templates._nav)
page.append('<div class="table"><div class="configtable">Restarting Headphones...</div></div>')
page.append(templates._footer % headphones.CURRENT_VERSION)
return page
restart.exposed = True
@@ -593,7 +599,10 @@ class WebInterface(object):
logger.info('Headphones is updating...')
threading.Timer(2, headphones.shutdown, [True, True]).start()
page = [templates._shutdownheader % 60]
page.append('Updating Headphones...')
page.append(templates._logobar)
page.append(templates._nav)
page.append('<div class="table"><div class="configtable">Updating Headphones...</div></div>')
page.append(templates._footer % headphones.CURRENT_VERSION)
return page
update.exposed = True