NOW albums
#26
Little python script to copy all the Now cdart to the correct directories.

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 
dirNamesubdirListfileList 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 
dirpathdirnames,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_name2dirpath '/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 Smile

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.
Learning Linux the hard way !!
Reply


Messages In This Thread
NOW albums - by leepenny - 2016-05-18, 12:59
RE: NOW albums - by zag - 2016-05-18, 14:04
RE: NOW albums - by black_eagle - 2016-05-18, 14:07
RE: NOW albums - by leepenny - 2016-05-18, 14:18
RE: NOW albums - by bry - 2016-05-18, 14:31
RE: NOW albums - by Mike_Doc - 2016-05-18, 15:38
RE: NOW albums - by black_eagle - 2016-05-18, 22:52
RE: NOW albums - by leepenny - 2016-05-18, 23:03
RE: NOW albums - by leepenny - 2016-05-19, 02:25
RE: NOW albums - by black_eagle - 2016-05-19, 08:25
RE: NOW albums - by leepenny - 2016-05-19, 12:06
RE: NOW albums - by zag - 2016-05-20, 11:00
RE: NOW albums - by leepenny - 2016-05-20, 11:34
RE: NOW albums - by leepenny - 2016-05-22, 16:19
RE: NOW albums - by zag - 2016-05-23, 19:36
RE: NOW albums - by leepenny - 2016-05-23, 22:20
RE: NOW albums - by zag - 2016-05-23, 22:55
RE: NOW albums - by leepenny - 2016-05-28, 02:26
RE: NOW albums - by leepenny - 2016-05-29, 02:20
RE: NOW albums - by schimi2k - 2016-05-29, 13:28
RE: NOW albums - by leepenny - 2016-05-29, 15:04
RE: NOW albums - by leepenny - 2016-06-01, 14:25
RE: NOW albums - by zag - 2016-06-03, 13:02
RE: NOW albums - by leepenny - 2016-06-07, 11:12
RE: NOW albums - by leepenny - 2016-06-12, 22:15
RE: NOW albums - by black_eagle - 2016-06-13, 17:18
RE: NOW albums - by leepenny - 2016-06-16, 12:35
RE: NOW albums - by black_eagle - 2016-06-16, 13:16
RE: NOW albums - by Mike_Doc - 2016-06-16, 12:45
RE: NOW albums - by zag - 2016-06-16, 13:07
RE: NOW albums - by leepenny - 2016-06-16, 14:43
RE: NOW albums - by leepenny - 2016-06-17, 02:26
RE: NOW albums - by leepenny - 2016-07-27, 11:51
RE: NOW albums - by leepenny - 2020-06-05, 13:27


Logout Mark Read Team Forum Stats Members Help
NOW albums0
This forum uses Lukasz Tkacz MyBB addons.