Adjusting check

This commit is contained in:
bskjon 2025-04-06 19:14:34 +02:00
parent 374753595c
commit cd821b7e08
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ class ConvertWorkTaskListener: WorkTaskListener() {
} }
val startedWithOperations = events.findFirstEventOf<MediaProcessStartEvent>()?.data?.operations ?: return false val startedWithOperations = events.findFirstEventOf<MediaProcessStartEvent>()?.data?.operations ?: return false
if (startedWithOperations.isOnly(OperationEvents.CONVERT)) { if (startedWithOperations.isOnly(OperationEvents.CONVERT) && shouldIHandleAndProduce) {
return true return true
} }
return shouldIHandleAndProduce return shouldIHandleAndProduce

View File

@ -23,5 +23,5 @@ enum class OperationEvents {
} }
fun List<OperationEvents>.isOnly(expected: OperationEvents): Boolean { fun List<OperationEvents>.isOnly(expected: OperationEvents): Boolean {
return this.size == 1 && this.firstOrNull { it == expected } != null return this.size == 1 && this.all { it == expected }
} }