Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for recent agent update that broke TV Show sync #88

Open
robdplatt opened this issue Aug 31, 2021 · 16 comments
Open

Fix for recent agent update that broke TV Show sync #88

robdplatt opened this issue Aug 31, 2021 · 16 comments

Comments

@robdplatt
Copy link

robdplatt commented Aug 31, 2021

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.

@robdplatt robdplatt changed the title TV Shows broken with recent agent update Fix for recent agent update that broke TV Show sync Aug 31, 2021
@x3m666
Copy link

x3m666 commented Jan 21, 2022

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)

@robdplatt
Copy link
Author

@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?

@x3m666
Copy link

x3m666 commented Jan 21, 2022

@robdplatt Default "Plex TV series" for both.

@robdplatt
Copy link
Author

@x3m666 What does your script look like? Do you have the right library id's? Did this work previously and recently break?

@x3m666
Copy link

x3m666 commented Jan 21, 2022

@robdplatt It looks like plex-sync [email protected]/1,r [email protected]/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.

@robdplatt
Copy link
Author

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 [email protected]:32400/1 [email protected]:32400/1

echo Syncing TV
cmd /c plex-sync.cmd [email protected]:32400/3 [email protected]:32400/2 

@x3m666
Copy link

x3m666 commented Jan 21, 2022

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.

@robdplatt
Copy link
Author

Back up your plex database. Do your testing. If you're not happy with the results, restore the database.

@x3m666
Copy link

x3m666 commented Jan 24, 2022

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.

@robdplatt
Copy link
Author

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.

@x3m666
Copy link

x3m666 commented Jan 24, 2022

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.

@robdplatt
Copy link
Author

robdplatt commented Jan 24, 2022 via email

@x3m666
Copy link

x3m666 commented Jan 24, 2022

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.

@robdplatt
Copy link
Author

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?

@x3m666
Copy link

x3m666 commented Jan 24, 2022

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.

@robdplatt
Copy link
Author

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.

Repository owner deleted a comment Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants