mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[Issue]: Importing watched status from NFO is not working #4849
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TwentyWasHere on GitHub (May 14, 2023).
Please describe your bug
When parsing NFO files Jellyfin does not process watched information from NFO files, all imported media show up as unwatched.
No NFO Saver activated on the source because I do not want Jellyfin to update the NFO itself, just read what is in there includung the watched status (the UI states it is for saving only, not for reading). A user has been set in the general NFO settings though.
Jellyfin Version
10.8.z
Environment
Jellyfin logs
No response
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
@TwentyWasHere commented on GitHub (May 14, 2023):
Did some playing around with a fresh container and just a few movies.
Jellyfin itself detects the watch state (I added some debug code to dump the information) but fails to update the UserData in SQLLite later on.:
The scanning of movies works fine and completes, but everytime "_userDataManager.SaveUserData(user, item, userData, UserDataSaveReason.Import, CancellationToken.None);" is called to update the user data for watched/lastplayed/playcount in "MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs" during scanning a Busy exception is thrown and therefore the watched status is never saved.
@Shadowghost commented on GitHub (May 14, 2023):
Can you please post the used NFO?
@TwentyWasHere commented on GitHub (May 14, 2023):
Attached is one example, where it fails on SaveUserData. Note sometimes one movie makes it through and the watched state is set (I tested with a set of 25 movies in a folder of which three were set to watched).
test_movie.nfo.zip
@jellyfin-bot commented on GitHub (Sep 12, 2023):
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.
@rschuiling commented on GitHub (Oct 6, 2023):
I have the same issue, unfortunately this one was just closed. Do I need to raise a new issue or can this be looked at again?
@jellyfin-bot commented on GitHub (Feb 4, 2024):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.
@Zothoz commented on GitHub (Feb 17, 2024):
This topic is still open, nfo state "< watched >true</ watched >" is ignored when importing movies. (had to enter spaces between the brackets to show correctly as post).
@Morphy99 commented on GitHub (Feb 25, 2024):
I've just migrated from Emby and have the same problem. This is a deal breaker for me :(
@jellyfin-bot commented on GitHub (Jun 25, 2024):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.
@jellyfin-bot commented on GitHub (Jul 16, 2024):
This issue was closed due to inactivity.
@brupec commented on GitHub (Aug 16, 2024):
Hello, issue is still present.
It had been fixed while ago already two times, but seems changed is removed each time ?
https://github.com/jellyfin/jellyfin/issues/8415
@brupec commented on GitHub (Aug 16, 2024):
OK actually it seems to work on some files, other not. so the problem may be different.
Here are two NFOs. I renamed them to NOK and OK, NOK appears as unseen when loaded in Jellyfin, OK appears as seen. I added .log to the filename.
NOK.nfo.log
OK.nfo.log
Both have the watched tag to true.
Edit: confirmed after importing my whole kodi database. I would say like half of the title watched status was not imported, even if present in nfo. I did it manually, but definately something to fix here in my opinion. Cheers
@vvdveen commented on GitHub (Nov 1, 2024):
I ran into this bug when migrating from Kodi to Jellyfin. Jellyfin writes UserData to the database immediately after reading a userdata field (e.g., playcount or lastplayed). But because kodi writes identifiers (e.g., IMDB id or TMDB id) to the .nfo AFTER userdata, Jellyfin does not know to what entry the userdata should be written. When I changed my .nfo to always have the uniqueid tags at the very beginning of the XML tree, Jellyfin would indeed start importing.
I then ran into a related issue where no movie would be shown as watched. Jellyfin expects a "watched" tag in the .nfo that is not written by kodi. I fixed this by changing my .nfo to include a "watched" tag.
I then observed a third issue where some movies that did not have their watch status set, would still show up as "recently played". This seems to be caused by the caching mechanism for UserData. This uses a key that is the same for all videos. Jellyfin caches only one UserData item, makes changes to that, and writes it to disk. So any UserData field not updated by the .nfo would default to whatever Jellyfin saw when parsing an earlier .nfo. I fixed this by disabling the caching mechanism and recompile Jellyfin.
Unfortunately, I find the code a bit convoluted. Fixing the above will take me time that I don't have :( Instead I wrote a script to update my .nfo files. Combined with a small patch that disables the caching of UserData, I think I can now import my kodi video library correctly. Because this is only a one-time event, it may work for others too: https://gist.github.com/vvdveen/e7de190e0d73423b109ac15f1e78e3b5