Question regarding date comparison for watch state #317
-
I just started using watchstate and am trying to figure out some of the functionality details. I have two emby servers, one local and one remote on a VPS. The one on the VPS accesses the media synced to a Google Drive share (rclone). My workflow:
Will I have issues with watch state syncing if the following occurs:
At that point, will watchstate see the media as played on server 1, but unplayed on server 2, and since server 2 acquired/added the media at a later time than it was played on server 1, will it determine that the latest watch state is If so, that's going to be a regular problem for me. I used to rely on syncing watch status with trakt so I could keep it in sync between 3-4 servers. But the one option I had for the apps syncing with trakt, was to let it only import/export The downside was, if something got accidentally marked as played, I would have to mark it as unwatched on all the servers and trakt.tv. Is there such an option here? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
Hi, this topic is quite complicated, So i have to break it into few parts to explain the logic and process. If you use webhooks to notify watchstate of the status change, we have marked itemadd events as tainted event with will not alter the state of the object. If however, you use regular import/export, it will check the date on object. if the date on the object is newer than when you watched the said item, the behavior is as expected newer > older. However, the method you use to transfer your media from local to remote could maintain the file creation date, you have to enable the option for emby to use it though I personally use and recommend the webhook method. it will sync your state much faster than regular import/export. this doesn't mean you dont use the import/export you can enable both.
With watchstate you only need to mark it on one server and it will propagate to the other servers. You can always backup your play state using |
Beta Was this translation helpful? Give feedback.
-
Unfortunately Rclone to Google Drive does not preserve the file creation date. I will rely on webhooks then, that's great. |
Beta Was this translation helpful? Give feedback.
-
I tested it, but I'm observing some weird behavior that I can't figure out. It turns out, rclone Google Drive sync does set the file creation date, so the addition time on the remote emby matches the local emby. However, I also have a couple of plex servers (one local, one remote) and they go by when it was actually scanned into the library so that won't help there. In any case, here's the weird behavior:
Now I have the episode marked as played on the lcoal emby and watchstate, but is is unplayed on the other 3 servers. Did it get messed up because I did the export before import? |
Beta Was this translation helpful? Give feedback.
-
Let's define the scenario first.
so far everything is within the expected behavior, since the item_add date on remote servers is newer than when you watched the items, it will not change the state to played. to fix this, you have to change the cron options for export to ignore the date comparison, sadly that's the downside of supporting mark as unplayed. |
Beta Was this translation helpful? Give feedback.
-
I see. But I can't get unplayed working either via webhook. I marked a movie as played on local Emby. Webhook received, updated play state on watchstate. Then I marked it as unplayed on local Emby. Here's the json output of the
And when I try an export, I get:
There are no queued webhook events. Now my emby and plex servers are out of sync where the movie is marked as played on plex, but unplayed on emby. Sorry for the series of questions. There is quite a bit of a learning curve with the process and the commands so I keep digging deeper into them :-) |
Beta Was this translation helpful? Give feedback.
-
Unfortunately it's still not working for marking as unplayed on emby. I started from scratch. Set up two local servers, one emby, one plex. I set up emby first and imported. Then set up plex and did a force export, and then enabled import/export. All good. Play state is perfectly in sync. I mark a movie as watched on emby. Webhook shows up in log. I mark the same movie as unwatched in emby. Webhook shows up in docker log with a message saying it's getting queued. Nothing shows up in No matter what I do, it won't ever mark it as unwatched in watchstate and the servers are out of sync. I have to mark it as unplayed in plex, and then import and export. Then they get in sync again. I tried with a few different movies, all with the same result. Weirdly, watchstate knows they are out of sync but doesn't do anything about it. When they're out of sync, where a movie is watched on plex but unwatched in emby, if I mark it as unwatched in plex, the next import shows the play state updating from plex. And the next export gladly shows Here's the yaml output after marking something as unplayed on emby and the webhook is received:
|
Beta Was this translation helpful? Give feedback.
Hi, this topic is quite complicated, So i have to break it into few parts to explain the logic and process.
If you use webhooks to notify watchstate of the status change, we have marked itemadd events as tainted event with will not alter the state of the object. If however, you use regular import/export, it will check the date on object. if the date on the object is newer than when you watched the said item, the behavior is as expected newer > older. However, the method you use to transfer your media from local to remote could maintain the file creation date, you have to enable the option for emby to use it though
Server > Library > Advanced > Date added behavior for new content: > Use fi…