mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Avoid filename conflicts (not sure if it will be totally fixed). Check if a chapter is properly downloaded after download finishes.
This commit is contained in:
@@ -130,13 +130,13 @@ public final class DiskUtils {
|
||||
try {
|
||||
bufferedSink = Okio.buffer(Okio.sink(writeFile));
|
||||
bufferedSink.writeAll(bufferedSource);
|
||||
bufferedSink.close();
|
||||
} catch (Exception e) {
|
||||
writeFile.delete();
|
||||
throw new IOException("Unable to save image");
|
||||
} finally {
|
||||
if (bufferedSink != null) {
|
||||
bufferedSink.close();
|
||||
}
|
||||
writeFile.delete();
|
||||
throw new IOException("Failed saving image");
|
||||
}
|
||||
|
||||
return writeFile;
|
||||
|
||||
Reference in New Issue
Block a user