diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt index d05be3cb..a145e8b3 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt @@ -98,6 +98,7 @@ public class CacheExporter @Inject constructor( public data class Cache( val id: Int, val sources: List, + val updates: List, val stats: Stats?, val masterIndex: Js5MasterIndex ) @@ -284,7 +285,25 @@ public class CacheExporter @Inject constructor( } } - Cache(id, sources, stats, masterIndex) + val updates = mutableListOf() + + connection.prepareStatement( + """ + SELECT url + FROM updates + WHERE master_index_id = ? + """.trimIndent() + ).use { stmt -> + stmt.setInt(1, id) + + stmt.executeQuery().use { rows -> + while (rows.next()) { + updates += rows.getString(1) + } + } + } + + Cache(id, sources, updates, stats, masterIndex) } } diff --git a/archive/src/main/resources/org/openrs2/archive/migrations/V4__updates.sql b/archive/src/main/resources/org/openrs2/archive/migrations/V4__updates.sql new file mode 100644 index 00000000..2b0bf7df --- /dev/null +++ b/archive/src/main/resources/org/openrs2/archive/migrations/V4__updates.sql @@ -0,0 +1,7 @@ +-- @formatter:off +CREATE TABLE updates ( + master_index_id INTEGER NOT NULL REFERENCES master_indexes (id), + url TEXT NOT NULL, + PRIMARY KEY (master_index_id, url) +); +-- @formatter:on diff --git a/archive/src/main/resources/org/openrs2/archive/templates/caches/show.html b/archive/src/main/resources/org/openrs2/archive/templates/caches/show.html index d771fcf1..2a616469 100644 --- a/archive/src/main/resources/org/openrs2/archive/templates/caches/show.html +++ b/archive/src/main/resources/org/openrs2/archive/templates/caches/show.html @@ -69,6 +69,15 @@ + + Update(s) + + + https://www.example.com/ +
+
+ +

Sources