blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.67k stars 307 forks source link

Don't replace artwork if it exists, don't refresh metadata unless artwork has been updated #319

Closed PNRxA closed 1 year ago

PNRxA commented 2 years ago

To work better with #317 as by default it will create all artwork which takes ages on large libraries. On subsequent runs, this works way faster.

E.g., when episode files get replaced. There is no trigger for this and a library-wide scan (like in the #317 example) has to be run.

blacktwin commented 2 years ago

I don't understand what you're trying to solve here. The only artwork that is created is the blurred poster and only when 1 items is defined. The entire reason for the script is to blur our spoiler'y posters. Would you already have these posters at the ready when the item is added to Plex? Again, I don't understand. Did you mean to reference #315 ? I don't plan on merging that PR. You can read my reasons why in the comments.

PNRxA commented 2 years ago

Sorry for the confusion @blacktwin this affects the script when it's run inside other scripts like the example in #317.

If you run the example script in #317 and iterate over your whole library, you will have generated blurred posters for every episode. When Sonarr replaces an episode when a better quality episode becomes available, it will erase the blurred artwork and the old episode file. When Sonarr replaces an episode file, this doesn't trigger a 'recently added', so running the same script to iterate over the whole library is useful to be run again and blur any missed episodes.

This PR aims to not change the default behaviour of the script, or change how it behaves when used in the default way in the recently added & watched Tautulli hooks. Its aim is only to change the behaviour when used in other scripts like the example in #317. e.g., iterating over large amount of objects multiple times as to not double up and generate blurred artworks for episodes that already have them, as a result improving subsequent run times significantly.

blacktwin commented 2 years ago

That helps, thank you. I still don't understand the need or desire to run this on every episode in a library.

PNRxA commented 2 years ago

That's more of a personal preference, I guess. Personally, I like all episode files being blurred and don't want to specify certain shows.

blacktwin commented 2 years ago

For me, it adds nothing to the intended purpose of the script. If you're using the example why not add your logic while your looping the library in the example?

PNRxA commented 2 years ago

For me, it makes the script more modular and reusable in other scripts.

The changes have been designed as to not mess with any default behaviour of the script, and to only introduce a few changes that make sense.

This can also be overridden with the added --replace flag.

Every script that uses this script would benefit from this behaviour in my opinion.