mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
12
src/util.cr
12
src/util.cr
@@ -81,3 +81,15 @@ end
|
||||
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
|
||||
file.close
|
||||
return
|
||||
rescue e
|
||||
e
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user