def remove(self, videoid): """Remove an item from the Kodi library""" if ui.ask_for_removal_confirmation(): library.execute_library_tasks(videoid, [library.remove_item], common.get_local_string(30030)) common.refresh_container()
def update(self, videoid): """Update an item in the Kodi library""" nfo_settings = nfo.NFOSettings() nfo_settings.show_export_dialog(videoid.mediatype) library.execute_library_tasks(videoid, [library.remove_item, library.export_item], common.get_local_string(30061), nfo_settings=nfo_settings) common.refresh_container()
def save_autologin(self, pathitems): """Save autologin data""" try: g.ADDON.setSetting('autologin_user', self.params['autologin_user']) g.ADDON.setSetting('autologin_id', pathitems[1]) g.ADDON.setSetting('autologin_enable', 'true') except (KeyError, IndexError): common.error('Cannot save autologin - invalid params') g.CACHE.invalidate() common.refresh_container()
def change_watched_status(self, videoid): """Change the watched status locally""" # Todo: how get resumetime/playcount of selected item for calculate current watched status? profile_guid = g.LOCAL_DB.get_active_profile_guid() current_value = g.SHARED_DB.get_watched_status(profile_guid, videoid.value, None, bool) if current_value: txt_index = 1 g.SHARED_DB.set_watched_status(profile_guid, videoid.value, False) elif current_value is not None and not current_value: txt_index = 2 g.SHARED_DB.delete_watched_status(profile_guid, videoid.value) else: txt_index = 0 g.SHARED_DB.set_watched_status(profile_guid, videoid.value, True) ui.show_notification(common.get_local_string(30237).split('|')[txt_index]) common.refresh_container()
def change_watched_status(self, pathitems=None): # pylint: disable=unused-argument from os import path videoid = path.basename(path.normpath(xbmc.getInfoLabel('ListItem.Path'))) if videoid.isdigit(): # Todo: how get resumetime/playcount of selected item for calculate current watched status? profile_guid = g.LOCAL_DB.get_active_profile_guid() current_value = g.SHARED_DB.get_watched_status(profile_guid, videoid, None, bool) if current_value: txt_index = 1 g.SHARED_DB.set_watched_status(profile_guid, videoid, False) elif current_value is not None and not current_value: txt_index = 2 g.SHARED_DB.delete_watched_status(profile_guid, videoid) else: txt_index = 0 g.SHARED_DB.set_watched_status(profile_guid, videoid, True) ui.show_notification(common.get_local_string(30237).split('|')[txt_index]) common.refresh_container() else: common.error('No video id found in the current path: {}', path)
def my_list(self, videoid, pathitems): """Add or remove an item from my list""" operation = pathitems[1] api.update_my_list(videoid, operation) _sync_library(videoid, operation) common.refresh_container()
def include_in_auto_update(self, videoid): library.exclude_show_from_auto_update(videoid, False) common.refresh_container()
def exclude_from_auto_update(self, videoid): library.exclude_show_from_auto_update(videoid, True) common.refresh_container()
def update(self, videoid): """Update an item in the Kodi library""" library.execute_library_tasks(videoid, library.update_item, common.get_local_string(30061)) common.refresh_container()