mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
Remove covers on error. #334
This commit is contained in:
parent
93fc5944f3
commit
59b90a94d0
1 changed files with 8 additions and 3 deletions
|
@ -29,11 +29,16 @@ class MangaDataFetcher(private val networkFetcher: DataFetcher<InputStream>,
|
|||
if (!file.exists()) {
|
||||
file.parentFile.mkdirs()
|
||||
networkFetcher.loadData(priority)?.let {
|
||||
try {
|
||||
it.use { input ->
|
||||
file.outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
file.delete()
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
return FileInputStream(file)
|
||||
|
|
Loading…
Reference in a new issue