mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Remove covers on error. #334
This commit is contained in:
		| @@ -29,10 +29,15 @@ class MangaDataFetcher(private val networkFetcher: DataFetcher<InputStream>, | ||||
|             if (!file.exists()) { | ||||
|                 file.parentFile.mkdirs() | ||||
|                 networkFetcher.loadData(priority)?.let { | ||||
|                     it.use { input -> | ||||
|                         file.outputStream().use { output -> | ||||
|                             input.copyTo(output) | ||||
|                     try { | ||||
|                         it.use { input -> | ||||
|                             file.outputStream().use { output -> | ||||
|                                 input.copyTo(output) | ||||
|                             } | ||||
|                         } | ||||
|                     } catch (e: Exception) { | ||||
|                         file.delete() | ||||
|                         throw e | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user