luigi311 / JellyPlex-Watched

Sync watched between jellyfin and plex locally
GNU General Public License v3.0
422 stars 20 forks source link

[BUG] Add version check for jellyfin to make sure partial marks are only done on 10.9+ #176

Closed mgabor3141 closed 4 months ago

mgabor3141 commented 5 months ago

Describe the bug I have a user who has watched this movie partially on Emby. I'm assuming the endpoint returns 404 because this user has not touched this particular movie on Jellyfin. Both IDs in the request are correct: user ba4e... exists, and movie 48cf2a... exists and match the names in the log.

Logs:

[MARK]: Jellyfin: Blush as partially watched for 9 minutes for jani in Movies
[ERROR]: Jellyfin: Query post /Users/ba4e36e55bf04487889d71b725b09b5b/Items/48cf2a7271815b873ec987c92176ca97/UserData
Results None
Query failed with status 404 Not Found
[ERROR]: Jellyfin: Error updating watched for jani in library Movies, Query failed with status 404 Not Found
[ERROR]: Traceback (most recent call last):
  File "/app/src/jellyfin_emby.py", line 155, in query
    raise Exception(
Exception: Query failed with status 404 Not Found

As a workaround I have blacklisted the user for now.

To Reproduce Easily reproducible on my instance:

  1. Go to Emby and partially watch a movie
  2. Run the sync and watch it fail with the same error

Expected behavior The sync succeeds and both platforms show the movie as partially watched. Alternatively it would also be nice as a workaround to abort syncing this item but continue with the sync and other items.

Type: [x] Unraid

Additional info

Note that syncing partial playstates in the reverse direction (Jellyfin -> Emby) does not error, but it does not seem to work. I have partial plays in Jellyfin that are not being transferred over to Emby. Edit: turning GUID off fixed this. Anyway it's definitely an unrelated issue.

atunguyd commented 5 months ago

Hi I am getting the same error in syncing between Plex and Jellyfin, also a movie my son partially watched. Below is the output for me:

Server 1: Plex: Plex MythBox: 1.40.3.8555-fef15d30c Server 2: Jellyfin: Jellyfin gateway: 10.8.13 Plex: Generating watched for adrian in library Animated Movies Plex: Generating watched for adrian in library Family Movies Plex: Generating watched for adrian in library Movies Plex: Generating watched for adrian in library Cartoons Plex: Generating watched for adrian in library Family TV Shows Plex: Generating watched for adrian in library Kids TV Shows Plex: Generating watched for adrian in library TV Shows Plex: Generating watched for adrian in library Music Plex: Generating watched for adrian in library Documentries Plex: Generating watched for adrian in library Home Videos Plex: Generating watched for adrian in library Sport Jellyfin: Generating watched for adrian in library Animated Movies Jellyfin: Generating watched for adrian in library Family Movies Jellyfin: Generating watched for adrian in library TV Shows Syncing Plex MythBox: 1.40.3.8555-fef15d30c -> Jellyfin gateway: 10.8.13 [MARK]: Jellyfin: Despicable Me 3 as partially watched for 69 minutes for Adrian in Animated Movies [ERROR]: Jellyfin: Query post /Users/30e4625f33674c08954fad11c3fb227a/Items/353fcdb8770291fa297aab8322ceed6a/UserData Results None Query failed with status 404 Not Found [ERROR]: Jellyfin: Error updating watched for Adrian in library Animated Movies, Query failed with status 404 Not Found [ERROR]: Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 155, in query raise Exception( Exception: Query failed with status 404 Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 572, in update_user_watched self.query( File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 178, in query raise Exception(e) Exception: Query failed with status 404 Not Found

[ERROR]: Jellyfin: Error updating watched, Query failed with status 404 Not Found [ERROR]: Query failed with status 404 Not Found [ERROR]: Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 155, in query raise Exception( Exception: Query failed with status 404 Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 572, in update_user_watched self.query( File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 178, in query raise Exception(e) Exception: Query failed with status 404 Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 815, in update_watched self.update_user_watched( File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 738, in update_user_watched raise Exception(e) Exception: Query failed with status 404 Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anthony/JellyPlex-Watched/src/main.py", line 405, in main main_loop() File "/home/anthony/JellyPlex-Watched/src/main.py", line 390, in main_loop server_2[1].update_watched( File "/home/anthony/JellyPlex-Watched/src/jellyfin_emby.py", line 821, in update_watched raise Exception(e) Exception: Query failed with status 404 Not Found

e-rowell commented 5 months ago

I was also having this issue. My issue resolved after updating from Jellyfin from v10.8.10 to v10.9.7.

luigi311 commented 5 months ago

Yes partial syncing is only supported in 10.9+ as thats when it was added in the api. I never created a condition check for it to make sure the version was greater or equal to 10.9 so if your are on something like 10.8 or older your will probably get an error.