def initial_mylist_sync(self, pathitems):
     """Perform an initial sync of My List and the Kodi library"""
     # pylint: disable=unused-argument
     from resources.lib.cache import CACHE_COMMON
     # This is a temporary workaround to prevent sync 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:
         ui.show_ok_dialog('Netflix', common.get_local_string(30223))
         return
     do_it = ui.ask_for_confirmation(common.get_local_string(30122),
                                     common.get_local_string(30123))
     if not do_it:
         return
     common.debug('Performing full sync from My List to Kodi library')
     library.purge()
     nfo_settings = nfo.NFOSettings()
     nfo_settings.show_export_dialog()
     # Invalidate my-list cached data to force to obtain new data
     g.CACHE.invalidate_entry(CACHE_COMMON, 'my_list_items')
     for videoid in api.mylist_items():
         library.execute_library_tasks(videoid, [library.export_item],
                                       common.get_local_string(30018),
                                       sync_mylist=False,
                                       nfo_settings=nfo_settings)
    def initial_mylist_sync(self, pathitems):
        """Perform an initial sync of My List and the Kodi library"""
        # pylint: disable=unused-argument
        do_it = ui.ask_for_confirmation(common.get_local_string(30122),
                                        common.get_local_string(30123))
        if not do_it or not g.ADDON.getSettingBool('mylist_library_sync'):
            return

        common.debug('Performing full sync from My List to Kodi library')
        library.purge()
        for videoid in api.video_list(
                api.list_id_for_type('queue')).videoids:
            library.execute_library_tasks(videoid, library.export_item,
                                          common.get_local_string(30018),
                                          sync_mylist=False)
示例#3
0
 def initial_mylist_sync(self, pathitems):
     """Perform an initial sync of My List and the Kodi library"""
     # pylint: disable=unused-argument
     from resources.lib.cache import CACHE_COMMON
     do_it = ui.ask_for_confirmation(common.get_local_string(30122),
                                     common.get_local_string(30123))
     if not do_it:
         return
     common.debug('Performing full sync from My List to Kodi library')
     library.purge()
     nfo_settings = nfo.NFOSettings()
     nfo_settings.show_export_dialog()
     # Invalidate my-list cached data to force to obtain new data
     g.CACHE.invalidate_entry(CACHE_COMMON, 'my_list_items')
     for videoid in api.mylist_items():
         library.execute_library_tasks(videoid, [library.export_item],
                                       common.get_local_string(30018),
                                       sync_mylist=False,
                                       nfo_settings=nfo_settings)
示例#4
0
 def purge(self, pathitems):
     """Delete all previously exported items from the Kodi library"""
     # pylint: disable=unused-argument
     if ui.ask_for_confirmation(common.get_local_string(30125),
                                common.get_local_string(30126)):
         library.purge()