Correctly update views on server switch

This commit is contained in:
tomkat83 2016-05-29 16:58:54 +02:00
parent e80f38c690
commit 42f24e1688

View file

@ -734,11 +734,11 @@ class LibrarySync(Thread):
# Reopen DB connection to ensure that changes were commited before # Reopen DB connection to ensure that changes were commited before
with embydb.GetEmbyDB() as emby_db: with embydb.GetEmbyDB() as emby_db:
# update views for all:
self.views = emby_db.getAllViewInfo()
self.logMsg("Removing views: %s" % self.old_views, 1) self.logMsg("Removing views: %s" % self.old_views, 1)
for view in self.old_views: for view in self.old_views:
emby_db.removeView(view) emby_db.removeView(view)
# update views for all:
self.views = emby_db.getAllViewInfo()
self.logMsg("Finished processing views. Views saved: %s" self.logMsg("Finished processing views. Views saved: %s"
% self.views, 1) % self.views, 1)