Fix for recent agent update that broke TV Show sync
robdplatt opened this issue · 16 comments
I noticed my TV Shows stopped syncing. Upon digging into the code and comparing it with the XML from the Plex API, I found that "year" was undefined in newer media. Looks like it was changed to "parentYear".
In the release code, I was able to fix this by changing
year = _ref3.year ;
to
year = _ref3.parentYear || _ref3.year ;
in node_modules\plex-sync\lib\plex.js.
Hi, I tried your fix but unfortunately it does not help. When I run the script on tv shows it always end with error:
TypeError: Cannot read properties of undefined (reading 'Video') at ...plex.js:124:36 at Array.forEach (<anonymous>) at ...plex.js:123:23 at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5)
@x3m666, It seems your issue was not related to the issue I was having.
Which scanner and agent do you use for your tv library?
@robdplatt Default "Plex TV series" for both.
@x3m666 What does your script look like? Do you have the right library id's? Did this work previously and recently break?
@robdplatt It looks like plex-sync token@10.0.1.5/1,r token@10.0.1.10/3,w
IDs are correct. This is actually first time using plex-sync. It worked for movies, but with TV shows have from beginning that problem. It starts good, i can see the read part finnish at 100% but when it should write status on new server, it fail.
This is what my batch file looks like. I allow r/w both directions. I haven't tested it exactly your way.
Both of my plex servers are up-to-date. One runs in windows, the other in an unraid container.
My TV Library is set up like yours.
I can't imagine why you are having different results.
echo Syncing Movies
cmd /c plex-sync.cmd token@192.168.1.4:32400/1 token@192.168.1.69:32400/1
echo Syncing TV
cmd /c plex-sync.cmd token@192.168.1.4:32400/3 token@192.168.1.69:32400/2
I am trying to move from nvidia shield to windows box. Used only read because i dont know what it will do with my source and i dont want to lost my watched states if something goes wrong.
Back up your plex database. Do your testing. If you're not happy with the results, restore the database.
I really don't understand where the problem is. I tried sync my anime shows (which are tv shows) and there the sync worked correctly.
You might try creating another TV Shows library with a copy of one of the shows from your other library and seeing if sync will run that way.
Tried it (only on part of my library because is huge) and its working. But since it doesn't work with my old library all I can do now is to manually mark my played tv shows. Nonetheless, thank you for your help.
Watch state is not saved in the library, but in the DB. Otherwise there would be no problem, since I'm moving only the server part, not the data itself.
There's a free tract.tv sync script you could try running. Maybe it would help you get the sync status into the new library? I was looking into it, but haven't used it yet.
Also, you might be able to get the new library up and running, then go into the database and change the library id to the new id?
I was also looking on that tract plugin, but as far as i know the plugins support for plex is poor to almost non-existent and since my original plex server is served by Nvidia shield it complicate things even more. Therefore I also didn't go to DB migration/synchronization tools. I like this plex-sync tool because it works without any complicated workarounds.
I would probably look at editing the database myself. If the new library works, point it to your current media folder. Now you have two tv librarys, one with no watch status. I would shut down plex, and open the database with any sqlite editor, and see if you can identify the library id with the watch status. Try updating it to the new library id. Start plex back up and see if that worked. Be sure to backup your database.