From f716df0c29a8bc9033825724d5ae3d68edc8e298 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 2 May 2021 13:15:23 +0200 Subject: [PATCH 1/3] Direct paths: fix pathId in Kodi movie table --- resources/lib/itemtypes/movies.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/lib/itemtypes/movies.py b/resources/lib/itemtypes/movies.py index 2c5d1636..4fc93348 100644 --- a/resources/lib/itemtypes/movies.py +++ b/resources/lib/itemtypes/movies.py @@ -65,6 +65,7 @@ class Movie(ItemBase): content='movies', scraper='metadata.local') path = library_path + kodi_parent_pathid = kodi_pathid else: # Plex library contains folders named identical to the # video file, e.g. @@ -81,6 +82,7 @@ class Movie(ItemBase): path = video_path else: kodi_pathid = self.kodidb.get_path(path) + kodi_parent_pathid = kodi_pathid if update_item: LOG.info('UPDATE movie plex_id: %s - %s', plex_id, api.title()) @@ -145,7 +147,7 @@ class Movie(ItemBase): api.trailer(), api.list_to_string(api.countries()), path, - kodi_pathid, + kodi_parent_pathid, api.premiere_date(), api.userrating()) From a355aee718ad46c9195f9c85f5dd3b476d5bef42 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 2 May 2021 13:30:57 +0200 Subject: [PATCH 2/3] Direct paths: set exclude=0 and allAudio=0 in video path table --- resources/lib/kodi_db/video.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/lib/kodi_db/video.py b/resources/lib/kodi_db/video.py index 47fc9559..2c3e8a74 100644 --- a/resources/lib/kodi_db/video.py +++ b/resources/lib/kodi_db/video.py @@ -45,13 +45,15 @@ class KodiVideoDB(common.KodiDBBase): strContent, strScraper, noUpdate, - exclude) - VALUES (?, ?, ?, ?, ?) + exclude, + allAudio) + VALUES (?, ?, ?, ?, ?, ?) ''' self.cursor.execute(query, (path, kind, 'metadata.local', 1, + 0, 0)) @db.catch_operationalerrors @@ -108,11 +110,13 @@ class KodiVideoDB(common.KodiDBBase): idParentPath, strContent, strScraper, - noUpdate) - VALUES (?, ?, ?, ?, ?, ?) + noUpdate, + exclude, + allAudio) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) ''', (path, date_added, id_parent_path, content, - scraper, 1)) + scraper, 1, 0, 0)) pathid = self.cursor.lastrowid return pathid From 054332079d7e08f72fa1251a856c0d04d0adad82 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 2 May 2021 13:40:02 +0200 Subject: [PATCH 3/3] Require Kodi database reset for PKC versions < 3.1.3 --- resources/lib/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 39724ec0..ed6b2e4c 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -84,7 +84,7 @@ COMPANION_PORT = int(_ADDON.getSetting('companionPort')) PKC_MACHINE_IDENTIFIER = None # Minimal PKC version needed for the Kodi database - otherwise need to recreate -MIN_DB_VERSION = '3.1.1' +MIN_DB_VERSION = '3.1.3' # Supported databases - version numbers in tuples should decrease SUPPORTED_VIDEO_DB = {