Add RAR/CBR support

This commit is contained in:
Alex Ling
2020-05-29 13:45:25 +00:00
parent 8665616c2e
commit 6b43ee7fe5
6 changed files with 77 additions and 24 deletions

View File

@@ -85,12 +85,8 @@ def compare_alphanumerically(a : String, b : String)
compare_alphanumerically split_by_alphanumeric(a), split_by_alphanumeric(b)
end
# When downloading from MangaDex, the zip/cbz file would not be valid
# before the download is completed. If we scan the zip file,
# Entry.new would throw, so we use this method to check before
# constructing Entry
def validate_zip(path : String) : Exception?
file = Zip::File.new path
def validate_archive(path : String) : Exception?
file = ArchiveFile.new path
file.close
return
rescue e