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:
Jeroen De Meerleer 2025-05-06 10:21:40 +02:00
commit 72bfc5dacf
No known key found for this signature in database
GPG key ID: 28CCCB8F62BFADD6

View file

@ -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