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

plex_library_sync.py: Media items not found in other library #53

Closed
spicerackk opened this issue May 21, 2022 · 12 comments
Closed

plex_library_sync.py: Media items not found in other library #53

spicerackk opened this issue May 21, 2022 · 12 comments
Assignees
Labels
1. Bug request Request for bug to be fixed 2. Level: Medium The request is of normal difficulty 3. Request accepted Request is accepted and will be realised

Comments

@spicerackk
Copy link

In which file is the bug? plex_library_sync.py

Describe the setup (arguments and their values, how it was run, etc.): running -s SOURCELIBRARYNAME -t TARGETLIBRARYNAME -S collections

Describe what the bug is: When the script gets to a collection that doesn't have any poster, it errors out and cancels.

Describe what should be happening: I would expect it to skip that collection and move on to the next.

@spicerackk spicerackk added the 1. Bug request Request for bug to be fixed label May 21, 2022
@Casvt Casvt added the 3. Request accepted Request is accepted and will be realised label May 21, 2022
@Casvt Casvt self-assigned this May 21, 2022
@Casvt
Copy link
Owner

Casvt commented May 21, 2022

Could you share the error that you get (copy paste or screenshot). I've looked at the script and I see a check in there that makes sure to only upload a poster when there is a poster. And yet you report that the script errors when the collection doesn't have a poster. But I have a check in my script to ensure that we don't upload posters when the source doesn't have a poster.

That means that something else is going on so could you share the error that you got so I can take a look? Thanks

@spicerackk
Copy link
Author

Traceback (most recent call last): File "D:\Plex-scripts\plex_library_sync.py", line 142, in <module> response = plex_library_sync(ssn=ssn, source_library_name=args.SourceLibraryName, target_library_name=args.TargetLibraryName, sync=args.Sync) File "D:\Plex-scripts\plex_library_sync.py", line 91, in plex_library_sync col_content = ssn.get(f'{base_url}{col["key"]}', params={'includeGuids': '1'}).json()['MediaContainer']['Metadata'] KeyError: 'Metadata' PS D:\Plex-scripts>

@Casvt
Copy link
Owner

Casvt commented May 21, 2022

Ah see! Different error. It isn't a problem with the posters. The problem is that I didn't account for empty collections!

@spicerackk
Copy link
Author

Ah fair enough! I wish I was good with code, I had an idea for a Discord bot and started working on it, but got stuck and haven't looked at it again since starting my new job.

Casvt added a commit that referenced this issue May 21, 2022
Casvt added a commit that referenced this issue May 21, 2022
@Casvt
Copy link
Owner

Casvt commented May 21, 2022

Bug fixed. Redownload the script to have the fix.

P.S. If you're indirectly letting me know that you want a discord bot, I don't have any experience with them so no I won't make one for you haha

@Casvt Casvt closed this as completed May 21, 2022
@Casvt Casvt added the 3. Request completed Request has been completed label May 21, 2022
@spicerackk
Copy link
Author

Thanks for that!

I mean look, it is always worth throwing out there, that's perfectly fine for you to not want to :) Hopefully one day I can get back to it myself!

@spicerackk
Copy link
Author

Is there a possibility of having the option to sync posters across libraries that aren't in a collection too?

@Casvt
Copy link
Owner

Casvt commented May 21, 2022

The script already does that. It should sync the posters of all media in the library. Not only collections. Add -S posters to the list of arguments.

@spicerackk
Copy link
Author

it doesn't seem to be actually changing the posters in Kid Movies when I run that argument, but it does print the list of movies in the source library after running it

@Casvt
Copy link
Owner

Casvt commented May 22, 2022

That means that it can't find the "match" of a movie/show in the other library. Aka you have movie1 in the source lib but movie1 wasn't found in the target lib.

I've made an update to the script to better show this. Can you re-download the script, run the new version and tell me what the output is?

@spicerackk
Copy link
Author

Ok so I downloaded the new code, the output remains the same, just prints the list of all the movies in the source library.

I know that the movies exist in both libraries, as they both use the same directory structure.

"L:\Movies" and "L:\Kids Movies" both exist in the Movies library, whereas "L:\Kids Movies" only exists in the Kids Movies library.

@Casvt
Copy link
Owner

Casvt commented May 22, 2022

That's strange. Please contact me on the discord server (https://discord.gg/QvWKGJ86XR) for easier support.

@Casvt Casvt added 2. Level: Medium The request is of normal difficulty and removed 3. Request completed Request has been completed labels May 26, 2022
@Casvt Casvt reopened this May 26, 2022
@Casvt Casvt changed the title Script cannot pass collections without a poster plex_library_sync.py: Media items not found in other library May 26, 2022
@Casvt Casvt closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug request Request for bug to be fixed 2. Level: Medium The request is of normal difficulty 3. Request accepted Request is accepted and will be realised
Projects
None yet
Development

No branches or pull requests

2 participants