Exemplo n.º 1
0
 def _set_thedir(self, theartist, dirtype):
     CacheName = itemHash(theartist)
     thedir = xbmc.translatePath('special://profile/addon_data/%s/%s/%s/' % ( addonname , dirtype, CacheName, )).decode('utf-8')
     exists, loglines = checkPath( thedir )
     lw.log( loglines )
     return thedir
Exemplo n.º 2
0
 lw.log( ['attempting to move from %s to %s' % (old_loc, new_loc)] )
 try:
     folders, fls = xbmcvfs.listdir( old_loc )
 except OSError:
     lw.log( ['no directory found: ' + old_loc] )
     return
 except Exception, e:
     lw.log( ['unexpected error while getting directory list', e] )
     return
 for folder in folders:
     if type == 'cache':
         old_folder = os.path.join( old_loc, folder )
         new_folder = os.path.join( new_loc, folder )
     elif type == 'local':
         old_folder = os.path.join( old_loc, smartUTF8(folder).decode('utf-8'), self.FANARTFOLDER )
         new_folder = os.path.join( new_loc, itemHash(folder) )
     try:
         dirs, old_files = xbmcvfs.listdir( old_folder )
     except Exception, e:
         lw.log( ['unexpected error while getting directory list', e] )
         old_files = []
     exclude_path = os.path.join( old_folder, '_exclusions.nfo' )
     if old_files and type == 'cache' and not xbmcvfs.exists(exclude_path):
         success, loglines = writeFile( '', exclude_path )
         lw.log( loglines )
     for old_file in old_files:
         if old_file.endswith( '.nfo' ) and not old_file == '_exclusions.nfo':
             exists, loglines = checkPath( new_folder )
             lw.log( loglines )
             new_file = old_file.strip('_')
             if new_file == 'artistimagesfanarttv.nfo':