Giter VIP home page Giter VIP logo

Comments (74)

presterjohn13 avatar presterjohn13 commented on June 13, 2024 4

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?

from jellyfin-kodi.

rp86 avatar rp86 commented on June 13, 2024 3

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

from jellyfin-kodi.

sarbes avatar sarbes commented on June 13, 2024 2

"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.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024 1

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

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024 1

@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

from jellyfin-kodi.

pdf avatar pdf commented on June 13, 2024 1

hi guys. I got a TV version of 21.3, how to fix this issue for now as I could not edit any soucecode files?

Wait for this to be fixed completely, and for the add-on to be updated to support Kodi 21. Otherwise, downgrade to a stable version of Kodi (20.x).

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024 1

hi guys. I got a TV version of 21.3, how to fix this issue for now as I could not edit any soucecode files?

Wait for this to be fixed completely, and for the add-on to be updated to support Kodi 21. Otherwise, downgrade to a stable version of Kodi (20.x).

You may be able to use a file manager like X-plore to replace the files. It's one of the ways I did it on the Android TV based shield.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024 1

Just an update for those not following the PR as well, I've confirmed that @AmonFlorian's change fixes the issue on a fresh sync on Kodi21 beta3 using a libreelec nightly built on a Pi. The downside, as several of you have found, is that it doesn't retroactively fix old entries, it only fixes new entries, requiring manual user action to fix the movie library. I'm working on an automated migration so this won't need to happen once the real release goes out. I have it mostly working with the caveat that it sometimes requires restarting Kodi to populate the home screen again, but others it seems to work fine. I haven't identified what the issue is here yet, and ultimately it's a fairly minor annoyance, but I'd like to get that sorted before pushing it up for further testing. Progress, but slow going. Thanks for your patience.

from jellyfin-kodi.

InsultRuins avatar InsultRuins commented on June 13, 2024 1

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.

from jellyfin-kodi.

oddstr13 avatar oddstr13 commented on June 13, 2024 1

I assume this issue is resolved with v1.0.1?

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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

from jellyfin-kodi.

dbarkar avatar dbarkar commented on June 13, 2024

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

from jellyfin-kodi.

LeVraiRoiDHyrule avatar LeVraiRoiDHyrule commented on June 13, 2024

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.

from jellyfin-kodi.

pdf avatar pdf commented on June 13, 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) */;

from jellyfin-kodi.

oddstr13 avatar oddstr13 commented on June 13, 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!

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

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.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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.

from jellyfin-kodi.

Orhideous avatar Orhideous commented on June 13, 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.

from jellyfin-kodi.

pdf avatar pdf commented on June 13, 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.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 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.

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 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.

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.

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 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.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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.

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 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.

from jellyfin-kodi.

presterjohn13 avatar presterjohn13 commented on June 13, 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 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!

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 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?

from jellyfin-kodi.

presterjohn13 avatar presterjohn13 commented on June 13, 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?

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?

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

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

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 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.

from jellyfin-kodi.

axionman avatar axionman commented on June 13, 2024

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

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

@axionman if you don't mind me asking what platform are you on (windows, Android, etc)?

from jellyfin-kodi.

axionman avatar axionman commented on June 13, 2024

@axionman if you don't mind me asking what platform are you on (windows, Android, etc)?

Sorry, I run Kodi on a Nvidia Shield pro 2019, android TV

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

@axionman if you don't mind me asking what platform are you on (windows, Android, etc)?

Sorry, I run Kodi on a Nvidia Shield pro 2019, android TV

Thanks and very interesting. Maybe it is something I'm doing. I'll remove the jellyfin addon and start from scratch as a next step.

from jellyfin-kodi.

axionman avatar axionman commented on June 13, 2024

@axionman if you don't mind me asking what platform are you on (windows, Android, etc)?

Sorry, I run Kodi on a Nvidia Shield pro 2019, android TV

Thanks and very interesting. Maybe it is something I'm doing. I'll remove the jellyfin addon and start from scratch as a next step.

You're welcome.
How I proceeded:

I downloaded the 3 files
Moved them in their respective folders.
Cleaned the libraray with Kodi option.
Opened the jellifin for Kodi extension, and updated the library.
Once the update was finished, the movies came back :)

from jellyfin-kodi.

presterjohn13 avatar presterjohn13 commented on June 13, 2024

@axionman if you don't mind me asking what platform are you on (windows, Android, etc)?

Sorry, I run Kodi on a Nvidia Shield pro 2019, android TV

Thanks and very interesting. Maybe it is something I'm doing. I'll remove the jellyfin addon and start from scratch as a next step.

You're welcome. How I proceeded:

