mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-16 14:04:00 +01:00
Possible fix for album art permissions not being updated
This commit is contained in:
@@ -400,7 +400,7 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list,
|
|||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
myDB.action('UPDATE albums SET status = "Downloaded" WHERE AlbumID=?', [albumid])
|
myDB.action('UPDATE albums SET status = "Downloaded" WHERE AlbumID=?', [albumid])
|
||||||
myDB.action('UPDATE snatched SET status = "Processed" WHERE AlbumID=?', [albumid])
|
myDB.action('UPDATE snatched SET status = "Processed" WHERE AlbumID=?', [albumid])
|
||||||
|
|
||||||
# Update the have tracks for all created dirs:
|
# Update the have tracks for all created dirs:
|
||||||
for albumpath in albumpaths:
|
for albumpath in albumpaths:
|
||||||
librarysync.libraryScan(dir=albumpath, append=True, ArtistID=release['ArtistID'], ArtistName=release['ArtistName'])
|
librarysync.libraryScan(dir=albumpath, append=True, ArtistID=release['ArtistID'], ArtistName=release['ArtistName'])
|
||||||
@@ -500,11 +500,11 @@ def addAlbumArt(artwork, albumpath, release):
|
|||||||
if album_art_name.startswith('.'):
|
if album_art_name.startswith('.'):
|
||||||
album_art_name = album_art_name.replace(0, '_')
|
album_art_name = album_art_name.replace(0, '_')
|
||||||
|
|
||||||
prev = os.umask(headphones.UMASK)
|
#prev = os.umask(headphones.UMASK)
|
||||||
file = open(os.path.join(albumpath, album_art_name), 'wb')
|
file = open(os.path.join(albumpath, album_art_name), 'wb')
|
||||||
file.write(artwork)
|
file.write(artwork)
|
||||||
file.close()
|
file.close()
|
||||||
os.umask(prev)
|
#os.umask(prev)
|
||||||
|
|
||||||
def cleanupFiles(albumpath):
|
def cleanupFiles(albumpath):
|
||||||
logger.info('Cleaning up files')
|
logger.info('Cleaning up files')
|
||||||
@@ -799,11 +799,11 @@ def embedLyrics(downloaded_track_list):
|
|||||||
logger.debug('Adding lyrics to: %s' % downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
|
logger.debug('Adding lyrics to: %s' % downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
|
||||||
f.lyrics = metalyrics
|
f.lyrics = metalyrics
|
||||||
try:
|
try:
|
||||||
f.save()
|
f.save()
|
||||||
except:
|
except:
|
||||||
logger.error('Cannot save lyrics to: %s. Skipping' % downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
|
logger.error('Cannot save lyrics to: %s. Skipping' % downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def renameFiles(albumpath, downloaded_track_list, release):
|
def renameFiles(albumpath, downloaded_track_list, release):
|
||||||
logger.info('Renaming files')
|
logger.info('Renaming files')
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user