-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add automatic database migration for Kodi Omega #834
Conversation
Quality Gate passedIssues Measures |
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.
I think it would be a good idea to have a look at how Django handles database migrations.
I think it is similar to this, except migration version is tracked in a table, and there's some magic to detect modules which are migrations.
This looks good for now tho.
No complications introduced for Kodi 20 as far as I can tell, but I've yet to test migration from 20 -> 21.
I'd like to test the migration itself, but I don't have the opportunity for a few days yet, so if you feel like yolo merging and pushing out a release now, that is fine with me.
That was my initial plan, and the purpose of the version field in that imo waiting for more testing is fine. First migration we've done like this, afaik, so testing is good. |
I can't seem to find actual packages of the Kodi RCs, and I can't be bothered to figure out how to build it. I can still watch my series in Kodi 20 with this patch locally. 🤷♂️ |
Had Kodi beta 2 installed and updated the addon to v1.0.0. Updated Kodi to the latest RC and got the same behaviour as before, missing movie library. On another Android device with Beta 2 installed I tried to add a movie library with V1 of the addon but it just stalled at the first movie, shows added fine. Kodi mirror |
also missing movie library with latest RC/coreelec and 1.0.0, same behavior as 0.7.12. can post log as well once I get home from work. tried cleaning libraries in kodi, fixing libraries and rebuilding libraries in plugin, no success, but I was able to add my movie library each time edit: log after fresh boot, cleared library and scanned in with plugin. TVs, music videos, and music shares all appear but movies are empty. more info on setup - kodi 21.0-RC2, running on an android device flashed with coreelec 21.0-omega_rc2, add-on mode, jellyfin server 10.8.13 also possibly of note - if i clean library in kodi settings/media after scan it claims media items from the plugin are unavailable and asks if i want to remove them. Once for items from "plugin://plugin.media.video.jellyfin/" then again for items from "plugin://plugin.media.video.jellyfin/f137a2dd..." If i remove the first my music videos and movie libraries are outright removed, my tv library is sort of removed where I can only browse it via the plugin. dynamic mode is unavailable for all libraries as the plugin thinks they're still loaded, they're just empty now. If i remove the second entry it just removes the music video library. There's also a very long delay, like 1-2 minutes long, to access the plugin library after cleaning the library via kodi's menu if i remove the library I can still access and play my movies via dynamic mode although this is slow to load |
Logs aren't helpful in this case. On @kontell's first log and @quixotic120 log, they both indicate the migration ran without errors. @kontell's second log the migration never ran, because it's not an upgrade at that point, it's a fresh sync. And also no errors that I can see. And of course, I can't replicate the issue on my desktop or on a libreelec nightly build. If you want to know if this is the same issue, you need to look in the "Clean library" has never worked, and will never work in the addon's current design. This is a very longstanding issue because we're doing what the Kodi devs explicitly say not to do and it can't be helped. Don't click that button. If you need to modify Jellyfin things in the database, go through the addon. Lastly, if you're continuing to have an issue, please go to the actual issue and don't spread information across multiple places. Especially as this PR wasn't even what actually fixed said issue and simply made a migration for the fix somebody else implemented. |
Builds off of #831 to fix #808
Detects if the video database version is 131 or higher (Kodi Omega beta3) to trigger a migration. Sets all existing movies that are missing a version as a "standard" version like the original PR.
Also cleans up a few linter spacing complaints from the original PR that I missed during my review.