I downloaded the 3 files Moved them in their respective folders. Cleaned the libraray with Kodi option. Opened the jellifin for Kodi extension, and updated the library. Once the update was finished, the movies came back :)

I tried those exact steps and I'm not having any success.
However, it's a fresh install, I'm unsure if that would make a difference, though.

from jellyfin-kodi.

jbinkley60 avatar jbinkley60 commented on June 13, 2024

Each sharing solution is going to have to devise its own solution for working with the new Kodi Movie version feature, including the ones mentioned above and others. I have a test release for the Mezzmo Kodi addon which supports Kodi 21 beta 3 and the Movie Version feature but only to the point of things still working not taking advantage of the feature. Fortunately for me the only thing which broke was actor / actress information searches because Kodi leverages the Movie View internally so I had to populate the videoversion table to keep Movie View being created.

The first question each Kodi sharing solution developer is going to have to answer is how much of the Movie Version feature to support or just enough to keep the sharing solutions working because most, if not all, already have the same functionality, albeit implemented slightly differently. Like a number of Kodi features, including bookmarks, playcounters and similar, the management of the data being shared may still reside in the sharing solution and not within Kodi, to share across all clients.

In other words, a sharing solution may update the videoversion table to support the proper versions listed in the videroversiontye table but management of this may come from the sharing solution and not from a Kodi instance using the native Kodi management tools. Exceptions here might be sharing solutions which write directly to the Kodi / shared database directly from the native Kodi controls (i.e. MySQL). I can speak for Mezzmo in that there isn't a northbound native Kodi API to push changes from one client to another so I provide Mezzmo controls which allow this from every client via the Mezzmo Kodi addon. Each sharing solution will need to decide how to handle this.

Artwork support for Kodi Movie Versions will also need to be addressed since new entries are needed in the Kodi art table to support the Movie version artwork. This isn't a big deal but something else which needs addressed by each Kodi sharing solution.

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 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.

As soon as there are videoversions listed you should be fine.
Is the ID "40400" listed in your videoversiontype as "Standard Edition"?
Mind to send me your video.db privately?

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

In my opinion a first step for all sharing solutions would be to first just get the movie library displaying, which I think is what @AmonFlorian changes do. My Shield 2017 won't just install beta2 over beta3 which would have been a perfect short term solution for me since I don't want to reinstall Kodi. My main shield is a pro 2019 that got stuck in a weird state where the movies still display but the library is stuck at a point where it was a month or so ago, so not a showstopper there.

@AmonFlorian I don't really want to share the DB, at least not yet, but here's a screenshot showing what I think means it's populated correctly (I'm not at home right now but I did copy off the DB file yesterday).

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

Cropped picture because of the add that was showing:

markup_1000009627

from jellyfin-kodi.

squidrpi avatar squidrpi commented on June 13, 2024

Movies blank for me with the script changes and reset everything. Running on a RPi5 Libreelec nightly-20240302. I have no records in videoversiontype. videoversion count matches movie table.

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

In my opinion a first step for all sharing solutions would be to first just get the movie library displaying, which I think is what @AmonFlorian changes do. My Shield 2017 won't just install beta2 over beta3 which would have been a perfect short term solution for me since I don't want to reinstall Kodi. My main shield is a pro 2019 that got stuck in a weird state where the movies still display but the library is stuck at a point where it was a month or so ago, so not a showstopper there.

@AmonFlorian I don't really want to share the DB, at least not yet, but here's a screenshot showing what I think means it's populated correctly (I'm not at home right now but I did copy off the DB file yesterday).

Could you check the "videoversiontype" as well? Shouldn't be empty!

videoversiontype is pre-populated by kodi.

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

Movies blank for me with the script changes and reset everything. Running on a RPi5 Libreelec nightly-20240302. I have no records in videoversiontype. videoversion count matches movie table.

My videoversiontype is also created but has no rows.

Screenshot_20240303-135950

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

So strange - Kodi should prepopulate.

Try this @chriswalken and give me a shout.

INSERT INTO videoversiontype ( itemType, owner, name, id ) VALUES ( 0, 0, 'Standard Edition', 40400 );

Background: as it's a dirty fix to just have a movieview shown we should just need the one value used in this case.

from jellyfin-kodi.

jbinkley60 avatar jbinkley60 commented on June 13, 2024

Right now I am setting all movies to standard version, 40400, until this gets sorted out and I decide it I want to attempt sharing solution version nomenclatures to Kodi native Movie Version naming. I think I already know this answer but it could change.

from jellyfin-kodi.

squidrpi avatar squidrpi commented on June 13, 2024

