From: David ‘Bombe’ Roden Date: Sun, 23 Apr 2017 14:08:53 +0000 (+0200) Subject: Formatting changes X-Git-Tag: 0.9.7^2~244 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=27a0934b7e68315756020e0de0bc2564355be90a;p=Sone.git Formatting changes --- diff --git a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt index f553ae8..ebdae49 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt @@ -19,14 +19,14 @@ import javax.inject.Inject /** * [ElementLoader] implementation that uses a simple Guava [com.google.common.cache.Cache]. */ -class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticker: Ticker) : ElementLoader { +class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticker: Ticker): ElementLoader { - @Inject constructor(freenetInterface: FreenetInterface) : this(freenetInterface, Ticker.systemTicker()) + @Inject constructor(freenetInterface: FreenetInterface): this(freenetInterface, Ticker.systemTicker()) private val loadingLinks: Cache = CacheBuilder.newBuilder().build() private val failureCache: Cache = CacheBuilder.newBuilder().ticker(ticker).expireAfterWrite(30, MINUTES).build() private val elementCache: Cache = CacheBuilder.newBuilder().build() - private val callback = object : FreenetInterface.BackgroundFetchCallback { + 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")) }