Skip to content
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

Movies are empty with latest Kodi #808

Closed
dbarkar opened this issue Jan 15, 2024 · 74 comments · Fixed by #834
Closed

Movies are empty with latest Kodi #808

dbarkar opened this issue Jan 15, 2024 · 74 comments · Fixed by #834
Labels
bug Something isn't working

Comments

@dbarkar
Copy link

dbarkar commented Jan 15, 2024

Describe the bug
When I install Jellyfin video plugin to Kodi and sync my library, Movies are empty. Other libraries like TV Shows are properly synchornized. Looks like video plugin "owns" Movies (I can't add folders there) but movies are not pulled.
I found this problem on Android TV, but it also happens on PC and probably on other platforms, my logs are from PC.

This is a recent regression. I checked these revisions:
xbmc/xbmc@5198ea5 (master @ 2024-Jan-13) - bugged
xbmc/xbmc@979dbf5 (21.0b2-Omega @ 2023-Dec-9) - working.

To Reproduce
Steps to reproduce the behavior:

  1. Install Kodi
  2. Setup Jellyfin server, add library for Movies
  3. Install Jellyfin plugin to Kodi, connect to the server, synchronize
  4. See that Movies are still empty

Expected behavior
Movies are synchonized.

Logs
Failure (master) - https://paste.kodi.tv/sipakinizu.kodi
Success (21.0b2-Omega) - https://paste.kodi.tv/uhavuyogus.kodi

System (please complete the following information):

  • OS: [Windows, Android]
  • Jellyfin Version: 10.8.12 (241520813c26)
  • Kodi Version: master xbmc/xbmc@5198ea5
  • Addon Version: 0.7.11+py3
  • Playback Mode: Any
@mcarlton00
Copy link
Member

This has been discussed on the forum a bit. It appears that Kodi has broken something around database versions. Hopefully whatever it was gets fixed before a full release, but we may have to change something if they don't

https://forum.jellyfin.org/t-movies-do-not-appear-on-coreelec-nightly-starting-20240109-cont

@dbarkar
Copy link
Author

dbarkar commented Jan 15, 2024

I don't think they are going to fix anything - xbmc/xbmc#24507

@mcarlton00
Copy link
Member

Oh no, they'll put absolutely no effort into doing anything for us. They hate how this addon functions, because frankly it's a disgusting hack that probably shouldn't exist. My hope is that whatever they did was unintentional and will be changed again before a full release. It probably won't and we'll have to figure out a fix, but at this moment it's looking like that has to wait until the next beta since running nightly versions is an absolute nightmare for me

@sarbes
Copy link

sarbes commented Jan 16, 2024

"Hate" is such a strong word...

There have been some DB changes involving the "movie versions" feature. I think it's plausible that this broke something on your side.

@LeVraiRoiDHyrule
Copy link

Hi, I just noticed this issue too. But I was on a nightly and then downgraded back to release 20.3. I don't know if this problem is for the same reasons as here or if it is because of the version downgrade I just did.

@pdf
Copy link
Contributor

pdf commented Jan 23, 2024

Below is the schema diff, in case it's useful

--- /tmp/20.sql	2024-01-23 23:01:02.773076425 +1100
+++ /tmp/21.sql	2024-01-23 23:01:39.772200224 +1100
@@ -28,6 +28,8 @@
 CREATE TABLE tag_link (tag_id integer, media_id integer, media_type TEXT);
 CREATE TABLE rating (rating_id INTEGER PRIMARY KEY, media_id INTEGER, media_type TEXT, rating_type TEXT, rating FLOAT, votes INTEGER);
 CREATE TABLE uniqueid (uniqueid_id INTEGER PRIMARY KEY, media_id INTEGER, media_type TEXT, value TEXT, type TEXT);
+CREATE TABLE videoversiontype (id INTEGER PRIMARY KEY, name TEXT, owner INTEGER, itemType INTEGER);
+CREATE TABLE videoversion (idFile INTEGER PRIMARY KEY, idMedia INTEGER, media_type TEXT, itemType INTEGER, idType INTEGER);
 CREATE INDEX ix_bookmark ON bookmark (idFile, type);
 CREATE UNIQUE INDEX ix_settings ON settings ( idFile )
 ;
@@ -67,6 +69,8 @@
 CREATE UNIQUE INDEX ix_actor_link_1 ON actor_link (actor_id, media_type, media_id, role);
 CREATE INDEX ix_actor_link_2 ON actor_link (media_id, media_type, actor_id);
 CREATE INDEX ix_actor_link_3 ON actor_link (media_type);
+CREATE INDEX ix_videoversion ON videoversion (idMedia, media_type);
+CREATE INDEX ix_movie_title ON movie (c00);
 CREATE UNIQUE INDEX ix_tag_1 ON tag (name);
 CREATE UNIQUE INDEX ix_tag_link_1 ON tag_link (tag_id, media_type, media_id);
 CREATE UNIQUE INDEX ix_tag_link_2 ON tag_link (media_id, media_type, tag_id);
@@ -89,7 +93,7 @@
 CREATE UNIQUE INDEX ix_country_link_1 ON country_link (country_id, media_type, media_id);
 CREATE UNIQUE INDEX ix_country_link_2 ON country_link (media_id, media_type, country_id);
 CREATE INDEX ix_country_link_3 ON country_link (media_type);
-CREATE TRIGGER delete_movie AFTER DELETE ON movie FOR EACH ROW BEGIN DELETE FROM genre_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM actor_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM director_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM studio_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM country_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM writer_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM movielinktvshow WHERE idMovie=old.idMovie; DELETE FROM art WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM tag_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM rating WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM uniqueid WHERE media_id=old.idMovie AND media_type='movie'; END;
+CREATE TRIGGER delete_movie AFTER DELETE ON movie FOR EACH ROW BEGIN DELETE FROM genre_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM actor_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM director_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM studio_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM country_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM writer_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM movielinktvshow WHERE idMovie=old.idMovie; DELETE FROM art WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM tag_link WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM rating WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM uniqueid WHERE media_id=old.idMovie AND media_type='movie'; DELETE FROM videoversion WHERE idMedia=old.idMovie AND media_type='movie'; END;
 CREATE TRIGGER delete_tvshow AFTER DELETE ON tvshow FOR EACH ROW BEGIN DELETE FROM actor_link WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM director_link WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM studio_link WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM tvshowlinkpath WHERE idShow=old.idShow; DELETE FROM genre_link WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM movielinktvshow WHERE idShow=old.idShow; DELETE FROM seasons WHERE idShow=old.idShow; DELETE FROM art WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM tag_link WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM rating WHERE media_id=old.idShow AND media_type='tvshow'; DELETE FROM uniqueid WHERE media_id=old.idShow AND media_type='tvshow'; END;
 CREATE TRIGGER delete_musicvideo AFTER DELETE ON musicvideo FOR EACH ROW BEGIN DELETE FROM actor_link WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM director_link WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM genre_link WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM studio_link WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM art WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM tag_link WHERE media_id=old.idMVideo AND media_type='musicvideo'; DELETE FROM uniqueid WHERE media_id=old.idMVideo AND media_type='musicvideo'; END;
 CREATE TRIGGER delete_episode AFTER DELETE ON episode FOR EACH ROW BEGIN DELETE FROM actor_link WHERE media_id=old.idEpisode AND media_type='episode'; DELETE FROM director_link WHERE media_id=old.idEpisode AND media_type='episode'; DELETE FROM writer_link WHERE media_id=old.idEpisode AND media_type='episode'; DELETE FROM art WHERE media_id=old.idEpisode AND media_type='episode'; DELETE FROM rating WHERE media_id=old.idEpisode AND media_type='episode'; DELETE FROM uniqueid WHERE media_id=old.idEpisode AND media_type='episode'; END;
@@ -97,18 +101,18 @@
 CREATE TRIGGER delete_set AFTER DELETE ON sets FOR EACH ROW BEGIN DELETE FROM art WHERE media_id=old.idSet AND media_type='set'; END;
 CREATE TRIGGER delete_person AFTER DELETE ON actor FOR EACH ROW BEGIN DELETE FROM art WHERE media_id=old.actor_id AND media_type IN ('actor','artist','writer','director'); END;
 CREATE TRIGGER delete_tag AFTER DELETE ON tag_link FOR EACH ROW BEGIN DELETE FROM tag WHERE tag_id=old.tag_id AND tag_id NOT IN (SELECT DISTINCT tag_id FROM tag_link); END;
-CREATE TRIGGER delete_file AFTER DELETE ON files FOR EACH ROW BEGIN DELETE FROM bookmark WHERE idFile=old.idFile; DELETE FROM settings WHERE idFile=old.idFile; DELETE FROM stacktimes WHERE idFile=old.idFile; DELETE FROM streamdetails WHERE idFile=old.idFile; END;
+CREATE TRIGGER delete_file AFTER DELETE ON files FOR EACH ROW BEGIN DELETE FROM bookmark WHERE idFile=old.idFile; DELETE FROM settings WHERE idFile=old.idFile; DELETE FROM stacktimes WHERE idFile=old.idFile; DELETE FROM streamdetails WHERE idFile=old.idFile; DELETE FROM videoversion WHERE idFile=old.idFile; DELETE FROM art WHERE media_id=old.idFile AND media_type='videoversion'; END;
 CREATE VIEW episode_view AS SELECT   episode.*,  files.strFileName AS strFileName,  path.strPath AS strPath,  files.playCount AS playCount,  files.lastPlayed AS lastPlayed,  files.dateAdded AS dateAdded,  tvshow.c00 AS strTitle,  tvshow.c08 AS genre,  tvshow.c14 AS studio,  tvshow.c05 AS premiered,  tvshow.c13 AS mpaa,  bookmark.timeInSeconds AS resumeTimeInSeconds,   bookmark.totalTimeInSeconds AS totalTimeInSeconds,   bookmark.playerState AS playerState,   rating.rating AS rating,   rating.votes AS votes,   rating.rating_type AS rating_type,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type FROM episode  JOIN files ON    files.idFile=episode.idFile  JOIN tvshow ON    tvshow.idShow=episode.idShow  JOIN seasons ON    seasons.idSeason=episode.idSeason  JOIN path ON    files.idPath=path.idPath  LEFT JOIN bookmark ON    bookmark.idFile=episode.idFile AND bookmark.type=1  LEFT JOIN rating ON    rating.rating_id=episode.c03  LEFT JOIN uniqueid ON    uniqueid.uniqueid_id=episode.c20
 /* episode_view(idEpisode,idFile,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,idShow,userrating,idSeason,strFileName,strPath,playCount,lastPlayed,dateAdded,strTitle,genre,studio,premiered,mpaa,resumeTimeInSeconds,totalTimeInSeconds,playerState,rating,votes,rating_type,uniqueid_value,uniqueid_type) */;
-CREATE VIEW tvshowcounts AS SELECT       tvshow.idShow AS idShow,      MAX(files.lastPlayed) AS lastPlayed,      NULLIF(COUNT(episode.c12), 0) AS totalCount,      COUNT(files.playCount) AS watchedcount,      NULLIF(COUNT(DISTINCT(episode.c12)), 0) AS totalSeasons,       MAX(files.dateAdded) as dateAdded     FROM tvshow      LEFT JOIN episode ON        episode.idShow=tvshow.idShow      LEFT JOIN files ON        files.idFile=episode.idFile GROUP BY tvshow.idShow
-/* tvshowcounts(idShow,lastPlayed,totalCount,watchedcount,totalSeasons,dateAdded) */;
+CREATE VIEW tvshowcounts AS SELECT       tvshow.idShow AS idShow,      MAX(files.lastPlayed) AS lastPlayed,      NULLIF(COUNT(episode.c12), 0) AS totalCount,      COUNT(files.playCount) AS watchedcount,      NULLIF(COUNT(DISTINCT(episode.c12)), 0) AS totalSeasons,       MAX(files.dateAdded) as dateAdded,       COUNT(bookmark.type) AS inProgressCount     FROM tvshow      LEFT JOIN episode ON        episode.idShow=tvshow.idShow      LEFT JOIN files ON        files.idFile=episode.idFile       LEFT JOIN bookmark ON        bookmark.idFile=files.idFile AND bookmark.type=1 GROUP BY tvshow.idShow
+/* tvshowcounts(idShow,lastPlayed,totalCount,watchedcount,totalSeasons,dateAdded,inProgressCount) */;
 CREATE VIEW tvshowlinkpath_minview AS SELECT   idShow,   min(idPath) AS idPath FROM tvshowlinkpath GROUP BY idShow
 /* tvshowlinkpath_minview(idShow,idPath) */;
-CREATE VIEW tvshow_view AS SELECT   tvshow.*,  path.idParentPath AS idParentPath,  path.strPath AS strPath,  tvshowcounts.dateAdded AS dateAdded,  lastPlayed, totalCount, watchedcount, totalSeasons,   rating.rating AS rating,   rating.votes AS votes,   rating.rating_type AS rating_type,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type FROM tvshow  LEFT JOIN tvshowlinkpath_minview ON     tvshowlinkpath_minview.idShow=tvshow.idShow  LEFT JOIN path ON    path.idPath=tvshowlinkpath_minview.idPath  INNER JOIN tvshowcounts ON    tvshow.idShow = tvshowcounts.idShow   LEFT JOIN rating ON    rating.rating_id=tvshow.c04   LEFT JOIN uniqueid ON    uniqueid.uniqueid_id=tvshow.c12
-/* tvshow_view(idShow,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,userrating,duration,idParentPath,strPath,dateAdded,lastPlayed,totalCount,watchedcount,totalSeasons,rating,votes,rating_type,uniqueid_value,uniqueid_type) */;
-CREATE VIEW season_view AS SELECT   seasons.idSeason AS idSeason,  seasons.idShow AS idShow,  seasons.season AS season,  seasons.name AS name,  seasons.userrating AS userrating,  tvshow_view.strPath AS strPath,  tvshow_view.c00 AS showTitle,  tvshow_view.c01 AS plot,  tvshow_view.c05 AS premiered,  tvshow_view.c08 AS genre,  tvshow_view.c14 AS studio,  tvshow_view.c13 AS mpaa,  count(DISTINCT episode.idEpisode) AS episodes,  count(files.playCount) AS playCount,  min(episode.c05) AS aired FROM seasons  JOIN tvshow_view ON    tvshow_view.idShow = seasons.idShow  JOIN episode ON    episode.idShow = seasons.idShow AND episode.c12 = seasons.season  JOIN files ON    files.idFile = episode.idFile GROUP BY seasons.idSeason,         seasons.idShow,         seasons.season,         seasons.name,         seasons.userrating,         tvshow_view.strPath,         tvshow_view.c00,         tvshow_view.c01,         tvshow_view.c05,         tvshow_view.c08,         tvshow_view.c14,         tvshow_view.c13
-/* season_view(idSeason,idShow,season,name,userrating,strPath,showTitle,plot,premiered,genre,studio,mpaa,episodes,playCount,aired) */;
+CREATE VIEW tvshow_view AS SELECT   tvshow.*,  path.idParentPath AS idParentPath,  path.strPath AS strPath,  tvshowcounts.dateAdded AS dateAdded,  lastPlayed, totalCount, watchedcount, totalSeasons,   rating.rating AS rating,   rating.votes AS votes,   rating.rating_type AS rating_type,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type,   tvshowcounts.inProgressCount AS inProgressCount FROM tvshow  LEFT JOIN tvshowlinkpath_minview ON     tvshowlinkpath_minview.idShow=tvshow.idShow  LEFT JOIN path ON    path.idPath=tvshowlinkpath_minview.idPath  INNER JOIN tvshowcounts ON    tvshow.idShow = tvshowcounts.idShow   LEFT JOIN rating ON    rating.rating_id=tvshow.c04   LEFT JOIN uniqueid ON    uniqueid.uniqueid_id=tvshow.c12
+/* tvshow_view(idShow,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,userrating,duration,idParentPath,strPath,dateAdded,lastPlayed,totalCount,watchedcount,totalSeasons,rating,votes,rating_type,uniqueid_value,uniqueid_type,inProgressCount) */;
+CREATE VIEW season_view AS SELECT   seasons.idSeason AS idSeason,  seasons.idShow AS idShow,  seasons.season AS season,  seasons.name AS name,  seasons.userrating AS userrating,  tvshow_view.strPath AS strPath,  tvshow_view.c00 AS showTitle,  tvshow_view.c01 AS plot,  tvshow_view.c05 AS premiered,  tvshow_view.c08 AS genre,  tvshow_view.c14 AS studio,  tvshow_view.c13 AS mpaa,  count(DISTINCT episode.idEpisode) AS episodes,  count(files.playCount) AS playCount,  min(episode.c05) AS aired,   count(bookmark.type) AS inProgressCount FROM seasons  JOIN tvshow_view ON    tvshow_view.idShow = seasons.idShow  JOIN episode ON    episode.idShow = seasons.idShow AND episode.c12 = seasons.season  JOIN files ON    files.idFile = episode.idFile   LEFT JOIN bookmark ON    bookmark.idFile = files.idFile AND bookmark.type = 1 GROUP BY seasons.idSeason,         seasons.idShow,         seasons.season,         seasons.name,         seasons.userrating,         tvshow_view.strPath,         tvshow_view.c00,         tvshow_view.c01,         tvshow_view.c05,         tvshow_view.c08,         tvshow_view.c14,         tvshow_view.c13
+/* season_view(idSeason,idShow,season,name,userrating,strPath,showTitle,plot,premiered,genre,studio,mpaa,episodes,playCount,aired,inProgressCount) */;
 CREATE VIEW musicvideo_view AS SELECT  musicvideo.*,  files.strFileName as strFileName,  path.strPath as strPath,  files.playCount as playCount,  files.lastPlayed as lastPlayed,  files.dateAdded as dateAdded,   bookmark.timeInSeconds AS resumeTimeInSeconds,   bookmark.totalTimeInSeconds AS totalTimeInSeconds,   bookmark.playerState AS playerState,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type FROM musicvideo  JOIN files ON    files.idFile=musicvideo.idFile  JOIN path ON    path.idPath=files.idPath  LEFT JOIN bookmark ON    bookmark.idFile=musicvideo.idFile AND bookmark.type=1  LEFT JOIN uniqueid ON    uniqueid.uniqueid_id=musicvideo.c15
 /* musicvideo_view(idMVideo,idFile,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,userrating,premiered,strFileName,strPath,playCount,lastPlayed,dateAdded,resumeTimeInSeconds,totalTimeInSeconds,playerState,uniqueid_value,uniqueid_type) */;
-CREATE VIEW movie_view AS SELECT  movie.*,  sets.strSet AS strSet,  sets.strOverview AS strSetOverview,  files.strFileName AS strFileName,  path.strPath AS strPath,  files.playCount AS playCount,  files.lastPlayed AS lastPlayed,   files.dateAdded AS dateAdded,   bookmark.timeInSeconds AS resumeTimeInSeconds,   bookmark.totalTimeInSeconds AS totalTimeInSeconds,   bookmark.playerState AS playerState,   rating.rating AS rating,   rating.votes AS votes,   rating.rating_type AS rating_type,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type FROM movie  LEFT JOIN sets ON    sets.idSet = movie.idSet  JOIN files ON    files.idFile=movie.idFile  JOIN path ON    path.idPath=files.idPath  LEFT JOIN bookmark ON    bookmark.idFile=movie.idFile AND bookmark.type=1  LEFT JOIN rating ON    rating.rating_id=movie.c05  LEFT JOIN uniqueid ON    uniqueid.uniqueid_id=movie.c09
-/* movie_view(idMovie,idFile,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,idSet,userrating,premiered,strSet,strSetOverview,strFileName,strPath,playCount,lastPlayed,dateAdded,resumeTimeInSeconds,totalTimeInSeconds,playerState,rating,votes,rating_type,uniqueid_value,uniqueid_type) */;
+CREATE VIEW movie_view AS SELECT  movie.*,  sets.strSet AS strSet,  sets.strOverview AS strSetOverview,  files.strFileName AS strFileName,  path.strPath AS strPath,  files.playCount AS playCount,  files.lastPlayed AS lastPlayed,   files.dateAdded AS dateAdded,   bookmark.timeInSeconds AS resumeTimeInSeconds,   bookmark.totalTimeInSeconds AS totalTimeInSeconds,   bookmark.playerState AS playerState,   rating.rating AS rating,   rating.votes AS votes,   rating.rating_type AS rating_type,   uniqueid.value AS uniqueid_value,   uniqueid.type AS uniqueid_type,   EXISTS(     SELECT 1     FROM  videoversion vv     WHERE vv.idMedia = movie.idMovie     AND   vv.media_type = 'movie'     AND   vv.itemType = 0     AND   vv.idFile <> movie.idFile   ) AS hasVideoVersions,   EXISTS(     SELECT 1     FROM  videoversion vv     WHERE vv.idMedia = movie.idMovie     AND   vv.media_type = 'movie'     AND   vv.itemType = 1   ) AS hasVideoExtras,   CASE     WHEN vv.idFile = movie.idFile AND vv.itemType = 0 THEN 1     ELSE 0   END AS isDefaultVersion,   vv.idFile AS videoVersionIdFile,   vvt.id AS videoVersionTypeId,  vvt.name AS videoVersionTypeName,  vvt.itemType AS videoVersionTypeItemType FROM movie  LEFT JOIN sets ON    sets.idSet = movie.idSet  LEFT JOIN rating ON    rating.rating_id = movie.c05  LEFT JOIN uniqueid ON    uniqueid.uniqueid_id = movie.c09  LEFT JOIN videoversion vv ON    vv.idMedia = movie.idMovie AND vv.media_type = 'movie' AND vv.itemType = 0  JOIN videoversiontype vvt ON    vvt.id = vv.idType AND vvt.itemType = vv.itemType  JOIN files ON    files.idFile = vv.idFile  JOIN path ON    path.idPath = files.idPath  LEFT JOIN bookmark ON    bookmark.idFile = vv.idFile AND bookmark.type = 1
+/* movie_view(idMovie,idFile,c00,c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,idSet,userrating,premiered,strSet,strSetOverview,strFileName,strPath,playCount,lastPlayed,dateAdded,resumeTimeInSeconds,totalTimeInSeconds,playerState,rating,votes,rating_type,uniqueid_value,uniqueid_type,hasVideoVersions,hasVideoExtras,isDefaultVersion,videoVersionIdFile,videoVersionTypeId,videoVersionTypeName,videoVersionTypeItemType) */;

@oddstr13
Copy link
Member

oddstr13 commented Feb 3, 2024

"Hate" is such a strong word...

There have been some DB changes involving the "movie versions" feature. I think it's plausible that this broke something on your side.

Well, I can't speak for other parties involved, but both me and @mcarlton00 … strongly dislike the fact that we're touching the DB. My dream scenario would be presenting Kodi with a virtual filesystem that it could scan, along with metadata. Not sure of how feasible that is with the current available facilities, or how much need to be changed in Kodi for something like that, however.

Anyways, I've been expecting that particular feature PR to break things for us for a couple of years now, it was only a matter of time.

@pdf Thanks for the diff, I'm sure it'll at least provide some pointers!

@AmonFlorian
Copy link
Contributor

Basically what I see is:
Kodi has now an option menu that lets you choose different versions of a file if they are found on scanning. The table "videoversiontype" is prefilled with 37 possible "versiontypes" as default - and can be filled with extra versions from id 40437 upwards.
If Kodi gets a "hasVideoVersions" (if movieid is listed in videoversion-table) and user has enabled the option to choose what version to play (can be disabled to play a default version) then he gets a popup to choose from available versions of that type.
See: https://kodi.wiki/view/Video_versions

@oddstr13 @mcarlton00 Doesn't Jellyfin already have similar "extracting" algorithms for emby-schemes? I ran up and down the last days but could only come up with the "VideoExtras" (e.g. behindthescenes, trailers, etc.).

Overall I think it's quite a neat Kodi feature - though I can't understand why the OpenSource-community can't go hand-in-hand but over on xbmc they go like "ye - they fiddle with our DB so it's their problem". Everybody could benefit from another way to get external sources into their views... :(

Would love to see that feature available on Jellyfin, too though.
All the best - and if I can be of any help in any way. Feel free to give me a shout.

@mcarlton00
Copy link
Member

You're correct, Jellyfin already has version support for movies, and has had it since it started. Docs. And the addon has code to automatically handle that, so when you select something with multiple versions you should get prompted what version you want to play. However Kodi has now added a way to do that with just kodi, natively, and as a result the database schema has changed. Fortunately, this has the potential to simplify the playback code where we aren't going to have to check for versions when something is selected. Unfortunately, fixing this going forward also is going to mean breaking backwards compatibility with older kodi versions unless we do so carefully and have multiple different sql queries that get used in different versions. Such is life when we're piggybacking off another fully independent piece of software.

over on xbmc they go like "ye - they fiddle with our DB so it's their problem"

Yes, this was what I meant when I said we're not going to get a ton of help from upstream. The fact of the matter that this addon (along with plexkodiconnect and emby for kodi) function in a way team kodi explicitly says "you should not do this". Addons are not meant to interact with the database directly, and this situation highlights why. The recommended route is how jellycon, embycon, and other "dynamic" streaming plugins work, where they retrieve and display data from remote sources at the same time. Obviously those are a bit slower due to the extra processing time, but this is the tradeoff.

My dream scenario would be presenting Kodi with a virtual filesystem that it could scan, along with metadata.

@oddstr13 I've actually played with this a bit. It would be fairly trivial to just set up a directory with nfo files and strm files, however I believe this could turn into a significant impact on disk space for large libraries, especially if we include images (poster/fanart/backdrops/etc). The other part is that this still involves us making edits to $KODI_HOME/userdata/sources.xml manually, as last I checked there was no api endpoint to do so.

@Orhideous
Copy link

Orhideous commented Feb 18, 2024

I believe this could turn into a significant impact on disk space for large libraries,

How significant this impact could be? I'm sure that aforementioned size can't be bigger than the size of the Jellyfin data directory (well, 10-15GB? 30?), and as for the large number of files... well, running the Kodi+Jellyfin addon on a half-dead SD card under RPi is definitely nonsense.

@pdf
Copy link
Contributor

pdf commented Feb 18, 2024

Would such an exported filesystem allow playback status sync though? I suspect not, right? That's the only reason I use the add-on right now since all my Kodi usage is local/direct via NFS. If there was an add-on option to only sync playback status instead of messing with the library DB for Direct mode, I would 100% use that.

@mcarlton00
Copy link
Member

@Orhideous A bit off topic for this issue directly, but since you asked:

From some quick searching through my library, I'm seeing 1-4Kb per nfo file. Strm file themselves are largely negligible (64 bytes on my testing file). Rough math and estimating out from there, ~200Mb for a library with 50,000 files in it? This is actually pretty straightforward and not at all unreasonable. It starts getting a lot more problematic if we include posters and other images there, which could be 100s of Kb each, and we start to imagine that size could begin to be a problem on low end devices. I don't remember for sure, but I believe Kodi would also then copy that image to it's internal directories. It's been quite a while since I used vanilla Kodi and looked into how it behaved. I know that we have some users running on things like Pis or Fire TVs where this storage capacity requirements could potentially become a problem. There's also some potential for performance issues based on number of files, but I don't know where these limits are in the real world and I'd need to do significantly more testing before this becomes anything more than a footnote in my wandering, mostly incoherent thoughts of how to improve things. Transcoding support is also a small concern, but I believe last time I spent any time in this rabbit hole I confirmed that Kodi will read plugin://plugin.video.jellyfin/ URLs ok so we could still have our own playback processing and still support anything we need to. This could all be a non-issue though, as I know we can embed URLs to posters in nfo files. Which naturally introduces another issue, because that requires either embedding an api key in the URL inside the nfo file (gross), or making the urls again use plugin://plugin.video.jellyfin/ URLs to route them through the plugin, which will naturally take longer to process than going to an image URL directly. And there's always the chance that the parser will get very unhappy about this.

Since I'm already on my soapbox of ridiculousness, a potentially cleaner solution would be to have our own sqlite database alongside Kodi's, along with a compatibility layer that would allow Kodi to see it as if a "normal" filesystem. There's multiple major hurdles and questions with this approach, though. The first is just the technical challenge to make a "virtual" filesystem that Kodi's parser is capable of reading. I suspect this would be challenging on it's own, without the added complications that it has to work on multiple different OSes (linux, windows, android, iOS, and now webOS). Assuming that's even possible, then we start getting into fun performance questions. Can we query a database, real time generate the xml needed for a nfo file, and hand it back to Kodi's parser in a fast enough way that this even makes sense to do? Of course, going this route means that we still have to deal with the whole database sync thing, which has it's own headaches. And if we can do this, then we can make the virtual filesystem hooks just pull directly from the Jellyfin server on demand instead of this sync nonsense, and at that point we've just re-implemented JellyCon with extra steps.

Thank you for coming to my TED Talk, I spend far too much of my time theory crafting stupid solutions to stupid problems. And all of these ideas are absolutely massive, fundamental reworks of how the addon functions, and I really haven't had a ton of time to devote to this particular brand of madness as of late.

Would such an exported filesystem allow playback status sync though?

@pdf One part of this is absolutely trivial and wouldn't change much at all from it's current implementation, one part is an interesting thought that would require some more research into what Kodi's official APIs offer. We don't read playback status from the database at all currently, we hook into the playback events to detect when things start and stop and what their position is. Updating playback status in the database from the jellyfin server is the part I'm unsure about currently, but it's obviously possible as it's effectively the entire basis of things like Trakt.

@mcarlton00
Copy link
Member

mcarlton00 commented Feb 23, 2024

Reviewing the diff that @pdf provided and doing some preliminary digging, I'm pretty sure what needs to change is

add_movie = """
INSERT INTO movie(idMovie, idFile, c00, c01, c02, c03, c04, c05, c06, c07,
c09, c10, c11, c12, c14, c15, c16, c18, c19, c21, premiered)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
"""
add_movie_obj = ["{MovieId}", "{FileId}", "{Title}", "{Plot}", "{ShortPlot}", "{Tagline}",
"{Votes}", "{RatingId}", "{Writers}", "{Year}", "{Unique}", "{SortTitle}",
"{Runtime}", "{Mpaa}", "{Genre}", "{Directors}", "{Title}", "{Studio}",
"{Trailer}", "{Country}", "{Premiere}"]

along with
self.add(*values(obj, QU.add_movie_obj))

and
self.cursor.execute(QU.add_movie, args)

The simplest way is simply going to be adding the extra fields to that query, possibly nulled? Not sure what's required yet to make it work because I don't have a functioning beta3 install. I still can't get kodi to build manually, and the flatpak version apparently hasn't been updated? Or I'm dumb and forgot the right commands. Either way, that should make everything work as it does now. If we want to utilize the new movie versions feature instead of the one built into jellyfin, it will obviously take more effort to sort through and put each version into the db separately instead of handling it at playback time.

However as mentioned, we need to have multiple queries so we can maintain backwards compatibility for those users who can't update to 21 right away, or are currently on stable. We've done this at least once before in 0aa2e71 and can use that as a template.

@mcarlton00 mcarlton00 pinned this issue Feb 23, 2024
@AmonFlorian
Copy link
Contributor

Reviewing the diff that @pdf provided and doing some preliminary digging, I'm pretty sure what needs to change is

add_movie = """
INSERT INTO movie(idMovie, idFile, c00, c01, c02, c03, c04, c05, c06, c07,
c09, c10, c11, c12, c14, c15, c16, c18, c19, c21, premiered)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
"""
add_movie_obj = ["{MovieId}", "{FileId}", "{Title}", "{Plot}", "{ShortPlot}", "{Tagline}",
"{Votes}", "{RatingId}", "{Writers}", "{Year}", "{Unique}", "{SortTitle}",
"{Runtime}", "{Mpaa}", "{Genre}", "{Directors}", "{Title}", "{Studio}",
"{Trailer}", "{Country}", "{Premiere}"]

along with

self.add(*values(obj, QU.add_movie_obj))

and

self.cursor.execute(QU.add_movie, args)

The simplest way is simply going to be adding the extra fields to that query, possibly nulled? Not sure what's required yet to make it work because I don't have a functioning beta3 install. I still can't get kodi to build manually, and the flatpak version apparently hasn't been updated? Or I'm dumb and forgot the right commands. Either way, that should make everything work as it does now. If we want to utilize the new movie versions feature instead of the one built into jellyfin, it will obviously take more effort to sort through and put each version into the db separately instead of handling it at playback time.

However as mentioned, we need to have multiple queries so we can maintain backwards compatibility for those users who can't update to 21 right away, or are currently on stable. We've done this at least once before in 0aa2e71 and can use that as a template.

Nope. Structure of movie table is the same:
https://github.com/xbmc/xbmc/blob/master/xbmc/video/VideoDatabase.cpp

Difference is that you need (forcefully) the same movie in the videoversion-table so movieview works as intended. At least I think so.
Will try some tinkering as I have Kodi 21 up and running. As "videoversion" table doesn't exist on Kodi <21b3 you could possibly go an "exists" route and write as needed or just cancel that.

@AmonFlorian
Copy link
Contributor

AmonFlorian commented Feb 26, 2024

Ok. At least I get a videolist on 21b3 now - adding "Standard version" for all movies added.
Widget for "recently added" etc. not working as of now.
Missing a "del videoversion" when removing a file.
Will post a commit on my fork later and will try on Kodi 20.

Edit: nvm ... Widgets work as intended after a restart of Kodi 21b3.

@AmonFlorian
Copy link
Contributor

@mcarlton00
Mind to give it a quick look?
Works for me on Kodi 20.4 as well as Kodi 21 beta3.

master...AmonFlorian:jellyfin-kodi:master

@mcarlton00
Copy link
Member

From a quick glance it seems fine, but I don't have time to test it for myself today. Feel free to open a PR with the changes, more likely to get more eyes on it that way.

@chriswalken
Copy link

chriswalken commented Mar 2, 2024

@AmonFlorian thanks a lot for these changes. I tried them out and they are not working for me on an NVidia Shield 2017. I will try to dig in more in a few days but I wanted to give a heads up that I think more people need to test this before it goes in. I did the steps below multiple times, and I will also try this on a Linux desktop when I get back to this.

  1. Downloaded master
  2. Hand merged the changes (I did remove the whitespace errors but this shouldn't matter)
  3. Built
  4. Installed over top of the existing addon
  5. Reset the movie db from the jellyfin addon settings
  6. Restarted kodi - sometimes but not always making sure the db files was removed before restarting
  7. Synced the movie db

I still end up with no movies in the UI. I confirmed by looking at the MyVideos131.db file that the new videoversion table exists and has the same number of entries as the movie table. The logs show Kodi making the movie db query and getting back 0 items.

Thanks again and I can test any potential fix for this.

@presterjohn13
Copy link

@AmonFlorian thanks a lot for these changes. I tried them out and they are not working for me on an NVidia Shield 2017. I will try to dig in more in a few days but I wanted to give a heads up that I think more people need to test this before it goes in. I did the steps below multiple times, and I will also try this in a Linux desktop when I get back to this.

  1. Cloned master
  2. Hand merged the changes (I did remove the whitespace errors but this shouldn't matter)
  3. Built
  4. Installed
  5. Reset the movie db from the jellyfin addon settings
  6. Restarted kodi - sometimes but not always making sure the db files was removed before restarting
  7. Synced the movie db

I still end up with no movies in the UI. I confirmed by looking at the MyVideos131.db file that the new videoversion table exists. The logs show Kodi making the movie db query and getting back 9 items.

Thanks again and I can test any potential fix for this.

I also tried this, on Nvidia Shield Pro 2019, with the same results.

I'm also happy to test anything. Unfortunately, I'm struggling to wrap my head around how this addon works, so testing will be my limits, I wish I could do more!

@AmonFlorian
Copy link
Contributor

@chriswalken
I didn't need to remove or tinker with the kodi-db manually. I just went with "repair database" from the addon. After changes were made I made sure to close Kodi once and after starting it up again, all movies were in as normal.
I wonder what the Shield may do different.
Did you shutdown Kodi once after step 7?
Can you check the videoversion table and see if there are as many entries as there are in the movie-table?

@presterjohn13
Copy link

@chriswalken I didn't need to remove or tinker with the kodi-db manually. I just went with "repair database" from the addon. After changes were made I made sure to close Kodi once and after starting it up again, all movies were in as normal. I wonder what the Shield may do different. Did you shutdown Kodi once after step 7? Can you check the videoversion table and see if there are as many entries as there are in the movie-table?

I wonder if I have somehow messed up moving your build from GitHub to my Kodi install.
Are you able to upload a .zip and I'll try that?

@AmonFlorian
Copy link
Contributor

You simply need to replace the three .py-files listed in the commit on your kodi install. No need to compile or anything.

@chriswalken
Copy link

chriswalken commented Mar 3, 2024

@chriswalken I didn't need to remove or tinker with the kodi-db manually. I just went with "repair database" from the addon. After changes were made I made sure to close Kodi once and after starting it up again, all movies were in as normal. I wonder what the Shield may do different. Did you shutdown Kodi once after step 7? Can you check the videoversion table and see if there are as many entries as there are in the movie-table?

Yes I verified the videoversion table has the same number of entries as the movie table. Both tables look to be filled correctly (I see movie titles in the movie table, and the videoversion table has increasing IDs). Also in all cases I exited Kodi after updating the addon and resetting the DB within it. Sometimes I also killed the process after exiting (this is a nuace of the shield where processes can stay running in the background and you double tap one of the buttons and get a 'task switcher' view).

I didn't say this in my comment but the first way I tried this was just replacing the three files after hand merging the changes. When that didn't work I deleted the pyc cache and tried again, even though I did see the relevant pyc files had been updated. I only commented here after doing the full addon install.

Technically I still haven't ruled out my hand merging being the issue, so next I'll just replace with the updated raw files. The diff is tiny so I think it's unlikely I messed this up, but I do think I should rule it out completely.

Thanks again. I think I'll be able to run more tests tonight or tomorrow.

@axionman
Copy link

axionman commented Mar 3, 2024

Hi, I just replaced the 3 files as told above and I confirm it now works on KODI 21 beta3.
Thanks a lot !

@mcarlton00
Copy link
Member

Thanks. Yeah, I was doing that but it was still intermittently not populating the home screen without a restart. After my last update I eventually figured out if I also threw in a ReloadSkin() afterwards then it would work consistently. Working on a few other small quirks now.

@jbinkley60
Copy link

Yeah, you can see that I commented out ReloadSkin() in my code. It could be skin dependent.

@it5c0z1mG
Copy link

Kodi xbox retail version omega
Jellyfin for kodi addon with native paths

Since omega update, when kodi updates library from jellyfin, movies folders get scanned but after import kodi shows movies as empty.
Tv seasons are still working fine

Working nexus setup logs:
kodi.log
kodi.old.log

Broken omega logs:
kodi.log
kodi.old.log

@presterjohn13
Copy link

Version 1.0 still produces the same issue for me. Tried "repair" , with no success.
Omega RC1 on Shield 2019 Pro.

Would any specific log outputs be useful?

@quixotic120
Copy link

quixotic120 commented Mar 28, 2024

still not working for me as discussed in #834 but to bring discussion here where it is more relevant (sorry about that)

readded movie library tonight. log again shows scan was successful but library is empty similar to 0.7.4.

videoversion table appears to be populated:

Screenshot 2024-03-27 at 8 18 53 PM

but videoversiontype is not fwiw

running INSERT INTO videoversiontype ( itemType, owner, name, id ) VALUES ( 0, 0, 'Standard Edition', 40400 ); on db from earlier in the thread made movies appear

to clarify: version 1.0.0+py3 of the plugin, Kodi 21.0-RC2 on coreelec

@mcarlton00 mcarlton00 reopened this Mar 28, 2024
@mcarlton00
Copy link
Member

I suspect those of you who have run into the videoversiontype issue are coming from other nightly/beta versions of Kodi and not the standard release channel. Because that table comes directly from upstream Kodi and should be populated before we ever touch the database, which I've just verified on a brand new flatpak install of Kodi 21 RC2. So the only way I can think of it not having content is if you stepped through a version with a broken database of some kind. We can potentially add another step to the migration to ensure that the standard edition exists there, but I want to reiterate that we really shouldn't have to do that.

@AmonFlorian
Copy link
Contributor

I definitely agree with @mcarlton00 here.
As discussed earlier the way jellyfin-kodi actually handles db-manipulation due to missing interfacing methods on Kodi's side is prone to malfunctioning as we can't exactly cover every possible version-mismatch or configuration or base (whatever one may call it). Of course one could try as mentioned by mcarlton, but that's far from a "clean" solution.

@presterjohn13
Copy link

@mcarlton00 @AmonFlorian
I have installed the "official" RC from Play Store and everything works perfectly now.

Thank you very much for making this fix, I really appreciate that time you all spend on it

@mcarlton00
Copy link
Member

For those of you who can easily reach the filesystem, I think the easiest solution is just going to be to simply (preferably stop Kodi first), delete MyVideos131.db, restart Kodi, and then either "reset addon settings" or repair your libraries from within the addon. This should ensure you start from a known good state again instead of whatever gremlin has gotten into your databases. I just tested this on my libreelec nightly install and it recreated everything as it should be. Obviously you should take backups before doing this, as I'm not sure what other potential weirdness can happen.

For those of you who can't easily access the filesystem, I don't have a particularly great solution. The only one that comes to mind is nuking the entire Kodi config and start from scratch. It's probably not fun, depending on what other customizations you've made to your install, but it might be the easiest route.

This is sometimes the price to be paid when being a guinea pig and running pre-release software. I'd be curious if anybody can narrow down which pre-release is the one that introduced the problem. I've tested beta2 and RC2 and had no issue on either of them, so I suspect it's either beta1 or a previous master/nightly build of some kind.

@reyqn
Copy link

reyqn commented Mar 28, 2024

For those of you who can easily reach the filesystem, I think the easiest solution is just going to be to simply (preferably stop Kodi first), delete MyVideos131.db, restart Kodi, and then either "reset addon settings" or repair your libraries from within the addon. This should ensure you start from a known good state again instead of whatever gremlin has gotten into your databases. I just tested this on my libreelec nightly install and it recreated everything as it should be. Obviously you should take backups before doing this, as I'm not sure what other potential weirdness can happen.

So I just did this. I deleted MyVideos131.db*, tried to repair, got stuck on the first movie, started kodi back, performed a local database reset, still no movies. For what it's worth, I'm running Kodi on webos since a few months after the first nightlies were available (no betas were available at the time)

Edit: I just checked, videoversion is populated, but videoversiontype isn't.

@oddstr13
Copy link
Member

@reyqn Please at least provide logs and version information when reporting on a new platform "not working", in this case, ideally also information on the databases, their tables and sample contents.

@reyqn
Copy link

reyqn commented Mar 28, 2024

@reyqn Please at least provide logs and version information when reporting on a new platform "not working", in this case, ideally also information on the databases, their tables and sample contents.

I'm not sure what you mean by version, but I'm using 1.0 of this add-on and Kodi RC2. It was said that logs wouldn't show anything so I didn't bother, but which one would you want? I also edited my last message to provide insight into my database tables.

@mcarlton00
Copy link
Member

I just checked, videoversion is populated, but videoversiontype isn't.

You have a broken Kodi database. videoversiontype should be populated before our addon is ever even installed. This isn't something we can fix in the addon without a high possibility of gremlins down the road.

@reyqn
Copy link

reyqn commented Mar 28, 2024

Yeah I'll just populate it manually, I get that the issue I'm having has nothing to do with this addon anymore. Thanks!

@MagicMan3311
Copy link

just got it to work. you have to delete every MyVideos??.db -File because if there is a lower version of this file, kodi generates the 131-version out of the old and it gets corrupted. additionally i uninstalled the jellyfin-addon prior to complete shutdown of the app and deletion of the db-files. then i reinstalled the addon and reconnected to my server. everything went fine and movies are there.

@reyqn
Copy link

reyqn commented Mar 28, 2024

just got it to work. you have to delete every MyVideos??.db -File because if there is a lower version of this file, kodi generates the 131-version out of the old and it gets corrupted. additionally i uninstalled the jellyfin-addon prior to complete shutdown of the app and deletion of the db-files. then i reinstalled the addon and reconnected to my server. everything went fine and movies are there.

This didn't work either for me, so I used this to edit the table, in case it helps someone:

INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40400, 'Standard Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40401, 'Extended Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40402, 'Unrated Version', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40403, 'Uncut Version', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40404, 'Remastered Version', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40406, 'Theatrical Cut', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40407, 'Director''s Cut', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40408, 'Special Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40409, 'Limited Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40410, 'Complete Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40411, 'The Final Cut', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40412, 'Super Duper Cut', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40413, 'Collector''s Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40414, 'Ultimate Collector''s Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40415, 'Criterion Collection Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40416, 'Fan Edit', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40417, 'Black and White Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40431, '10th Anniversary Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40432, '20th Anniversary Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40433, '25th Anniversary Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40434, '30th Anniversary Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40435, '40th Anniversary Edition', 0, 0);
INSERT INTO videoversiontype (id, name, owner, itemType) VALUES(40436, '50th Anniversary Edition', 0, 0);

The values come from https://github.com/xbmc/xbmc/blob/master/addons/resource.language.en_gb/resources/strings.po

@quixotic120
Copy link

deleting MyVideos***.db along with associated copies and repairing the db through the plugin worked for me. did not need to uninstall the plugin. working beautifully now, thanks!

@InsultRuins
Copy link

One reason this may still be broken for some users is that the “Perform local database reset” feature actually breaks the database (wipes all entries from videoversiontype).

So after you delete your MyVideos database(s), you have to use the repair feature, not reset.

@mcarlton00
Copy link
Member

Looks like you are correct. I've never looked into the guts of the reset function, but it loops through all tables in the database and deletes their contents, with an exclusion of the version table. We'll need to add another exclusion for videoversiontype since it's a new table now. I can make a new PR to address that tomorrow.

with Database() as videodb:
videodb.cursor.execute("SELECT tbl_name FROM sqlite_master WHERE type='table'")
for table in videodb.cursor.fetchall():
name = table[0]
if name != 'version':
videodb.cursor.execute("DELETE FROM " + name)

@oddstr13
Copy link
Member

I assume this issue is resolved with v1.0.1?

@VoodooZ
Copy link

VoodooZ commented Mar 31, 2024 via email

@rp86
Copy link

rp86 commented Apr 1, 2024

Thanks for your work on this plugin!

Steps that worked for me to resolve this on Fedora 39, Kodi 21 RC2 and Jellyfin-Kodi 1.0.1-py3:

  • Backup Kodi DB
  • Delete MyVideos***.db
  • Perform local database reset in addon (keeping addon settings)
  • Re-add my Jellyfin libraries when auto-prompted by the addon after Kodi restarted

@VoodooZ
Copy link

VoodooZ commented Apr 1, 2024 via email

@oddstr13 oddstr13 closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.