INSERT INTO videoversiontype ( itemType, owner, name, id ) VALUES ( 0, 0, 'Standard Edition', 40400 );

Yes movies now show properly after inserting that record.

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

INSERT INTO videoversiontype ( itemType, owner, name, id ) VALUES ( 0, 0, 'Standard Edition', 40400 );

Yes movies now show properly after inserting that record.

@AmonFlorian I can also confirm this fixed the issue for me. Inserting this entry, copying the db back to the Shield, and restarting Kodi now has movies displaying!

Could this mean these changes are missing something in the addon DB reset code, or Kodi's beta2 -> beta3 upgrade scripts are missing something? I actually have a system I can poke around on. My Shield 2019 Pro that is stuck in that weird state where it works but it's on a snapshot of the movie DB ~1 month ago has only had the beta2 -> beta3 upgrade done. I haven't tried these changes on it yet. I actually didn't catch the Pro 2019 library weirdness before upgrading the Shield 2017 which 'fully' broke during its upgrade.

Thanks again for everything. It was quite a shocker when I hit this since it's a kodi-breaking issue. I was about to remove the addon and scan in the network share as a short term fix.

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

@AmonFlorian can you please tell me where you see a 'repair database' option. On both my Shields I'm only seeing a 'Reset local Kodi database' option in the jellyfin addon, which is what I did on my Shield 2017. I don't see anything with 'repair'.

Looking at my Shield 2019 movie database that was beta2 -> beta3 upgraded, has not had these jellyfin addon updates applied, and has since had several jellyfin syncs happen that don't appear in the UI (again movies display but all newer ones are missing).

It looks like:

  1. During the beta2 -> beta3 upgrade:
  • A videoversion table was created and populated with entries for each existing movie
  • A videoversiontype table was created and populated with 387 entries, of which only the 37 are non-blank (see below)
  1. Subsequent jellyfin syncs created movie entries but no videoversion entries (expected since these updates are not there)

I've now updated the jellyfin addon on the newer Shield but I haven't reset the database yet.

- Shield 2019's MyVideos131.db that hasn't been reset yet:

sqlite> select COUNT(*) from movie ;
X

sqlite> select COUNT(*) from videoversion ;
X - Y, where I'm guessing Y = <num movies added to jellyfin since beta2 -> beta3 upgrade>

sqlite> select COUNT(*) from videoversiontype ;
387

sqlite> select * from videoversiontype ;
40400|Standard Edition|0|0
40401|Extended Edition|0|0
40402|Unrated Version|0|0
40403|Uncut Version|0|0
40404|Remastered Version|0|0
40406|Theatrical Cut|0|0
40407|Director's Cut|0|0
40408|Special Edition|0|0
40409|Limited Edition|0|0
40410|Complete Edition|0|0
40411|The Final Cut|0|0
40412|Super Duper Cut|0|0
40413|Collector's Edition|0|0
40414|Ultimate Collector's Edition|0|0
40415|Criterion Collection Edition|0|0
40416|Fan Edit|0|0
40417|Black and White Edition|0|0
40431|10th Anniversary Edition|0|0
40432|20th Anniversary Edition|0|0
40433|25th Anniversary Edition|0|0
40434|30th Anniversary Edition|0|0
40435|40th Anniversary Edition|0|0
40436|50th Anniversary Edition|0|0
40437||0|0
40438||0|0
40439||0|0
<rest of the entries have format '<prev num +1>||0|0'>

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

The repair option I used might be just a translation thing as English is not my mother's tongue. Could be that it's "reset" in English. I will check that as soon as I'm free. The option used is listed under "Manage libraries/databases" (whatever it may be called in EN) though.
What it does: delete everything from selected library, add library to Kodi db again.

The videoversiontype data you've posted is exactly what Kodi should populate (as I've mentioned in an earlier post).

On any videoversion-able Kodi each movie needs at least one entry in the videoversion-table as per movieview-query to be listed. In your case X<Y and X.idMovie exists in Y.idMedia at least once. Or sth line that.

Excuse me for not being of great help rn - a bit in a hurry. As there are other programming tasks I am bound to workwise I might or might not be able to dig deeper into that whole thing.

from jellyfin-kodi.

rraymondgh avatar rraymondgh commented on June 13, 2024

I've tried PR out movies are now working

setup:

 $ gh repo clone jellyfin/jellyfin-kodi
 $ cd jellyfin-kodi/
 $ gh pr checkout 831

 # now on LibreElec box that has NFS mount to cloned GitHub repo
 $ rsync -av nfs/MyBook/jellyfin-kodi/jellyfin_kodi/ .kodi/addons/plugin.video.jellyfin/jellyfin_kodi

repair database

