def tv_add_to_library(id): import_tvdb() library_folder = setup_library(plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) show = tvdb[int(id)] imdb = show['imdb_id'] # get active players players = active_players("tvshows", filters = {'network': show.get('network')}) # get selected player if plugin.get_setting(SETTING_TV_DEFAULT_AUTO_ADD, bool) == True: player = plugin.get_setting(SETTING_TV_DEFAULT_PLAYER_FROM_LIBRARY, unicode) else: players.insert(0, ADDON_SELECTOR) players.insert(0, ADDON_DEFAULT) selection = dialogs.select(_("Play with..."), [p.title for p in players]) if selection == -1: return player = players[selection] # setup library folder library_folder = setup_library(plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) # add to library if plugin.get_setting('tv_default_auto_add', bool): if add_tvshow_to_library(library_folder, show, player): set_property("clean_library", 1) else: if add_tvshow_to_library(library_folder, show, player.id): set_property("clean_library", 1) # start scan scan_library(type="video")
def tv_add_to_library(id): import_tvdb() show = tvdb[int(id)] # get active players players = active_players("tvshows", filters = {'network': show.get('network')}) # add default and selector options players.insert(0, ADDON_SELECTOR) players.insert(0, ADDON_DEFAULT) # let the user select one player selection = dialogs.select(_("Play with..."), [p.title for p in players]) if selection == -1: return # get selected player player = players[selection] # setup library folder library_folder = setup_library(plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) # add to library if add_tvshow_to_library(library_folder, show, player.id): set_property("clean_library", 1) # start scan scan_library()
def tv_add_to_library(id): import_tvdb() show = tvdb[int(id)] # get active players players = active_players("tvshows", filters={'network': show.get('network')}) # add default and selector options players.insert(0, ADDON_SELECTOR) players.insert(0, ADDON_DEFAULT) # let the user select one player selection = dialogs.select(_("Play with..."), [p.title for p in players]) if selection == -1: return # get selected player player = players[selection] # setup library folder library_folder = setup_library( plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) # add to library if add_tvshow_to_library(library_folder, show, player.id): set_property("clean_library", 1) # start scan scan_library()
def tv_add_all_to_library(items): import_tvdb() # setup library folder library_folder = setup_library(plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) # add to library for item in items: ids = item["show"]["ids"] tvdb_id = ids.get('tvdb') if not tvdb_id: continue show = tvdb[int(tvdb_id)] if plugin.get_setting(SETTING_TV_DEFAULT_AUTO_ADD, bool) == True: if add_tvshow_to_library(library_folder, show, plugin.get_setting(SETTING_TV_DEFAULT_PLAYER_FROM_LIBRARY, unicode)): set_property("clean_library", 1) else: if add_tvshow_to_library(library_folder, show, ADDON_DEFAULT.id): set_property("clean_library", 1) # start scan scan_library(type="video")
def tv_add_all_to_library(items): import_tvdb() # setup library folder library_folder = setup_library(plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)) # add to library for item in items: ids = item["show"]["ids"] tvdb_id = ids.get('tvdb') if not tvdb_id: continue show = tvdb[int(tvdb_id)] if add_tvshow_to_library(library_folder, show, ADDON_DEFAULT.id): set_property("clean_library", 1) # start scan scan_library()