Storing processed files

This commit is contained in:
bskjon 2025-02-02 16:38:35 +01:00
parent 4638560c30
commit afa0900755
3 changed files with 14 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class ReadMediaFileStreamsTaskListener() : CoordinatorEventListener() {
val joined = result.output.joinToString(" ")
Gson().fromJson(joined, JsonObject::class.java)
} else {
val message = "File in data is not a file or does not exist".also {
val message = "File in data is not a file or does not exist: ${file.absolutePath}".also {
log.error { it }
}
throw RuntimeException(message)

View File

@ -1,7 +1,6 @@
package no.iktdev.mediaprocessing.shared.common.contract.data
import no.iktdev.eventi.data.EventImpl
import no.iktdev.eventi.data.EventMetadata
import no.iktdev.mediaprocessing.shared.common.contract.Events
abstract class Event: EventImpl() {
@ -14,3 +13,14 @@ inline fun <reified T: Event> Event.az(): T? {
null
} else this
}
inline fun <reified T: Event> List<Event>.findFirstEventOf(): T? {
val first = this.firstOrNull { it is T }
return if (first != null) {
first as T
} else null
}
inline fun <reified T: Event> List<Event>.findEventsOf(): List<T> {
return this.filterIsInstance<T>().map { it }
}

View File

@ -9,7 +9,9 @@ import org.jetbrains.exposed.sql.javatime.datetime
import java.time.LocalDateTime
object processed: IntIdTable() {
val title: Column<String> = varchar("title", 256)
val fileName: Column<String> = varchar("fileName", 256)
val processedFiles: Column<String> = text("processedFilesJson")
val encoded: Column<Boolean> = bool("encoded").default(false)
val extracted: Column<Boolean> = bool("extracted").default(false)
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime)