Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for setting an initial index on stringify() and stringifySynch() #93

Open
haschdl opened this issue Dec 25, 2023 · 0 comments
Open

Comments

@haschdl
Copy link

haschdl commented Dec 25, 2023

The implementation of both methods include an instance of Formatted , which in turn is instantiated with a default index=1.
This prevents appending to existing file. In order words, stringify() always generates an output starting from 1.
In my use-case, I translate one SRT “A” onto another SRT “B”. Suppose A has 300 entries.
The automatic translation takes a long-time, so I do it in batches, lets say 8 nodes at a time; and sometimes the process fails. Suppose it fails at the 150th node - when the program restarts, I can detect the last index in the output file and continue from there. However stringify() will generate nodes starting from 1, so the output will have nodes 1..,148,149,150,1,2,…

Adding an overload that accepts a starting index would possibly be a solution.

My work-around at the moment: re-write the entire output file after each batch is processed. It’s not a huge performance hit but makes the process more convoluted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant