def _download( self, src, dst, dst2 ): if (not xbmc.abortRequested): tmpname = xbmc.translatePath('special://profile/addon_data/%s/temp/%s' % ( addonname , xbmc.getCacheThumbName(src) )) lw.log( ['the tmpname is ' + tmpname] ) if xbmcvfs.exists(tmpname): success, loglines = deleteFile( tmpname ) lw.log( loglines ) success, loglines, urldata = imgURL.Get( src, params=self.params ) lw.log( loglines ) if success: success, loglines = writeFile( urldata, tmpname ) lw.log( loglines ) if not success: return False if xbmcvfs.Stat( tmpname ).st_size() > 999: image_ext = getImageType( tmpname ) if not xbmcvfs.exists ( dst + image_ext ): lw.log( ['copying %s to %s' % (tmpname, dst2 + image_ext)] ) xbmcvfs.copy( tmpname, dst2 + image_ext ) lw.log( ['moving %s to %s' % (tmpname, dst + image_ext)] ) xbmcvfs.rename( tmpname, dst + image_ext ) return True else: lw.log( ['image already exists, deleting temporary file'] ) success, loglines = deleteFile( tmpname ) lw.log( loglines ) return False else: success, loglines = deleteFile( tmpname ) lw.log( loglines ) return False
return for folder in folders: lw.log( ['checking ' + folder] ) if type == 'cache': thepath = os.path.join( loc, smartUTF8(folder).decode('utf-8') ) elif type == 'local': thepath = os.path.join( loc, smartUTF8(folder).decode('utf-8'), self.FANARTFOLDER ) try: dirs, files = xbmcvfs.listdir( thepath ) except Exception, e: lw.log( ['unexpected error while getting file list', e] ) files = [] for file in files: if file.endswith( '.tbn' ): old_path = os.path.join( thepath, file ) new_file = file.replace( '.tbn', getImageType( old_path ) ) new_path = os.path.join( thepath, new_file ) xbmcvfs.rename( old_path, new_path ) lw.log( ['renaming %s to %s' % (old_path, new_path)] ) lw.log( ['finished renaming .tbn files with correct extension'] ) def _set_artwork_skininfo( self, dir ): self._set_property("ArtistSlideshow", dir) self._set_property("ArtistSlideshow.ArtworkReady", "true") def _set_cachedir( self, theartist ): self.CacheDir = self._set_thedir( theartist, "ArtistSlideshow" )