mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Clean up views
Remove libraries from db when they don't exist anymore
This commit is contained in:
parent
ce81a1fc33
commit
01450154fe
2 changed files with 9 additions and 1 deletions
|
@ -376,6 +376,7 @@ class Library(threading.Thread):
|
|||
|
||||
return False
|
||||
|
||||
Views().get_views()
|
||||
Views().get_nodes()
|
||||
|
||||
return True
|
||||
|
|
|
@ -117,7 +117,6 @@ class Views(object):
|
|||
|
||||
self.delete_playlist_by_id(view_id)
|
||||
self.delete_node_by_id(view_id)
|
||||
self.get_views()
|
||||
|
||||
def get_views(self):
|
||||
|
||||
|
@ -146,6 +145,14 @@ class Views(object):
|
|||
|
||||
self.add_library(library)
|
||||
|
||||
with Database('emby') as embydb:
|
||||
views = emby_db.EmbyDatabase(embydb.cursor).get_views()
|
||||
|
||||
for view in views:
|
||||
|
||||
if view[0] not in self.sync['SortedViews']:
|
||||
self.remove_library(view[0])
|
||||
|
||||
save_sync(self.sync)
|
||||
|
||||
def get_nodes(self):
|
||||
|
|
Loading…
Reference in a new issue