arabcoders / watchstate

Self-hosted service to sync your plex, jellyfin and emby play state. without relying on 3rd-party external services.
MIT License
481 stars 9 forks source link

[BUG] Unable to update jellyfin #565

Open bkarakashev opened 13 hours ago

bkarakashev commented 13 hours ago

Describe the bug I am unable to sync my Plex Watch history to my Jellyfin. I started one episode of a TV show and stopped it in the middle on the Plex server. I have added both backends and I've enabled Import on the Plex side and Export on the Jellyfin side. Then I ran the Import task and then the Export task and nothing was updated on the Jellyfin side.

To Reproduce Start a TV Show on Plex watched it to the middle then stopped. Added both backends. Import for Plex and Export for Jellyfin Run the Import and then the Export task but my Jellyfin server didn't get the update it didn't show that the TV show episode was watched half way.

Expected behavior I am expecting to see my Jellyfin watch history updated to match my Plex watch history.

Basic report

[ Basic Report ]

WatchState version: 20241107-63d638c
PHP version: 8.3.13
Timezone: UTC
Data path: /config
Temp path: /config
Database migrated?: Yes
Does the '.env' file exists? Yes
Is the tasks runner working? Yes 'Container' - Task worker is running.
Running in container? Yes
Report generated at: 2024-11-15T21:29:38+00:00

[ Backends ]

[ Plex (1.41.0.9018-4b74567bc) ==> plex ]

Is backend URL HTTPS? Yes
Has Unique Identifier? Yes
Has User? Yes
Export Enabled? Yes
Time since last export? 1970-01-01T00:00:00+00:00
Play state import enabled? Yes
Metadata only import enabled? No
Time since last import? 2024-11-15T21:21:52+00:00
Is webhook match user id enabled? No
Is webhook match backend unique id enabled? No
Has custom options? Yes
{"ADMIN_TOKEN":"**HIDDEN**"}

[ Jellyfin (10.10.1) ==> jellyfin ]

Is backend URL HTTPS? Yes
Has Unique Identifier? Yes
Has User? Yes
Export Enabled? Yes
Time since last export? 2024-11-15T21:24:29+00:00
Play state import enabled? Yes
Metadata only import enabled? No
Time since last import? 1970-01-01T00:00:00+00:00
Is webhook match user id enabled? No
Is webhook match backend unique id enabled? No
Has custom options? No
{}

[ Log suppression ]

Does the 'suppress.yaml' file exists? No

[ Tasks ]

[ Import ]

Is Task enabled? No

[ Export ]

Is Task enabled? No

[ Backup ]

Is Task enabled? Yes
Which flags are used to run the task? -v
When the task scheduled to run at? 0 6 */3 * *
When is the next scheduled run? 2024-11-16T06:00:00+00:00

[ Prune ]

Is Task enabled? Yes
Which flags are used to run the task? -v
When the task scheduled to run at? 0 */12 * * *
When is the next scheduled run? 2024-11-16T00:00:00+00:00

[ Indexes ]

Is Task enabled? Yes
Which flags are used to run the task? -v
When the task scheduled to run at? 0 3 * * 3
When is the next scheduled run? 2024-11-20T03:00:00+00:00

[ Dispatch ]

Is Task enabled? Yes
Which flags are used to run the task? -v
When the task scheduled to run at? * * * * *
When is the next scheduled run? 2024-11-15T21:30:00+00:00
arabcoders commented 2 hours ago

Hello,

I am afraid without logs i can only guess, your media probably matched differently in plex and jellyfin and they are using different GUID, to easily see if that the case, go to one of the item sin history that you know you watched and see if both media servers reporting metadata for it.

bkarakashev commented 48 minutes ago

Hi @arabcoders, Thank you for your reply. The media files are from the same source for both Jellyfin and Plex so the files and naming is identical. I checked a TV show that I watched and I can see that both report metadata and both show different progress in the metadata. Today I checked with a different TV Show I moved forward to the middle of the episode in Plex and then run the Import backend for Plex then Export in the Jellyfin and nothing again. Also when looking in the History the metadata is all wrong. It is not showing that the tv show episode has progressed and now is at X minutes. The metadata shows the database was updated 4 min ago but there is no change it is now showing the change in the progress.

What steps and logs I can provide so to make it easier to troubleshoot this issue?

Thanks

arabcoders commented 41 minutes ago

Hi @arabcoders, Thank you for your reply. The media files are from the same source for both Jellyfin and Plex so the files and naming is identical. I checked a TV show that I watched and I can see that both report metadata and both show different progress in the metadata. Today I checked with a different TV Show I moved forward to the middle of the episode in Plex and then run the Import backend for Plex then Export in the Jellyfin and nothing again. Also when looking in the History the metadata is all wrong. It is not showing that the tv show episode has progressed and now is at X minutes. The metadata shows the database was updated 4 min ago but there is no change it is now showing the change in the progress.

What steps and logs I can provide so to make it easier to troubleshoot this issue?

Thanks

Hi, to clarify progress sync is not handled by import/export but a different event which must be enabled manually, WS_SYNC_PROGRESS which can be found in env page. import/export tries to do watch progress but due to nature of the implementation it's sometimes misses the progress to not alter your data.

To see errors, you need to examine the following logs tasks.XXXX.log - webhook.XXXX.log for data related to the said item. and if you can post it along side the raw data from the item view page e.g. this data.

{60D76296-F78F-4F66-8419-3922869CA1D4}

Also enable WS_LOGS_CONTEXT env to see more data in logs.