jellyfin / jellyfin-kodi

Jellyfin Plugin for Kodi
https://jellyfin.org
GNU General Public License v3.0
845 stars 113 forks source link

Kodi does not fill the library using Jellyfin plugin for TV Shows #76

Closed martinjh99 closed 5 years ago

martinjh99 commented 5 years ago

Describe the bug When I populate the Kodi Library with information from Jellyfin Movies work fine but only 2 TV Shows appear in my Kodi TV Shows Library.

To Reproduce

  1. Install Kodi Jellyfin repo zip file and Jellyfin plugin 1a. Install the Jellyfin Kodi Sync Plugin and restart Jellyfin
  2. Follow the Initial Setup Wizard up to the point of it asking what libraries from Jellyfin I want to sync
  3. Click All as I want Movies and TV Shows to be synced
  4. Let it sync up - Movies are fully populated but only 2 tv shows actually are populated.

Expected behaviour

Both my Movies and my TV Shows are fully populated.

Logs

https://pastebin.com/FYs0MkeJ - Kodi log https://pastebin.com/6Zwx237v - Folder structure for TV Show media, jpg nfo etc are from a stand alone Kodi library, Space 1999 and UFO were the ones that appeared in Kodi from Jellyfin

System (please complete the following information):

mcarlton00 commented 5 years ago

The file structure of your library shouldn't matter. If it's been imported into the Jellyfin server and is appearing when looking through the web client, it should be appearing in Kodi. The logs are telling us that the server is reporting those TV shows as empty.

INFO::resources/lib/objects/tvshows.py:72 Skipping empty show Avatar: The Last Airbender: 31a0c1ec9aba80b719d7b4b62034b1ad
INFO::resources/lib/objects/tvshows.py:72 Skipping empty show Blake's 7: 25a87574cf27fb6ec2aaa2da9b0883f4
INFO::resources/lib/objects/tvshows.py:72 Skipping empty show Captain Scarlet: f7737343887206fb279a20721058b0c7
INFO::resources/lib/objects/tvshows.py:72 Skipping empty show Dark Angel: 46e575b684d4106daab9920720abf230
INFO::resources/lib/objects/tvshows.py:72 Skipping empty show Doctor Who (2005): c57fda9ae681f260f5d0ba46547d37ba
INFO::resources/lib/objects/tvshows.py:72 Skipping empty show The Legend of Korra: b36f16a50b550dcc860a872e5bdf82e7

Potentially silly question, but are you absolutely sure they're available in the Jellyfin server itself? The screenshot shared on reddit shows that the server thinks the shows are there, but it doesn't give us any indication if they actually have any contents.

There's some very odd errors in the logs that I haven't seen before, several of which are coming from Kodi itself, not the addon. Are there any other addons installed in Kodi that could be interfering? Were these fresh Kodi profiles, or was there a previous library in use in the install?

There's also errors about being unable to connect to some smb:// paths. Are you trying to use the 'add-on' or 'native' playback mode? This really shouldn't affect the sync in any way, but I'd like to understand where these other log messages are coming from.

martinjh99 commented 5 years ago
martinjh99 commented 5 years ago

Just re-installed the Windows Store version of Kodi and installed the latest master copy of the plugin. Still not grabbed all TV shows from Jellyfin. SO yes using a totally fresh install and Kodi profile.

TrueTechy commented 5 years ago

Hi there, could you install the version of the addon I have attached at the bottom of this reply which has additional logging to see if we can pinpoint where this issue is coming from.

You'll first need to do the database reset from within the plugin go to addons->video addons->jellyfin->open->perform local database reset, then uninstall the plugin from the previous menu.

In the top level addon menu there is a "install from zip file" option, when you click it it may tell you that you need to enable unknown sources that's necessary to allow for this installation but you can change it back afterwards, then go back to the option to install, locate the zip file you downloaded and install it. Then setup the addon then libraries as normal, then test to see if the issue still persists and if so could you then upload this new kodi.log file

Thanks

Addon debug version: Faulty debug file removed

martinjh99 commented 5 years ago

Having trouble syncing the files with that new version. Kodi says there is a problem with the sync and try again later. Here is the log file anyway.

Windows Store Version of Kodi 18.3

kodi.log

mcarlton00 commented 5 years ago

Did you restart kodi between uninstalling the old version and installing the new one? I'm still seeing some errors in the log file from things that we've already fixed, I'm curious if a restart is needed for it to clear the old one out of memory

martinjh99 commented 5 years ago

Yup using the Windows store version of Kodi(18.3 on latest version of Windows 10) I actually uninstalled and reinstalled as it doesn't take that long just to make sure there was no residual leftovers from the old Jellyfin plugin and making sure there was a clean profile to start with just in case.

Was trying to sync both TV and movies at the same time which is where it was failing. Movies on their own worked fine and when I tried to sync TV Shows I get the problem with sync error message.

For some reason Github won't let me upload another log so here is the log -https://pastebin.com/QL7Qc4M1

TrueTechy commented 5 years ago

My apologies, there was some debugging code still in there which was messing up the TV show sync, I've recreated the addon file for you to try it again with

jellyfin-kodi.zip

martinjh99 commented 5 years ago

kodi.log

TV Shows only synced this time as Movies are working. Only 2 shows are showing up at the moment.

TrueTechy commented 5 years ago

Hi there, thanks for running that version of the plugin it gave us the information we needed to confirm that the server is telling the addon that there are no episodes in the show you're missing. It also shows the server thinks you've not watched any episode in those TV shows but I remember from your screenshots that the ticks were showing on the covert art which happens when you have no episodes as part of the show. Without accessing your jellyfin instance directly to see the details there's not much I can suggest to remedy this without reinstalling and setting up the jellyfin server again to see if that fixes it

martinjh99 commented 5 years ago

Deleted the config folder for Docker Jellyfin, kept the cache folder - reran the main configuration wizard and synced just my TV Show library.

It seems that something somewhere in the server is marking them as watched as it scans the library.

Also fixed filling in my whole library in Kodi by syncing empty shows.

mcarlton00 commented 5 years ago

I think it's possible that the watched status is living in the cache directory (at least temporarily), so that might explain why things got marked as watched even on a fresh install. That would be a question for the server guys.

With the new server install it synced all your TV Shows down to the Kodi library? If so, it sounds like this can be closed out. Or are you saying you fixed it by telling the Kodi addon to sync empty shows?

martinjh99 commented 5 years ago

I synced empty shows. They did show up in Kodi as unwatched though and are playable.

Just tried it in a container with empty cache and config directories and they are still being shown as watched when I view the library using the Jellyfin web view.

Guessing this could be a server bug rather than kodi plugin bug?

mcarlton00 commented 5 years ago

There's a good chance the Jellyfin server is importing the watched status from the .nfo files in your library. It doesn't explain why the API from your server is returning 0 contents for various shows, but it sounds like it's not strictly an issue with the Kodi addon. Thanks for sticking around and helping to debug.

Closing for now until the problem resurfaces.

martinjh99 commented 5 years ago

This was not a bug - I had nfo files that Jellyfin was reading in the TV Shows directory that was causing the server to mark them as watched as I scanned the details into Kodi - Deleted the nfo files and all were coming into Kodi as unwatched.