X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FDefaultElementLoader.kt;h=3c0e77ce7c76d8a65a39814171260f47b48aae97;hp=ebdae49b4b9c22d57b455c96f0bc15ff4c36157e;hb=992404e5183f824e478d6f2273d7998d48ceeea5;hpb=515e174cfbc642648fc0295ce4a8718041582b5b diff --git a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt index ebdae49..3c0e77c 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt @@ -39,7 +39,7 @@ class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticke ImageIO.read(it) }?.let { elementCache.get(uri.toString().decode().normalize()) { - LinkedElement(uri.toString(), properties = mapOf("size" to data.size, "sizeHuman" to data.size.human)) + LinkedElement(uri.toString(), properties = mapOf("type" to "image", "size" to data.size, "sizeHuman" to data.size.human)) } } } @@ -47,7 +47,7 @@ class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticke val document = Jsoup.parse(data.toString(Charset.forName(mimeType.getParameter("charset") ?: "UTF-8"))) elementCache.get(uri.toString().decode().normalize()) { LinkedElement(uri.toString(), properties = mapOf( - "size" to data.size, "sizeHuman" to data.size.human, + "type" to "html", "size" to data.size, "sizeHuman" to data.size.human, "title" to document.title().emptyToNull, "description" to (document.metaDescription ?: document.firstNonHeadingParagraph) ))