Merge pull request #1463 from croneter/adjust-paths

Direct paths: corrections to more closely mirror Kodi's way of saving movie and tv show files to the db
This commit is contained in:
croneter 2021-05-02 13:49:53 +02:00 committed by GitHub
commit e6bf68b6f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -65,6 +65,7 @@ class Movie(ItemBase):
content='movies', content='movies',
scraper='metadata.local') scraper='metadata.local')
path = library_path path = library_path
kodi_parent_pathid = kodi_pathid
else: else:
# Plex library contains folders named identical to the # Plex library contains folders named identical to the
# video file, e.g. # video file, e.g.
@ -81,6 +82,7 @@ class Movie(ItemBase):
path = video_path path = video_path
else: else:
kodi_pathid = self.kodidb.get_path(path) kodi_pathid = self.kodidb.get_path(path)
kodi_parent_pathid = kodi_pathid
if update_item: if update_item:
LOG.info('UPDATE movie plex_id: %s - %s', plex_id, api.title()) LOG.info('UPDATE movie plex_id: %s - %s', plex_id, api.title())
@ -145,7 +147,7 @@ class Movie(ItemBase):
api.trailer(), api.trailer(),
api.list_to_string(api.countries()), api.list_to_string(api.countries()),
path, path,
kodi_pathid, kodi_parent_pathid,
api.premiere_date(), api.premiere_date(),
api.userrating()) api.userrating())

View file

@ -45,13 +45,15 @@ class KodiVideoDB(common.KodiDBBase):
strContent, strContent,
strScraper, strScraper,
noUpdate, noUpdate,
exclude) exclude,
VALUES (?, ?, ?, ?, ?) allAudio)
VALUES (?, ?, ?, ?, ?, ?)
''' '''
self.cursor.execute(query, (path, self.cursor.execute(query, (path,
kind, kind,
'metadata.local', 'metadata.local',
1, 1,
0,
0)) 0))
@db.catch_operationalerrors @db.catch_operationalerrors
@ -108,11 +110,13 @@ class KodiVideoDB(common.KodiDBBase):
idParentPath, idParentPath,
strContent, strContent,
strScraper, strScraper,
noUpdate) noUpdate,
VALUES (?, ?, ?, ?, ?, ?) exclude,
allAudio)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
''', ''',
(path, date_added, id_parent_path, content, (path, date_added, id_parent_path, content,
scraper, 1)) scraper, 1, 0, 0))
pathid = self.cursor.lastrowid pathid = self.cursor.lastrowid
return pathid return pathid

View file

@ -84,7 +84,7 @@ COMPANION_PORT = int(_ADDON.getSetting('companionPort'))
PKC_MACHINE_IDENTIFIER = None PKC_MACHINE_IDENTIFIER = None
# Minimal PKC version needed for the Kodi database - otherwise need to recreate # 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 databases - version numbers in tuples should decrease
SUPPORTED_VIDEO_DB = { SUPPORTED_VIDEO_DB = {