Aligning with exposed 0.61

This commit is contained in:
Brage Skjønborg 2025-10-19 03:49:31 +02:00
parent 931e60c301
commit 9b0b0766aa
3 changed files with 7 additions and 6 deletions

View File

@ -22,7 +22,7 @@ repositories {
} }
val exposedVersion = "0.44.0" val exposedVersion = "0.61.0"
dependencies { dependencies {
/*Spring boot*/ /*Spring boot*/

View File

@ -20,7 +20,7 @@ object ContentCatalogStore {
*/ */
fun getCollectionByTitleAndType(type: String, titles: List<String>): String? { fun getCollectionByTitleAndType(type: String, titles: List<String>): String? {
return withTransaction(getStoreDatabase()) { return withTransaction(getStoreDatabase()) {
CatalogTable.select { CatalogTable.selectAll().where {
(CatalogTable.type eq type) and (CatalogTable.type eq type) and
((CatalogTable.title inList titles) or ((CatalogTable.title inList titles) or
(CatalogTable.collection inList titles)) (CatalogTable.collection inList titles))
@ -32,7 +32,7 @@ object ContentCatalogStore {
private fun getCover(collection: String, type: String): String? { private fun getCover(collection: String, type: String): String? {
return withTransaction(getStoreDatabase()) { return withTransaction(getStoreDatabase()) {
CatalogTable.select { CatalogTable.selectAll().where {
(CatalogTable.collection eq collection) and (CatalogTable.collection eq collection) and
(CatalogTable.type eq type) (CatalogTable.type eq type)
}.map { it[CatalogTable.cover] }.firstOrNull() }.map { it[CatalogTable.cover] }.firstOrNull()
@ -41,7 +41,7 @@ object ContentCatalogStore {
fun storeCatalog(title: String, titles: List<String>, collection: String, type: String, cover: String?, genres: String?): Int? { fun storeCatalog(title: String, titles: List<String>, collection: String, type: String, cover: String?, genres: String?): Int? {
val status = executeWithStatus(getStoreDatabase().database, run = { val status = executeWithStatus(getStoreDatabase().database, run = {
val existingRow = CatalogTable.select { val existingRow = CatalogTable.selectAll().where {
(CatalogTable.collection eq collection) and (CatalogTable.collection eq collection) and
(CatalogTable.type eq type) (CatalogTable.type eq type)
}.firstOrNull() }.firstOrNull()
@ -157,7 +157,7 @@ object ContentCatalogStore {
private fun getId(title: String, titles: List<String>, collection: String, type: String): Int? { private fun getId(title: String, titles: List<String>, collection: String, type: String): Int? {
val ids = withTransaction(getStoreDatabase().database) { val ids = withTransaction(getStoreDatabase().database) {
CatalogTable.select { CatalogTable.selectAll().where {
((CatalogTable.title eq title) ((CatalogTable.title eq title)
or (CatalogTable.collection eq collection) or (CatalogTable.collection eq collection)
or (CatalogTable.title inList titles)) and or (CatalogTable.title inList titles)) and

View File

@ -7,6 +7,7 @@ import no.iktdev.streamit.library.db.withTransaction
import org.jetbrains.exposed.sql.insertIgnore import org.jetbrains.exposed.sql.insertIgnore
import org.jetbrains.exposed.sql.or import org.jetbrains.exposed.sql.or
import org.jetbrains.exposed.sql.select import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.selectAll
object ContentTitleStore { object ContentTitleStore {
@ -31,7 +32,7 @@ object ContentTitleStore {
fun findMasterTitles(titleList: List<String>): List<String> { fun findMasterTitles(titleList: List<String>): List<String> {
return withTransaction(getStoreDatabase().database, run = { return withTransaction(getStoreDatabase().database, run = {
TitleTable.select { TitleTable.selectAll().where {
(TitleTable.alternativeTitle inList titleList) or (TitleTable.alternativeTitle inList titleList) or
(TitleTable.masterTitle inList titleList) (TitleTable.masterTitle inList titleList)
}.map { }.map {