-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
base: master
Are you sure you want to change the base?
Conversation
Since kodi piers standard version is changed to 1. Sourced from the MyVideosDatabase and https://github.com/xbmc/xbmc/blob/c0be4a8e34263cb939e453dbb4ce3430b46a458c/xbmc/video/VideoManagerTypes.h#L21
This change will need version gating, and a separate migration step. We also generally don't target nightlies, so this PR will have to wait until at least beta or rc, as that generally means things are starting to stabilize. Looks like the database structure might be changing more substantially, but the migration seems to also be done in Kodi itself. // renumber itemType to free the value 0 for nodes navigation
// former value 0 for versions becomes 1
// former value 1 for extras becomes 2 A new deep dive into Kodi internals may be needed for Piers release. |
As I am currently on the latest nightly myself for another (non-jellyfin related) issue, I will keep this PR updated with changes required for piers. I use the capabilities of the plugin not on a daily basis but I easily see when something goes wrong. Also, you're not targetting nightlies which makes it not required that an issue is resolved on day 1. Is this OK for you? Or is it better to create separate PRs for further changes? |
Yea, feel free to keep this branch up to date. |
jellyfin_kodi/objects/kodi/movies.py
Outdated
@@ -158,7 +158,7 @@ def omega_migration(self): | |||
|
|||
# Sets all existing movies without a version to standard version | |||
for entry in self.cursor.fetchall(): | |||
self.add_videoversion(entry[0], entry[1], "movie", "0", 40400) | |||
self.add_videoversion(entry[0], entry[1], "movie", "1", 40400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes for later:
Needs separate migration step for Piers, see earlier comment.
May or may not actually need to do this migration, as looking at the Kodi source, the migration is supposed to get applied on upgrade.
Probably need a check for db version and two different queries for adding instead.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #993 +/- ##
=======================================
Coverage 21.87% 21.87%
=======================================
Files 63 63
Lines 8686 8686
Branches 1411 1411
=======================================
Hits 1900 1900
Misses 6767 6767
Partials 19 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
A better option than just hard-coding the new (current) value for itemType might be to query the itemType from videoversiontype for id 40400. Doing so will allow this to work across versions without needing multiple version-gated queries, and will support any future upstream migrations to the internal type mappings. It will also allow producing an error in the case that id 40400 ever disappears, so that we can know exactly what the problem is, rather than silently corrupting data again in future. |
Is there any way to build and install this version without waiting for approval? |
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.
Omega and Piers don't have such xbmc.python version
|
Hi,
I created this pull request as I was suffering an issue with current kodi nightly. The problem seemed pretty easy to solve, however it is a problem on nightly and I am unsure if the problem will still be there when kodi piers will go stable.
Also, I feel the problem is pretty impactful, changing the type from a former version type to what used to be extras makes me feel you don't want to merge this for Omega.
Anyhow, this is what is fixing the issue for me on piers right now. It might tame the dragons before they go wild. Hope you want to merge it but no hard feeling if you take omega a priority.
Reference: https://forum.jellyfin.org/t-bug-when-using-current-kodi-nighly
Since kodi piers standard version is changed to 1.
Source from the MyVideosDatabase and https://github.com/xbmc/xbmc/blob/c0be4a8e34263cb939e453dbb4ce3430b46a458c/xbmc/video/VideoManagerTypes.h#L21
Extra reference: xbmc/xbmc@bc05180#diff-3e0425ad7a3f9835442da572adda9031febda02715ecac402eeb44a00579eb49R6675