8000 Fix movies sync for Kodi 22 Piers by JeroenED · Pull Request #993 · jellyfin/jellyfin-kodi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix movies sync for Kodi 22 Piers #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion jellyfin_kodi/objects/kodi/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ def migrations(self):

# 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):
Expand All @@ -163,3 +166,20 @@ def omega_migration(self):

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", 40400, 40400)
changes = True

LOG.info("Piers database migration is complete")
return changes
4 changes: 2 additions & 2 deletions jellyfin_kodi/objects/kodi/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,12 @@
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", "0", 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)
Expand Down
2 changes: 1 addition & 1 deletion release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ changelog: |-
dependencies:
py3:
- addon: 'xbmc.python'
version: '3.0.0'
version: '3.0.1'
- addon: 'script.module.requests'
version: '2.22.0+matrix.1'
- addon: 'script.module.dateutil'
Expand Down
370F
0