Esempio n. 1
0
def execute_library_tasks(videoid, task_handlers, title, nfo_settings=None):
    """Execute library tasks for videoid and show errors in foreground"""
    for task_handler in task_handlers:
        execute_tasks(title=title,
                      tasks=compile_tasks(videoid, task_handler, nfo_settings),
                      task_handler=task_handler,
                      notify_errors=True,
                      library_home=library_path())
Esempio n. 2
0
def execute_library_tasks_silently(videoid,
                                   task_handlers,
                                   title=None,
                                   nfo_settings=None):
    """Execute library tasks for videoid and don't show any GUI feedback"""
    # pylint: disable=unused-argument
    for task_handler in task_handlers:
        for task in compile_tasks(videoid, task_handler, nfo_settings):
            try:
                task_handler(task, library_path())
            except Exception:  # pylint: disable=broad-except
                import traceback
                common.error(traceback.format_exc())
                common.error('{} of {} failed', task_handler.__name__,
                             task['title'])
Esempio n. 3
0
def execute_library_tasks(videoid,
                          task_handlers,
                          title,
                          sync_mylist=True,
                          nfo_settings=None):
    """Execute library tasks for videoid and show errors in foreground"""
    for task_handler in task_handlers:
        execute_tasks(title=title,
                      tasks=compile_tasks(videoid, task_handler, nfo_settings),
                      task_handler=task_handler,
                      notify_errors=True,
                      library_home=library_path())

        # Exclude update operations
        if task_handlers != [remove_item, export_item]:
            _sync_mylist(videoid, task_handler, sync_mylist)