def _sync_library(videoid, operation):
    operation = {
        'add': 'export_silent',
        'remove': 'remove_silent'}.get(operation)
    if operation and g.ADDON.getSettingBool('mylist_library_sync'):
        common.debug('Syncing library due to change of my list')
        # We need to wait a little before syncing the library to prevent race
        # conditions with the Container refresh
        common.schedule_builtin(
            '00:03',
            common.run_plugin_action(
                common.build_url([operation], videoid, mode=g.MODE_LIBRARY)),
            name='NetflixLibrarySync')
Esempio n. 2
0
def _sync_library(videoid, operation):
    operation = {
        'add': 'export_silent',
        'remove': 'remove_silent'
    }.get(operation)
    if operation and g.ADDON.getSettingBool('mylist_library_sync'):
        # This is a temporary workaround to prevent export from mylist of non owner account profiles
        # TODO: in the future you can also add the possibility to synchronize from a chosen profile
        is_account_owner = g.LOCAL_DB.get_profile_config(
            'isAccountOwner', False)
        if not is_account_owner:
            return
        common.debug('Syncing library due to change of my list')
        # We need to wait a little before syncing the library to prevent race
        # conditions with the Container refresh
        common.schedule_builtin('00:03',
                                common.run_plugin_action(
                                    common.build_url([operation],
                                                     videoid,
                                                     mode=g.MODE_LIBRARY)),
                                name='NetflixLibrarySync')