def borrar_torrent(item): if os.path.isdir(filesystem.EncodePath(item.url)): import shutil shutil.rmtree(filesystem.EncodePath(item.url)) guitools.Refresh() else: os.remove(filesystem.EncodePath(item.url)) guitools.Refresh()
def add_again_to_downloads(item, VideoItem=None): from core import descargas descargas.mover_descarga_error_a_pendiente(item) guitools.Dialog_OK(config.get_localized_string(30101), item.title + "\n" + config.get_localized_string(30107) ) # 'Ha pasado de nuevo a la lista de descargas' guitools.Refresh()
def remove_from_error_downloads(item, VideoItem=None): from core import descargas descargas.delete_error_bookmark(item) guitools.Dialog_OK( config.get_localized_string(30101), item.title + "\n" + config.get_localized_string(30106)) # 'Se ha quitado de la lista' guitools.Refresh()
def borrar_busqueda(item): itemlist = [] presets = config.get_setting("presets_buscados").split("|") presets.remove(item.url) config.set_setting("presets_buscados",'|'.join(presets)) from core import guitools guitools.Refresh()
def remove_from_downloads(item, VideoItem=None): from core import descargas # La categoría es el nombre del fichero en la lista de descargas descargas.BorrarDescarga(item) guitools.Dialog_OK(config.get_localized_string(30101), item.title + "\n" + config.get_localized_string(30106) ) # 'Se ha quitado de lista de descargas' guitools.Refresh()
def remove_from_favorites(item, VideoItem=None): from core import favoritos favoritos.BorrarFavorito(item) guitools.Dialog_OK( config.get_localized_string(30102), item.title + "\n" + config.get_localized_string(30105)) # 'Se ha quitado de favoritos' guitools.Refresh()
def CambiarMultithread(item): itemlist=[] if config.get_setting("buscador_multithread") =="1": config.set_setting("buscador_multithread",'0') else: config.set_setting("buscador_multithread",'1') from core import guitools guitools.Refresh()
def CambiarModo(item): itemlist=[] if config.get_setting("buscador_resultados") =="1": config.set_setting("buscador_resultados",'0') else: config.set_setting("buscador_resultados",'1') from core import guitools guitools.Refresh()
def DesactivarTodos(item): itemlist=[] ConfigCanales = [] if config.get_setting("canales_buscador"): ConfigCanales.extend(config.get_setting("canales_buscador").split("|")) for x, Config in enumerate(ConfigCanales): ConfigCanales[x] = ConfigCanales[x].split(",")[0] +","+ "0" +"," + ConfigCanales[x].split(",")[2]+"," + ConfigCanales[x].split(",")[3] config.set_setting("canales_buscador",'|'.join(ConfigCanales)) from core import guitools guitools.Refresh()
def BorrarDescarga(item, Ruta=DOWNLOAD_LIST_PATH): logger.info("[descargas.py] BorrarDescarga") if not usingsamba(Ruta): os.remove(item.url) else: fullfilename = item.url.replace("\\", "/") partes = fullfilename.split("/") filename = partes[len(partes) - 1] samba.remove_file(filename, Ruta) import guitools guitools.Refresh()
def ActivarDesactivar(item): IndexConfig, ConfigCanales = ExtraerIndice(item.url) Activo = ConfigCanales[IndexConfig].split(",")[1] if Activo == "1": Activo ="0" else: Activo ="1" ConfigCanales[IndexConfig] = ConfigCanales[IndexConfig].split(",")[0] +","+ Activo+"," + ConfigCanales[IndexConfig].split(",")[2]+"," + ConfigCanales[IndexConfig].split(",")[3] config.set_setting("canales_buscador",'|'.join(ConfigCanales)) itemlist=[] from core import guitools guitools.Refresh()
def extract(item): if item.url.endswith("zip"): import ziptools unzipper = ziptools.ziptools() dirs, files = unzipper._listdirsandfiles(item.url) if "\\" in files[0] or "/" in files[0]: unzipper.extract(item.url, os.path.dirname(item.url)) else: unzipper.extract(item.url, os.path.splitext(item.url)[0]) if item.url.endswith("rar"): import rartools unzipper = rartools.rartools() dirs, files = unzipper._listdirsandfiles(item.url) if "\\" in files[0] or "/" in files[0]: unzipper.extract(item.url, os.path.dirname(item.url)) else: unzipper.extract(item.url, os.path.splitext(item.url)[0]) guitools.Refresh()