Closed Montspy closed 2 years ago
This implements #19
@sk33z3r Should we make the default behavior to preserve metadata and have an --overwrite flag instead?
Should we make the default behavior to preserve metadata and have an --overwrite flag instead?
Seems to feel more "user friendly" if you automatically overwrite so nothing is ever stale. I can't come up with an argument where you would want to keep the CID list stale like that, but I'm sure there is a use case I'm not thinking of.
At the end of the day, I make a change to a file and try to mint, I don't expect to have to regen CID because it's sort of a hidden feature to the user right now. Might not be completely obvious that the CID calc was a step in the process.
Agreed, in all cases, running metadata should always "refresh" at least the CIDs.
a) Current behavior is to overwrite the whole metadata file. Including any manual edits.
b) My old proposal (--preserve
) was to keep this as default behavior. The --preserve
flag would only update the CIDs nad keep any metadata edits.
c) My new proposal (--overwrite
) is to change the default behavior to refresh only the CIDs and --overwrite
would overwrite the whole metadata file.
I believe behavior c) to be less prone to data loss for users who manually edit their metadata after generation, while preventing stale CIDs for all users
Changed the default behavior to only update CIDs
Added --overwrite
flag to force rewriting new metadata json files
I believe behavior c) to be less prone to data loss for users who manually edit their metadata after generation, while preventing stale CIDs for all users
Yea, I agree with that and a good move to make it default with this option.
New
--preserve
flag for metadata.py. It will only update CIDs in the metadata.json files that exist. If the json is not valid, it will print out an error, save a backup of the file (add.bak
suffix) and regenerate a new metadata json file