Script Fixer for Stash

This script has been generated by ChatGPT with my guidance.

The script fixes the following:

When creating heatmaps in Stash

1 - “json: cannot unmarshal number into Go struct field Script.version of type string” which comes from the value of version being an integer and not a string

2 - “json: cannot unmarshal number 39944.5 into Go struct field Action.actions.at of type int64” this is from values not being integers but float instead so it removes all the .5 values form the number and keeps the number as it is.

Scripts not playing properly

3 - Some scripts don’t run as the range is set to 90 we set all of them to 100

Define the root folder path

root_folder = r"F:\x\xxxx" # Set the path to the folder where the scripts are located. It will look in all sub folders and create a backup folder in here with all scripts.

If you have any questions shoot.

https://mega.nz/file/ZooHzY7Y#kNhiP1eSP_-9KKpfYvJyJwMMYk4wBGwjmDDgCdCzs7o

1 Like

I think it might be a better effort to make a pull request in stash to fix the script parser.

Don’t know how to do that I have a lot of scripts that I didn’t want to do 1 by 1 so that’s the solution I came up with and I thought someone might find it useful.