def tv_add_to_library(id): library_folder = lib_tvshows.setup_library(plugin.get_setting('tv_library_folder', unicode)) show = TVDB[int(id)] imdb = show['imdb_id'] library_folder = lib_tvshows.setup_library(plugin.get_setting('tv_library_folder', unicode)) if lib_tvshows.add_tvshow_to_library(library_folder, show): plugin.setProperty('plugin.video.openmeta.clean_library', 'true') tools.scan_library(path=plugin.get_setting('tv_library_folder', unicode))
def tv_add_to_library_parsed(id, player): if id.startswith('tt'): try: id = TVDB.search_by_imdb(id) except: plugin.ok('TV show not found', 'no show information found for %s in TheTVDB' % id) library_folder = lib_tvshows.setup_library(plugin.get_setting('tv_library_folder', unicode)) show = TVDB[int(id)] imdb = show['imdb_id'] library_folder = lib_tvshows.setup_library(plugin.get_setting('tv_library_folder', unicode)) if lib_tvshows.add_tvshow_to_library(library_folder, show, player): plugin.setProperty('plugin.video.openmeta.clean_library', 'true') tools.scan_library(path=plugin.get_setting('tv_library_folder', unicode))