예제 #1
0
 def remove(self, videoid):
     """Remove an item from the Kodi library"""
     if not ui.ask_for_confirmation(common.get_local_string(30030),
                                    common.get_local_string(30124)):
         return
     get_library_cls().remove_from_library(videoid)
     common.container_refresh(use_delay=True)
예제 #2
0
 def import_library(self, pathitems):  # pylint: disable=unused-argument
     """Import previous exported STRM files to add-on and/or convert them to the current STRM format type"""
     if _check_auto_update_running():
         return
     if not ui.ask_for_confirmation(common.get_local_string(30140),
                                    common.get_local_string(20135)):
         return
     get_library_cls().import_library()
예제 #3
0
 def purge(self, pathitems):  # pylint: disable=unused-argument
     """Delete all previously exported items from the Kodi library"""
     if _check_auto_update_running():
         return
     if not ui.ask_for_confirmation(common.get_local_string(30125),
                                    common.get_local_string(30126)):
         return
     get_library_cls().clear_library()
예제 #4
0
 def auto_upd_run_now(self, pathitems):  # pylint: disable=unused-argument
     """
     Perform an auto update of Kodi library to add new seasons/episodes of tv shows
     """
     if not ui.ask_for_confirmation(common.get_local_string(30065),
                                    common.get_local_string(30231)):
         return
     get_library_cls().auto_update_library(False)
예제 #5
0
 def sync_mylist(self, pathitems):  # pylint: disable=unused-argument
     """
     Perform a full sync of Netflix "My List" with the Kodi library
     """
     if not ui.ask_for_confirmation(common.get_local_string(30122),
                                    common.get_local_string(30123)):
         return
     get_library_cls().sync_library_with_mylist()
예제 #6
0
 def lib_remove(self, pathitems, videoid=None):  # pylint: disable=unused-argument
     """Remove an item to the Kodi library"""
     if videoid.mediatype in [common.VideoId.SUPPLEMENTAL, common.VideoId.EPISODE]:
         return
     if not ui.ask_for_confirmation(common.get_local_string(30030),
                                    common.get_local_string(30124)):
         return
     get_library_cls().remove_from_library(videoid)
     common.container_refresh(use_delay=True)
예제 #7
0
 def lib_export(self, pathitems, videoid=None):  # pylint: disable=unused-argument
     """Export or update an item to the Kodi library"""
     if videoid.mediatype in [common.VideoId.SUPPLEMENTAL, common.VideoId.EPISODE]:
         return
     if lib_utils.is_videoid_in_db(videoid):
         get_library_cls().update_library(videoid)
     else:
         get_library_cls().export_to_library(videoid)
     common.container_refresh()
예제 #8
0
 def import_library(self, pathitems):  # pylint: disable=unused-argument
     """Import previous exported STRM files to add-on and/or convert them to the current STRM format type"""
     if _check_auto_update_running():
         return
     path = ui.show_browse_dialog(common.get_local_string(651),
                                  default_path=G.DATA_PATH)
     if path:
         if not ui.ask_for_confirmation(common.get_local_string(30140),
                                        common.get_local_string(20135)):
             return
         get_library_cls().import_library(path)
예제 #9
0
def sync_library(videoid, operation):
    if operation and G.ADDON.getSettingBool('lib_sync_mylist') and G.ADDON.getSettingInt('lib_auto_upd_mode') == 2:
        sync_mylist_profile_guid = G.SHARED_DB.get_value('sync_mylist_profile_guid',
                                                         G.LOCAL_DB.get_guid_owner_profile())
        # Allow to sync library with My List only by chosen profile
        if sync_mylist_profile_guid != G.LOCAL_DB.get_active_profile_guid():
            return
        LOG.debug('Syncing library due to change of My list')
        if operation == 'add':
            get_library_cls().export_to_library(videoid, False)
        elif operation == 'remove':
            get_library_cls().remove_from_library(videoid, False)
예제 #10
0
 def update(self, videoid):
     """Update an item in the Kodi library"""
     get_library_cls().update_library(videoid)
     common.container_refresh()
예제 #11
0
 def export(self, videoid):
     """Export an item to the Kodi library"""
     get_library_cls().export_to_library(videoid)
     common.container_refresh()
예제 #12
0
 def export_new_episodes(self, videoid):
     get_library_cls().export_to_library_new_episodes(videoid)