added try/except block to adding album art to folder

This commit is contained in:
rembo10
2014-04-08 13:22:51 -07:00
parent de78d1e737
commit 49e0571cb9

View File

@@ -519,11 +519,13 @@ def addAlbumArt(artwork, albumpath, release):
if album_art_name.startswith('.'):
album_art_name = album_art_name.replace(0, '_')
#prev = os.umask(headphones.UMASK)
file = open(os.path.join(albumpath, album_art_name), 'wb')
file.write(artwork)
file.close()
#os.umask(prev)
try:
file = open(os.path.join(albumpath, album_art_name), 'wb')
file.write(artwork)
file.close()
except Exception, e:
logger.error('Error saving album art: %s' % str(e))
return
def cleanupFiles(albumpath):
logger.info('Cleaning up files')