Closed raphaeleidus closed 3 months ago
alternative suggestion... before writing the file, try to parse what numbers are in use... but this is also really challenging, as if a use has provided a tapeNameGenerator
function that changes how they are named from unnamed-<tapeNumber>.json5
to something like <tapeNumber>-unnamed.json5
the parsing wont see it.
Theoretically, we could have talkback call the tapeNameGenerator
then check if there is already a file in that location and if there is, increment the tapeCount by 1 and call it again... and repeat... this is probably the safest approach that wont cause a change in the API
Addressed in 4.1.0 (CHANGELOG)
so by default the tapes get named
unnamed-<number>.json5
if you have a few tapes and you haven't manually renamed them and you delete one from the middle. example:the default numbering will calculate that there are currently 3 tapes and the next tape should be saved at
unnamed-4.json5
which will overwrite the previous tape.Suggestion, switch to a different naming convention that is resilient to this... I will submit a PR shortly, it will likely mean a breaking change to the signature of the
tapeNameGenerator
function.