Storing processed files
This commit is contained in:
parent
4638560c30
commit
afa0900755
@ -86,7 +86,7 @@ class ReadMediaFileStreamsTaskListener() : CoordinatorEventListener() {
|
|||||||
val joined = result.output.joinToString(" ")
|
val joined = result.output.joinToString(" ")
|
||||||
Gson().fromJson(joined, JsonObject::class.java)
|
Gson().fromJson(joined, JsonObject::class.java)
|
||||||
} else {
|
} 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 }
|
log.error { it }
|
||||||
}
|
}
|
||||||
throw RuntimeException(message)
|
throw RuntimeException(message)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package no.iktdev.mediaprocessing.shared.common.contract.data
|
package no.iktdev.mediaprocessing.shared.common.contract.data
|
||||||
|
|
||||||
import no.iktdev.eventi.data.EventImpl
|
import no.iktdev.eventi.data.EventImpl
|
||||||
import no.iktdev.eventi.data.EventMetadata
|
|
||||||
import no.iktdev.mediaprocessing.shared.common.contract.Events
|
import no.iktdev.mediaprocessing.shared.common.contract.Events
|
||||||
|
|
||||||
abstract class Event: EventImpl() {
|
abstract class Event: EventImpl() {
|
||||||
@ -14,3 +13,14 @@ inline fun <reified T: Event> Event.az(): T? {
|
|||||||
null
|
null
|
||||||
} else this
|
} 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 }
|
||||||
|
}
|
||||||
@ -9,7 +9,9 @@ import org.jetbrains.exposed.sql.javatime.datetime
|
|||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
object processed: IntIdTable() {
|
object processed: IntIdTable() {
|
||||||
|
val title: Column<String> = varchar("title", 256)
|
||||||
val fileName: Column<String> = varchar("fileName", 256)
|
val fileName: Column<String> = varchar("fileName", 256)
|
||||||
|
val processedFiles: Column<String> = text("processedFilesJson")
|
||||||
val encoded: Column<Boolean> = bool("encoded").default(false)
|
val encoded: Column<Boolean> = bool("encoded").default(false)
|
||||||
val extracted: Column<Boolean> = bool("extracted").default(false)
|
val extracted: Column<Boolean> = bool("extracted").default(false)
|
||||||
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime)
|
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user