mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-10-09 02:12:04 +00:00
Improves video version migration logic for movies
Updates migration to fetch version type dynamically from the database rather than using hardcoded values, ensuring accurate mapping during database upgrades. Refines video version insertion query to utilize the correct item type from the version type table. Helps prevent mismatches and enhances database integrity.
This commit is contained in:
parent
72bfc5dacf
commit
8428c623f0
2 changed files with 4 additions and 4 deletions
|
@ -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")
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue