Issue with Jellyfin Import when playing media #416
-
Hi, I have been doing some investigation into an issue I have been having and what I have worked out is if the import process is run whilst I am playing a file in Jellyfin it will cause the status of the file to become invalid. I have a Plex and Jellyfin running and have Watchstate set to run via cron every hour. Import 0 * and export 5 *. Which if Jellyfin is not playing a file works fine and I have no issues. However if I am playing something in Jellyfin when the import job runs that is when it gets all screwed up. During investigating the issues, I discovered that Jellyfin had wrong metadata on a bunch of files which caused WS to keep importing the the same files again and again. So I kept running the Metadata only import until I fixed all the errors and it wasnt importing any new data. aka removed all the duplicates etc. After doing this I was still randomly getting files that didnt import correctly. And after going through the app*.log I suspected the issue and changed the cron job to run at 0100 only. And it seems to be fine Below are extracts from the app*.log let me know if you need more info This is the first entry of this file in the log, I suspect this was whilst I was watching it
This looks to be next import run and it seems to have marked it as watched, but if I am working this out it correctly has marked it as watch at 2024-03-13 17:51:21, which is before the previous import job ran. It is almost like Jellyfin is marking the file as watched at the time I started watching it?
This is then the next time the import ran and the file is now in an invalid state. It stays like this until I manually fix it. I was originally just marking it as played in Plex, but then I tested marking it as unplayed then played in Jellyfin and this also fixes it, as it updates the watched date to valid one.
Let me know if you want more information or testing done. Thanks Heaps for all your work |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 22 replies
-
Thanks, This seems to be an issue with jellyfin backend when the media is being played. i thought i marked the event as tainted as such it shouldn't trigger mark as watched, However. I'll have to dig into it, in the meantime, try using the webhooks for updating and see if it fixes the issue for you. |
Beta Was this translation helpful? Give feedback.
-
@FoMoCo53 , i think I've traced the issue, Please try |
Beta Was this translation helpful? Give feedback.
-
Hi, I just finished running a test on the :dev branch and it is doing the same thing.
I took note of the time that I started watching the episode and that is the time that the episode is being marked as played at. Not the time that I actually finished watching the episode. This seems wrong on the behalf of Jellyfin and makes no sense why it is marking the played at time the time you started watching it. Correct me if I am wrong, but I suspect that is what is causing the issue. Thanks again FoMoCo |
Beta Was this translation helpful? Give feedback.
-
I just ran another test after doing a fresh setup and it is still doing the same thing Started playing at 11:07 A few minutes into playing
Finished playing
Re Ran
FoMoCo |
Beta Was this translation helpful? Give feedback.
-
Thanks again for looking into it here is the report minus the plex keys
|
Beta Was this translation helpful? Give feedback.
-
Ok, After deep testing it seems, jellyfin does not update the Thank you for your report and logs. I've pushed new build to dev which should be up for latest it will fix the issue temporary as described above. |
Beta Was this translation helpful? Give feedback.
-
Yeah I suspected something like that might be the case. Thanks for looking into it. Let me know if you want me to do more testing in the future. |
Beta Was this translation helpful? Give feedback.
@FoMoCo53, Ok i had time to sit down and trace the issue, it's as you guessed, Jellyfin is not updating the date on object, which in turn confuses the importer, sadly there is nothing to fix as it's worked as intended.
However, I've implemented workaround for this issue which sadly only works via webhooks. Enable webhooks for jellyfin, and it should work as expected temporarily until someone raises an issue with jellyfin devs.
Please take a moment to test this and report back.