🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / core / DefaultElementLoader.kt
index 3c0e77c..409d18c 100644 (file)
@@ -23,16 +23,16 @@ class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticke
 
        @Inject constructor(freenetInterface: FreenetInterface): this(freenetInterface, Ticker.systemTicker())
 
-       private val loadingLinks: Cache<String, Boolean> = CacheBuilder.newBuilder().build<String, Boolean>()
-       private val failureCache: Cache<String, Boolean> = CacheBuilder.newBuilder().ticker(ticker).expireAfterWrite(30, MINUTES).build<String, Boolean>()
-       private val elementCache: Cache<String, LinkedElement> = CacheBuilder.newBuilder().build<String, LinkedElement>()
+       private val loadingLinks: Cache<String, Boolean> = CacheBuilder.newBuilder().build()
+       private val failureCache: Cache<String, Boolean> = CacheBuilder.newBuilder().ticker(ticker).expireAfterWrite(30, MINUTES).build()
+       private val elementCache: Cache<String, LinkedElement> = CacheBuilder.newBuilder().build()
        private val callback = object: FreenetInterface.BackgroundFetchCallback {
                override fun shouldCancel(uri: FreenetURI, mimeType: String, size: Long): Boolean {
                        return (size > 2097152) || (!mimeType.startsWith("image/") && !mimeType.startsWith("text/html"))
                }
 
-               override fun loaded(uri: FreenetURI, mimeType: String, data: ByteArray) {
-                       MimeType(mimeType).also { mimeType ->
+               override fun loaded(uri: FreenetURI, mimeTypeText: String, data: ByteArray) {
+                       MimeType(mimeTypeText).also { mimeType ->
                                when {
                                        mimeType.primaryType == "image" -> {
                                                ByteArrayInputStream(data).use {