From 61e4056a1320f45ab7b0a6985403b86b1e0c0fc0 Mon Sep 17 00:00:00 2001 From: croneter Date: Wed, 29 Jul 2020 17:42:04 +0200 Subject: [PATCH] Fix UnboundLocalError when certain Plex sections are deleted or un-synced --- resources/lib/library_sync/sections.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/lib/library_sync/sections.py b/resources/lib/library_sync/sections.py index da97e455..46af7e24 100644 --- a/resources/lib/library_sync/sections.py +++ b/resources/lib/library_sync/sections.py @@ -526,6 +526,9 @@ def _delete_kodi_db_items(section): types = ((v.PLEX_TYPE_ARTIST, itemtypes.Artist), (v.PLEX_TYPE_ALBUM, itemtypes.Album), (v.PLEX_TYPE_SONG, itemtypes.Song)) + else: + types = () + LOG.debug('Skipping deletion of DB elements for section %s', section) for plex_type, context in types: while True: with PlexDB() as plexdb: