2016-06-13, 17:18
Little python script to copy all the Now cdart to the correct directories.
Tested on my now albums with no issues but YMMV !!!
As it says in the comments, set the first string to the root of where all the art is, set the second to the root of where your Now albums are stored. Edit '/' to '\' if you are on Windows! (I have not tested this on a windows machine so........) Run script
Note, my albums are named "Now That's what I call Music 6" OR "Now That's what I call Music! 58". Either works fine for me as the earlier albums do not have the ! in the title. Script just looks for a directory starting with "Now", matches the number on the end and then copies over the art.
NOTE 2 - No checks are done for existing cdart, so it'll be replaced if it exists. If you have some, you might want to bear this in mind or not copy the script.
PHP Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import io
import shutil
import string
path = '/home/xbmc/Dropbox/NOW MUSIC DISCS/' # set to root of where Leepenny's Now discs are
done =[]
for dirName, subdirList, fileList in os.walk(path):
path_name = dirName + '/cdart.png'
path_name2 = dirName + '/cdart2.png'
if os.path.isfile(path_name):
wanted_album = dirName[-2:].lower().replace(' ','',1)
for dirpath, dirnames,filenames in os.walk('/media/sde1/Music/Compilations'): # set to root of where your Now albums are
if 'Now' in dirpath:
if wanted_album in dirpath:
my_dir = dirpath[-2:].lower().replace(' ','',1)
if wanted_album == my_dir:
if not dirpath in done:
done.append(dirpath)
shutil.copy(path_name,dirpath+'/cdart.png')
shutil.copy(path_name2, dirpath + '/cdart2.png')
for dirpath in done:
print "Done %s" % dirpath
Tested on my now albums with no issues but YMMV !!!
As it says in the comments, set the first string to the root of where all the art is, set the second to the root of where your Now albums are stored. Edit '/' to '\' if you are on Windows! (I have not tested this on a windows machine so........) Run script
Note, my albums are named "Now That's what I call Music 6" OR "Now That's what I call Music! 58". Either works fine for me as the earlier albums do not have the ! in the title. Script just looks for a directory starting with "Now", matches the number on the end and then copies over the art.
NOTE 2 - No checks are done for existing cdart, so it'll be replaced if it exists. If you have some, you might want to bear this in mind or not copy the script.