diff --git a/jellyfin_kodi/objects/kodi/movies.py b/jellyfin_kodi/objects/kodi/movies.py index 71cbe324..0d72ab5f 100644 --- a/jellyfin_kodi/objects/kodi/movies.py +++ b/jellyfin_kodi/objects/kodi/movies.py @@ -144,7 +144,7 @@ class Movies(Kodi): # subsequent runs to not be a meaningful delay if 131 <= version_id < 134: changes = self.omega_migration() - + if version_id >= 134: changes = self.piers_migration() @@ -178,7 +178,7 @@ class Movies(Kodi): # Sets all existing movies without a version to standard version for entry in self.cursor.fetchall(): - self.add_videoversion(entry[0], entry[1], "movie", "1", 40400) + self.add_videoversion(entry[0], entry[1], "movie", 40400, 40400) changes = True LOG.info("Piers database migration is complete") diff --git a/jellyfin_kodi/objects/kodi/queries.py b/jellyfin_kodi/objects/kodi/queries.py index 738b8c7f..8f194ee8 100644 --- a/jellyfin_kodi/objects/kodi/queries.py +++ b/jellyfin_kodi/objects/kodi/queries.py @@ -409,12 +409,12 @@ VALUES (?, ?) add_set_obj = ["{Title}", "{Overview}"] add_video_version = """ INSERT INTO videoversion(idFile, idMedia, media_type, itemType, idType) -VALUES (?, ?, ?, ?, ?) +VALUES (?, ?, ?, (SELECT itemType FROM videoversiontype WHERE id = ?), ?) """ check_video_version = """ SELECT COUNT(name) FROM sqlite_master WHERE type='table' AND name='videoversion' """ -add_video_version_obj = ["{FileId}", "{MovieId}", "movie", "1", 40400] +add_video_version_obj = ["{FileId}", "{MovieId}", "movie", 40400, 40400] add_musicvideo = """ INSERT INTO musicvideo(idMVideo, idFile, c00, c04, c05, c06, c07, c08, c09, c10, c11, c12, premiered)