From e04c74392ff7bfe3895bb8a65a47d37eb3d5d86c Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 28 Jan 2019 18:05:40 +0100 Subject: [PATCH] Don't lock DBs when messing with the playqueue --- resources/lib/kodi_db/__init__.py | 4 ++-- resources/lib/playlist_func.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lib/kodi_db/__init__.py b/resources/lib/kodi_db/__init__.py index 756ff79c..4778d422 100644 --- a/resources/lib/kodi_db/__init__.py +++ b/resources/lib/kodi_db/__init__.py @@ -29,7 +29,7 @@ def kodiid_from_filename(path, kodi_type=None, db_type=None): filename = path.rsplit('\\', 1)[1] path = path.rsplit('\\', 1)[0] + '\\' if kodi_type == v.KODI_TYPE_SONG or db_type == 'music': - with KodiMusicDB() as kodidb: + with KodiMusicDB(lock=False) as kodidb: try: kodi_id = kodidb.song_id_from_filename(filename, path) except TypeError: @@ -37,7 +37,7 @@ def kodiid_from_filename(path, kodi_type=None, db_type=None): else: kodi_type = v.KODI_TYPE_SONG else: - with KodiVideoDB() as kodidb: + with KodiVideoDB(lock=False) as kodidb: try: kodi_id, kodi_type = kodidb.video_id_from_filename(filename, path) diff --git a/resources/lib/playlist_func.py b/resources/lib/playlist_func.py index 1ce9f525..a76d6529 100644 --- a/resources/lib/playlist_func.py +++ b/resources/lib/playlist_func.py @@ -320,7 +320,7 @@ def playlist_item_from_kodi(kodi_item): item.kodi_id = kodi_item.get('id') item.kodi_type = kodi_item.get('type') if item.kodi_id: - with PlexDB() as plexdb: + with PlexDB(lock=False) as plexdb: db_item = plexdb.item_by_kodi_id(kodi_item['id'], kodi_item['type']) if db_item: item.plex_id = db_item['plex_id'] @@ -397,7 +397,7 @@ def playlist_item_from_plex(plex_id): """ item = Playlist_Item() item.plex_id = plex_id - with PlexDB() as plexdb: + with PlexDB(lock=False) as plexdb: db_item = plexdb.item_by_id(plex_id) if db_item: item.plex_type = db_item['plex_type'] @@ -429,7 +429,7 @@ def playlist_item_from_xml(xml_video_element, kodi_id=None, kodi_type=None): item.kodi_id = kodi_id item.kodi_type = kodi_type elif item.plex_id is not None and item.plex_type != v.PLEX_TYPE_CLIP: - with PlexDB() as plexdb: + with PlexDB(lock=False) as plexdb: db_element = plexdb.item_by_id(item.plex_id) if db_element: item.kodi_id = db_element['kodi_id']