env:

LibreELEC (community): nightly-20240302-74b37e1 (RPi2.arm)
LibreELEC:~ # /usr/lib/kodi/kodi.bin -v
Kodi Media Center 21.0-BETA3 (20.90.830) Git:36c6d1449858c4d5fa3299af82ae3cf2341b3db3
Copyright (C) 2005-2021 Team Kodi - http://kodi.tv

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

Thanks again for the info. I've now found the repair option. It's in the jellyfin addon after you open it, 'Manage Libraries -> Repair libraries'.

Anyone seeing this, you need to repair the library via the option above after merging in these changes, NOT reset the database via the jellyfin addon settings. Resetting the database breaks it as the videoversiontype table is not restored afterwards. Even repairing a 'jellyfin addon reset db' doesn't fix it.

However, deleting a 'broken' MyVideos131.db file from disk and restarting Kodi does restore the videoversiontype table, and you can 'jellyfin repair' after that and it works. So there seems to be an additional update needed in the jellyfin addon DB reset code, but there also are clear steps to end up with a correct, working DB.

Thanks @AmonFlorian for the code and troubleshooting help, and everyone for the testing feedback.

from jellyfin-kodi.

squidrpi avatar squidrpi commented on June 13, 2024

However, deleting a 'broken' MyVideos131.db file from disk and restarting Kodi does restore the videoversiontype table, and you can 'jellyfin repair' after that and it works. So there seems to be an additional update needed in the jellyfin addon DB reset code, but there also are clear steps to end up with a correct, working DB.

Doesn't work for me. I always have to do a manual INSERT of the record to get it to work.

Easy in libreelec, "systemctl stop kodi", "sqlite3 MyVideos131.db", INSERT record, "systemctl start kodi"

from jellyfin-kodi.

chriswalken avatar chriswalken commented on June 13, 2024

However, deleting a 'broken' MyVideos131.db file from disk and restarting Kodi does restore the videoversiontype table, and you can 'jellyfin repair' after that and it works. So there seems to be an additional update needed in the jellyfin addon DB reset code, but there also are clear steps to end up with a correct, working DB.

Doesn't work for me. I always have to do a manual INSERT of the record to get it to work.

Easy in libreelec, "systemctl stop kodi", "sqlite3 MyVideos131.db", INSERT record, "systemctl start kodi"

Good to know, thanks. I only ran those steps once, on a Shield (so Android). It feels like the init of a fresh moviedb would be common code, possibly done early during startup, but in have no idea what Kodi does under the hood.

from jellyfin-kodi.

werran2 avatar werran2 commented on June 13, 2024

hi guys. I got a TV version of 21.3, how to fix this issue for now as I could not edit any soucecode files?

from jellyfin-kodi.

jbinkley60 avatar jbinkley60 commented on June 13, 2024

One way is to force Kodi to recognize there has been a database change and reread it. I do this with the Mezzmo Kodi addon after I populate data in the video database and want native users to se the changes. Here's the code.

If you need any help with getting this all to work with Jellyfin let me know. I've got the Kodi Movie version working with Mezzmo and am happy to help.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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.

from jellyfin-kodi.

jbinkley60 avatar jbinkley60 commented on June 13, 2024

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

from jellyfin-kodi.

it5c0z1mG avatar it5c0z1mG commented on June 13, 2024

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

from jellyfin-kodi.

quixotic120 avatar quixotic120 commented on June 13, 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

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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.

from jellyfin-kodi.

AmonFlorian avatar AmonFlorian commented on June 13, 2024

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.

from jellyfin-kodi.

presterjohn13 avatar presterjohn13 commented on June 13, 2024

@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

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 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.

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.

from jellyfin-kodi.

reyqn avatar reyqn commented on June 13, 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.

from jellyfin-kodi.

oddstr13 avatar oddstr13 commented on June 13, 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.

from jellyfin-kodi.

reyqn avatar reyqn commented on June 13, 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.

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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.

from jellyfin-kodi.

reyqn avatar reyqn commented on June 13, 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!

from jellyfin-kodi.

MagicMan3311 avatar MagicMan3311 commented on June 13, 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.

from jellyfin-kodi.

reyqn avatar reyqn commented on June 13, 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

from jellyfin-kodi.

quixotic120 avatar quixotic120 commented on June 13, 2024

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!

from jellyfin-kodi.

mcarlton00 avatar mcarlton00 commented on June 13, 2024

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)

from jellyfin-kodi.

VoodooZ avatar VoodooZ commented on June 13, 2024

from jellyfin-kodi.

VoodooZ avatar VoodooZ commented on June 13, 2024

from jellyfin-kodi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.