Unverified Commit 9d88979f authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix check for thumbnail object existence

parent a1da80b0
Pipeline #23991 passed with stages
in 4 minutes and 8 seconds
......@@ -201,7 +201,7 @@ class KafkaTopology(private val settings: SettingsLoader) {
}
private fun fetchThumbnailForYoutubeOrVimeoFile(value: Triple<Pair<Model, HeaderMetadata>, List<Resource>, IntermediateReport>): Triple<Pair<Model, HeaderMetadata>, List<Resource>, IntermediateReport> {
val downloadThumbnail = noThumbnailAttached(value.second)
val downloadThumbnail = noThumbnailAttached(value.first.first)
val recordResource = getRecordResource(value.second)
val digitalObjectResource = getDigitalObjectResource(value.second)
if (recordResource != null && digitalObjectResource != null) {
......@@ -322,8 +322,8 @@ class KafkaTopology(private val settings: SettingsLoader) {
return value
}
private fun noThumbnailAttached(resources: List<Resource>): Boolean {
return resources.none { it.hasProperty(RICO.type, Constant.thumbnailRicoType) }
private fun noThumbnailAttached(model: Model): Boolean {
return model.listSubjects().toList().none { it.hasProperty(RICO.type, Constant.thumbnailRicoType) }
}
private fun extractSubjects(input: Pair<Model, HeaderMetadata>): Pair<Pair<Model, HeaderMetadata>, List<Resource>> {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment