mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-19 10:05:30 +01:00
Better error handling in the post-processor
This commit is contained in:
@@ -132,11 +132,11 @@ def artistlist_to_mbids(artistlist):
|
||||
myDB.upsert("artists", newValueDict, controlValueDict)
|
||||
|
||||
# Update the cloud:
|
||||
logger.info('Updating the cloud')
|
||||
logger.info('Updating artist information from Last.fm')
|
||||
try:
|
||||
lastfm.getSimilar()
|
||||
except Exception, e:
|
||||
logger.warn('Updating the cloud failed: %s' % e)
|
||||
logger.warn('Failed to update arist information from Last.fm: %s' % e)
|
||||
|
||||
|
||||
def addArtisttoDB(artistid, extrasonly=False):
|
||||
|
||||
@@ -135,7 +135,7 @@ def cleanupFiles(albumpath):
|
||||
os.remove(os.path.join(r, files))
|
||||
|
||||
def moveFiles(albumpath, release, tracks):
|
||||
|
||||
|
||||
try:
|
||||
year = release['ReleaseDate'][:4]
|
||||
except TypeError:
|
||||
@@ -187,7 +187,7 @@ def correctMetadata(albumid, release, downloaded_track_list):
|
||||
item.write()
|
||||
|
||||
def renameFiles(albumpath, downloaded_track_list, release):
|
||||
|
||||
logger.info('Renaming files')
|
||||
try:
|
||||
year = release['ReleaseDate'][:4]
|
||||
except TypeError:
|
||||
@@ -214,7 +214,11 @@ def renameFiles(albumpath, downloaded_track_list, release):
|
||||
|
||||
new_file = os.path.join(albumpath, new_file_name)
|
||||
|
||||
shutil.move(downloaded_track, new_file)
|
||||
try:
|
||||
shutil.move(downloaded_track, new_file)
|
||||
except Exception, e:
|
||||
logger.error('Error renaming file: %s. Error: %s' % (downloaded_track, e))
|
||||
continue
|
||||
|
||||
def updateHave(albumpath):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user