blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.66k stars 308 forks source link

sync_watch_status doesn't sync everything #368

Closed d3mystified closed 1 year ago

d3mystified commented 1 year ago

I'm trying to sync from user1 (managed account) to user2 (normal plex user) who are both added to server:

python3 sync_watch_status.py --userFrom user1=server --userTo user2=server --libraries Movies "TV Shows"
Connecting to admin server(s) for access info...
Checking user1's access to server
Connecting user1 to server...
Finding watched items in libraries...
Connecting user2 to server...
Checking user1's library: 'Movies' watch statuses...
Marking watched...
/home/srvr/srvr/tautulli/scripts/sync_watch_status.py:399: DeprecationWarning: Call to deprecated function or method "isWatched", use "isPlayed" instead.
  if not fetch_check.isWatched:
Checking user1's library: 'TV Shows' watch statuses...
Marking watched...

Even though the script says everything is watched, it doesn't actually work. I think it's only marked a few movies and last few episodes watched.

Is this a Plex limitation or a script limitation?

d3mystified commented 1 year ago

I had to change the search logic to the following:

watched_lst = sectionFrom.search(libtype='episode', filters={"episode.unwatched": False}, maxresults=1000, container_size=1000)

Then it worked.

Xuth1 commented 1 year ago

This also solved the same issue for me, although I had to change maxresults=1000 to maxresults=-1 to ensure it ran the full library without a premature stop.

blacktwin commented 1 year ago

Even though the script says everything is watched, it doesn't actually work

It's not saying that. You would see each item that was marked as watched in the console or logs. You should not be making that large of a request. Instead it should be repeated requests until the entire library is grabbed.