Add optional arg to use a temporary directory when converting files #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey y'all! I have a use-case where I want to automate some steps that happen after epub -> audio conversion is completed for the entire book. I can imagine other users would have similar use cases (e.g. move completed audiobook to remote location, manually trigger a scan on Audiobookshelf to import the audiobook immediately, or generally run any post-processing on the completed audiobook).
Why this method?
Mainly because it seemed like the easiest and most versatile. Using a temporary directory when converting the files, and then moving them all at once to a final output directory allows users to choose how to trigger/act on the final output. Now users can watch the output directory and wait for any files to be there (instead of before, when they would have to figure out a way to know how many files would be produced and then wait for all files in the book to be there before beginning post-processing).
High-Level Changes
--use_temp_dir
flagtmp
directory.tmp
directory and all its files are removed.tmp
is in the working directory. This is not configurable. (I originally made it configurable, but then decided this wasn't useful and removed it)(I did not include any updates noting this change in the README. Happy to do so, or let the maintainers update as they desire.)