diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 7beadab0..98f80b85 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -901,3 +901,7 @@ msgstr "" msgctxt "#33183" msgid "Enable the option to play with cinema mode" msgstr "" + +msgctxt "#33184" +msgid "Remove libraries" +msgstr "" diff --git a/resources/lib/entrypoint/default.py b/resources/lib/entrypoint/default.py index b32965b3..81f6c66d 100644 --- a/resources/lib/entrypoint/default.py +++ b/resources/lib/entrypoint/default.py @@ -97,6 +97,8 @@ class Events(object): event('RepairLibrarySelection') elif mode == 'updatelibs': event('SyncLibrarySelection') + elif mode == 'removelibs': + event('RemoveLibrarySelection') elif mode == 'addlibs': event('AddLibrarySelection') elif mode == 'connect': @@ -148,7 +150,7 @@ def listing(): view_id = window('%s.id' % window_prop) context = [] - if view_id and node in ('movies', 'tvshows', 'musicvideos', 'music') and view_id not in whitelist: + if view_id and node in ('movies', 'tvshows', 'musicvideos', 'music', 'mixed') and view_id not in whitelist: label = "%s %s" % (label, _(33166)) context.append((_(33123), "RunPlugin(plugin://plugin.video.emby/?mode=synclib&id=%s)" % view_id)) @@ -189,6 +191,7 @@ def listing(): directory(_(33154), "plugin://plugin.video.emby/?mode=addlibs", False) directory(_(33139), "plugin://plugin.video.emby/?mode=updatelibs", False) directory(_(33140), "plugin://plugin.video.emby/?mode=repairlibs", False) + directory(_(33184), "plugin://plugin.video.emby/?mode=removelibs", False) directory(_(33060), "plugin://plugin.video.emby/?mode=thememedia", False) directory(_(33058), "plugin://plugin.video.emby/?mode=reset", False) diff --git a/resources/lib/entrypoint/service.py b/resources/lib/entrypoint/service.py index f14287ef..214053f2 100644 --- a/resources/lib/entrypoint/service.py +++ b/resources/lib/entrypoint/service.py @@ -223,7 +223,7 @@ class Service(xbmc.Monitor): 'LibraryChanged', 'ServerOnline', 'SyncLibrary', 'RepairLibrary', 'RemoveLibrary', 'EmbyConnect', 'SyncLibrarySelection', 'RepairLibrarySelection', 'AddServer', 'Unauthorized', 'UpdateServer', 'UserConfigurationUpdated', 'ServerRestarting', - 'RemoveServer', 'AddLibrarySelection', 'CheckUpdate'): + 'RemoveServer', 'AddLibrarySelection', 'CheckUpdate', 'RemoveLibrarySelection'): return data = json.loads(data)[0] @@ -337,7 +337,7 @@ class Service(xbmc.Monitor): window('emby_should_stop.bool', True) self.running = False - elif method in ('SyncLibrarySelection', 'RepairLibrarySelection', 'AddLibrarySelection'): + elif method in ('SyncLibrarySelection', 'RepairLibrarySelection', 'AddLibrarySelection', 'RemoveLibrarySelection'): self.library_thread.select_libraries(method) elif method == 'SyncLibrary': diff --git a/resources/lib/library.py b/resources/lib/library.py index bdcc0162..2353bbd4 100644 --- a/resources/lib/library.py +++ b/resources/lib/library.py @@ -442,7 +442,8 @@ class Library(threading.Thread): modes = { 'SyncLibrarySelection': 'SyncLibrary', 'RepairLibrarySelection': 'RepairLibrary', - 'AddLibrarySelection': 'SyncLibrary' + 'AddLibrarySelection': 'SyncLibrary', + 'RemoveLibrarySelection': 'RemoveLibrary' } sync = get_sync() whitelist = [x.replace('Mixed:', "") for x in sync['Whitelist']] @@ -451,7 +452,7 @@ class Library(threading.Thread): with Database('emby') as embydb: db = emby_db.EmbyDatabase(embydb.cursor) - if mode in ('SyncLibrarySelection', 'RepairLibrarySelection'): + if mode in ('SyncLibrarySelection', 'RepairLibrarySelection', 'RemoveLibrarySelection'): for library in sync['Whitelist']: name = db.get_view_name(library.replace('Mixed:', "")) @@ -504,8 +505,8 @@ class Library(threading.Thread): with Database('emby') as embydb: db = emby_db.EmbyDatabase(embydb.cursor) - library = db.get_view(library_id) - items = db.get_item_by_media_folder(library_id) + library = db.get_view(library_id.replace('Mixed:', "")) + items = db.get_item_by_media_folder(library_id.replace('Mixed:', "")) media = 'music' if library[1] == 'music' else 'video' if media == 'music':