Move to node-unrar-js for cbr and node-stream-zip for cbz #3435
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.
This is a continuation of PR #3422, and more comprehensively fixes #3406, fixes #3399, and fixes #2526.
I looked for a replacement for libarchive for extraction from cbr (rar) files. I found node-unrar-js which seems to work similarly to libarchive (with the extraction algorithm implemented in a wasm module), and which seems to work well on a few files that libarchive failed on, and additionally doesn't require loading the full cbr into a buffer. The npm package is minimal and has 0 dependencies.
Additionally, I moved from libarchive to our existing libs/nodeStreamZip implementation for cbz files.
The old libarchive implementation as well as the new implementations are all wrapped with the same interface, and parseComicMetadata was modified to use that interface.
I'm temporarily keeping the libarchive implementation so that we can move back to it in case we have any serious issues with the new implementations. Will remove it in a couple of weeks.