stashapp / CommunityScripts

This is a public repository containing plugin and utility scripts created by the Stash Community.
https://docs.stashapp.cc/add-ons/
GNU Affero General Public License v3.0
182 stars 140 forks source link

Auto Delete and Keep Metadata for Upgraded file #409

Open speedyflipper opened 6 months ago

speedyflipper commented 6 months ago

When scenes are upgraded to a better quality, the original file and new file are kept separate.

For example, using Whisparr.

  1. Scene 123 is downloaded in 720p and adding to Stash. It is correctly identified and metadata is correct.
  2. Whisparr finds a 1080p version and downloads it and deletes the 720p version. The 1080p is matched to the same metadata as the 720p version.

Currently both the 720p and 1080p are added to Stash. The 1080p will show as recently added and the 720p will remain but not able to play due to the file no longer existing.

I would like the 1080p to keep the date added, and other non-downloaded metadata and auto remove the 720p file.

elkorol commented 6 months ago

A 1080p isn't necessarily better than a 720p. One could have better bitrate and the 1080p might not be a true 1080 nad is just a less than 1080p encoded in 1080p.

If the original files are kept seperate. I'm not sure if you didn't run generate phashes on import they might be kept seperate. But if the phashes are generated and are the same you don't end up with two scenes. they are merged into the one scene.

Again I'm not sure, but I don't think those who code Stash want to take the reigns of determining for you which is a better quality file and that's on you. There are duplication plugins to match a phashes and distance from one another and it orders it for ones you keep and ones you discard. But again they tell you to check before deleting, because it's not an exact science.

I wish in the duplication plugin there was a way to quickly copy metadata from a scene you want removed to one you want to keep quickly because it's like that sometimes for me. But I think that would require another userscript because the plugin labels keeps and removes through a scenes title, so swapping metadata wouldn't be that easy I don't think.

WithoutPants commented 6 months ago

This is more suited for an external script or plugin and not for the core stash functionality.