Fixed css on log page, added better error catching for lastfm and searcher

This commit is contained in:
Remy
2011-08-09 16:34:43 -07:00
parent 58e1728c0e
commit 36a2967354
3 changed files with 10 additions and 6 deletions

View File

@@ -188,8 +188,8 @@ table#history_table { background-color: white; width: 100%; }
table#log_table { background-color: white; }
table#log_table th#timestamp { text-align: left; min-width: 165px; }
table#log_table th#level { text-align: left; min-width: 75px; }
table#log_table th#timestamp { text-align: left; min-width: 150px; }
table#log_table th#level { text-align: left; min-width: 60px; }
table#log_table th#message { text-align: left; min-width: 500px; }
table#upcoming_table th#albumart { text-align: center; min-width: 50px; }

View File

@@ -215,8 +215,11 @@ def addArtisttoDB(artistid, extrasonly=False):
myDB.upsert("albums", newValueDict, controlValueDict)
lastfm.getAlbumDescription(rg['id'], artist['artist_name'], rg['title'])
try:
lastfm.getAlbumDescription(rg['id'], artist['artist_name'], rg['title'])
except Exception, e:
logger.error('Attempt to retrieve album description from Last.fm failed: %s' % e)
# I changed the albumid from releaseid -> rgid, so might need to delete albums that have a releaseid
for release in release_dict['releaselist']:
myDB.action('DELETE from albums WHERE AlbumID=?', [release['releaseid']])

View File

@@ -418,6 +418,7 @@ def searchNZB(albumid=None, new=False):
f = open(download_path, 'w')
f.write(data)
f.close()
logger.info('File saved to: %s' % nzb_name)
except Exception, e:
logger.error('Couldn\'t write NZB file: %s' % e)
break
@@ -449,12 +450,12 @@ def getresultNZB(result):
try:
nzb = urllib.urlopen(url, data=params).read()
except urllib2.URLError, e:
logger.warn('Error fetching nzb from url: ' + url + ' %s' % e)
logger.warn('Error fetching nzb from url: %s. Error: %s' % (url, e))
else:
try:
nzb = urllib2.urlopen(result[2], timeout=20).read()
except Exception, e:
logger.warn('Error fetching nzb from url: ' + result[2] + ' %s' % e)
logger.warn('Error fetching nzb from url: %s. Error: %s' % (result[2], e))
return nzb
def preprocess(resultlist):