mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-10-09 10:22:05 +00:00
Adds Piers database migration logic
Introduces a new migration step for Kodi versions 134 and above by implementing the piers_migration method. This ensures all existing movies without a version receive a standard version, enhancing database consistency. Omega migration logic is now limited to versions between 131 and 133. No additional context provided.
This commit is contained in:
parent
5c94481663
commit
72bfc5dacf
1 changed files with 22 additions and 2 deletions
|
@ -142,9 +142,12 @@ class Movies(Kodi):
|
|||
|
||||
# Will run every time Kodi starts, but will be fast enough on
|
||||
# subsequent runs to not be a meaningful delay
|
||||
if version_id >= 131:
|
||||
if 131 <= version_id < 134:
|
||||
changes = self.omega_migration()
|
||||
|
||||
if version_id >= 134:
|
||||
changes = self.piers_migration()
|
||||
|
||||
return changes
|
||||
|
||||
def omega_migration(self):
|
||||
|
@ -158,8 +161,25 @@ 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", "0", 40400)
|
||||
changes = True
|
||||
|
||||
LOG.info("Omega database migration is complete")
|
||||
return changes
|
||||
|
||||
def piers_migration(self):
|
||||
"""
|
||||
Adds a video version for all existing movies
|
||||
"""
|
||||
LOG.info("Starting migration for Piers database changes")
|
||||
# Tracks if this migration made any changes
|
||||
changes = False
|
||||
self.cursor.execute(QU.get_missing_versions)
|
||||
|
||||
# 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)
|
||||
changes = True
|
||||
|
||||
LOG.info("Piers database migration is complete")
|
||||
return changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue