def _update_library(videoids_to_update, exported_tvshows_videoids_values,
                    silent):
    execute_lib_tasks_method = execute_library_tasks_silently if silent else execute_library_tasks
    # Get the list of the Tv Shows exported to exclude from updates
    excluded_videoids_values = g.SHARED_DB.get_tvshows_id_list(
        VidLibProp['exclude_update'], True)
    for videoid in videoids_to_update:
        # Check if current videoid is excluded from updates
        if videoid.value in excluded_videoids_values:
            continue
        if videoid.value in exported_tvshows_videoids_values:
            # It is possible that the user has chosen not to export NFO files for a tv show
            nfo_export = g.SHARED_DB.get_tvshow_property(
                videoid.value, VidLibProp['nfo_export'], False)
            nfo_settings = nfo.NFOSettings(nfo_export)
        else:
            nfo_settings = nfo.NFOSettings()
        if videoid.mediatype == common.VideoId.SHOW:
            export_new_episodes(videoid, silent, nfo_settings)
        if videoid.mediatype == common.VideoId.MOVIE:
            execute_lib_tasks_method(videoid, [export_item],
                                     sync_mylist=False,
                                     nfo_settings=nfo_settings)
        # Add some randomness between operations to limit servers load and ban risks
        xbmc.sleep(random.randint(1000, 5001))
예제 #2
0
 def export_new_episodes(self, videoid):
     library.export_new_episodes(videoid)