Drop support for reencode images

This commit is contained in:
len
2016-10-23 13:22:14 +02:00
parent c1ac47e1ce
commit d7b8015df7
11 changed files with 5 additions and 45 deletions
@@ -7,7 +7,7 @@ import com.google.gson.reflect.TypeToken
import com.jakewharton.disklrucache.DiskLruCache
import eu.kanade.tachiyomi.data.source.model.Page
import eu.kanade.tachiyomi.util.DiskUtils
import eu.kanade.tachiyomi.util.saveImageTo
import eu.kanade.tachiyomi.util.saveTo
import okhttp3.Response
import okio.Okio
import rx.Observable
@@ -185,7 +185,7 @@ class ChapterCache(private val context: Context) {
* @throws IOException image error.
*/
@Throws(IOException::class)
fun putImageToCache(imageUrl: String, response: Response, reencode: Boolean) {
fun putImageToCache(imageUrl: String, response: Response) {
// Initialize editor (edits the values for an entry).
var editor: DiskLruCache.Editor? = null
@@ -195,7 +195,7 @@ class ChapterCache(private val context: Context) {
editor = diskCache.edit(key) ?: throw IOException("Unable to edit key")
// Get OutputStream and write image with Okio.
response.body().source().saveImageTo(editor.newOutputStream(0), reencode)
response.body().source().saveTo(editor.newOutputStream(0))
diskCache.flush()
editor.commit()