This commit is contained in:
bskjon 2024-07-18 23:35:53 +02:00
parent a5fc251da7
commit a74e39ed1e
4 changed files with 208 additions and 137 deletions

274
.idea/workspace.xml generated
View File

@ -34,9 +34,11 @@
</loaded-modules> </loaded-modules>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="83cd22eb-7f21-4585-9fdf-9cf3ac59698d" name="Changes" comment="v3 23"> <list default="true" id="83cd22eb-7f21-4585-9fdf-9cf3ac59698d" name="Changes" comment="v3 25">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CompletedTaskListener.kt" beforeDir="false" afterPath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CompletedTaskListener.kt" afterDir="false" /> <change beforePath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/EventsManager.kt" beforeDir="false" afterPath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/EventsManager.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt" beforeDir="false" afterPath="$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt" beforeDir="false" afterPath="$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -136,87 +138,87 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;Gradle.Build MediaProcessing2.executor&quot;: &quot;Run&quot;, "Gradle.Build MediaProcessing2.executor": "Run",
&quot;Gradle.EncodeArgumentCreatorTaskTest.verifyThatEacStreamGetsCorrectArguments.executor&quot;: &quot;Run&quot;, "Gradle.EncodeArgumentCreatorTaskTest.verifyThatEacStreamGetsCorrectArguments.executor": "Run",
&quot;Gradle.EventiApplicationTests.contextLoads.executor&quot;: &quot;Run&quot;, "Gradle.EventiApplicationTests.contextLoads.executor": "Run",
&quot;Gradle.EventiApplicationTests.executor&quot;: &quot;Debug&quot;, "Gradle.EventiApplicationTests.executor": "Debug",
&quot;Gradle.EventiImplementationBase.executor&quot;: &quot;Run&quot;, "Gradle.EventiImplementationBase.executor": "Run",
&quot;Gradle.EventiImplementationBase.validateCoordinatorConstruction.executor&quot;: &quot;Run&quot;, "Gradle.EventiImplementationBase.validateCoordinatorConstruction.executor": "Run",
&quot;Gradle.EventiImplementationBase.validateCreation.executor&quot;: &quot;Run&quot;, "Gradle.EventiImplementationBase.validateCreation.executor": "Run",
&quot;Gradle.FileNameDeterminateTest.serieWithTitleFroMMetadata.executor&quot;: &quot;Run&quot;, "Gradle.FileNameDeterminateTest.serieWithTitleFroMMetadata.executor": "Run",
&quot;Gradle.FileNameParserTest.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.executor": "Run",
&quot;Gradle.FileNameParserTest.findSearchableTitle.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.findSearchableTitle.executor": "Run",
&quot;Gradle.FileNameParserTest.findSearchableTitle2.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.findSearchableTitle2.executor": "Run",
&quot;Gradle.FileNameParserTest.findTitleWithYear.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.findTitleWithYear.executor": "Run",
&quot;Gradle.FileNameParserTest.movieName.executor&quot;: &quot;Debug&quot;, "Gradle.FileNameParserTest.movieName.executor": "Debug",
&quot;Gradle.FileNameParserTest.movieName2.executor&quot;: &quot;Debug&quot;, "Gradle.FileNameParserTest.movieName2.executor": "Debug",
&quot;Gradle.FileNameParserTest.serieName.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.serieName.executor": "Run",
&quot;Gradle.FileNameParserTest.serieNameWithNumbers (1).executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.serieNameWithNumbers (1).executor": "Run",
&quot;Gradle.FileNameParserTest.serieNameWithNumbers.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.serieNameWithNumbers.executor": "Run",
&quot;Gradle.FileNameParserTest.testName.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.testName.executor": "Run",
&quot;Gradle.FileNameParserTest.testParsing.executor&quot;: &quot;Run&quot;, "Gradle.FileNameParserTest.testParsing.executor": "Run",
&quot;Gradle.FirstEventListenerImplTestBase.validate2.executor&quot;: &quot;Debug&quot;, "Gradle.FirstEventListenerImplTestBase.validate2.executor": "Debug",
&quot;Gradle.FirstEventListenerTest.executor&quot;: &quot;Run&quot;, "Gradle.FirstEventListenerTest.executor": "Run",
&quot;Gradle.ForthEventListenerTest.validate1.executor&quot;: &quot;Run&quot;, "Gradle.ForthEventListenerTest.validate1.executor": "Run",
&quot;Gradle.ForthEventListenerTestBase.executor&quot;: &quot;Run&quot;, "Gradle.ForthEventListenerTestBase.executor": "Run",
&quot;Gradle.ForthEventListenerTestBase.validate1.executor&quot;: &quot;Debug&quot;, "Gradle.ForthEventListenerTestBase.validate1.executor": "Debug",
&quot;Gradle.MediaProcessing2 [:apps:processer:bootJar].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [:apps:processer:bootJar].executor": "Run",
&quot;Gradle.MediaProcessing2 [:clean].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [:clean].executor": "Run",
&quot;Gradle.MediaProcessing2 [:shared:build].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [:shared:build].executor": "Run",
&quot;Gradle.MediaProcessing2 [:shared:eventi:compileKotlin].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [:shared:eventi:compileKotlin].executor": "Run",
&quot;Gradle.MediaProcessing2 [apps:build].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [apps:build].executor": "Run",
&quot;Gradle.MediaProcessing2 [build].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [build].executor": "Run",
&quot;Gradle.MediaProcessing2 [clean install].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [clean install].executor": "Run",
&quot;Gradle.MediaProcessing2 [clean].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2 [clean].executor": "Run",
&quot;Gradle.MediaProcessing2:apps:processer [bootJar].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2:apps:processer [bootJar].executor": "Run",
&quot;Gradle.MediaProcessing2:shared [assemble].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2:shared [assemble].executor": "Run",
&quot;Gradle.MediaProcessing2:shared [build].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2:shared [build].executor": "Run",
&quot;Gradle.MediaProcessing2:shared:eventi [build].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2:shared:eventi [build].executor": "Run",
&quot;Gradle.MediaProcessing2:shared:eventi [clean].executor&quot;: &quot;Run&quot;, "Gradle.MediaProcessing2:shared:eventi [clean].executor": "Run",
&quot;Gradle.MetadataAndBaseInfoToFileOutTest.testVideoData.executor&quot;: &quot;Debug&quot;, "Gradle.MetadataAndBaseInfoToFileOutTest.testVideoData.executor": "Debug",
&quot;Gradle.PersistentEventMangerTest.executor&quot;: &quot;Run&quot;, "Gradle.PersistentEventMangerTest.executor": "Run",
&quot;Gradle.PersistentEventMangerTest.testConvertBatchFromExtract.executor&quot;: &quot;Run&quot;, "Gradle.PersistentEventMangerTest.testConvertBatchFromExtract.executor": "Run",
&quot;Gradle.PersistentEventMangerTest.testSomeAreSingleSomeAreNot.executor&quot;: &quot;Run&quot;, "Gradle.PersistentEventMangerTest.testSomeAreSingleSomeAreNot.executor": "Run",
&quot;Gradle.PersistentEventMangerTest.testSupersededButKeepWork.executor&quot;: &quot;Run&quot;, "Gradle.PersistentEventMangerTest.testSupersededButKeepWork.executor": "Run",
&quot;Gradle.PersistentEventMangerTest.testSupersededWork.executor&quot;: &quot;Run&quot;, "Gradle.PersistentEventMangerTest.testSupersededWork.executor": "Run",
&quot;Gradle.SecondEventListenerTest.executor&quot;: &quot;Run&quot;, "Gradle.SecondEventListenerTest.executor": "Run",
&quot;Gradle.SecondEventListenerTest.validate1.executor&quot;: &quot;Run&quot;, "Gradle.SecondEventListenerTest.validate1.executor": "Run",
&quot;Gradle.SecondEventListenerTestBase.validate1.executor&quot;: &quot;Debug&quot;, "Gradle.SecondEventListenerTestBase.validate1.executor": "Debug",
&quot;Gradle.Tests in 'MediaProcessing.apps.coordinator'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'MediaProcessing.apps.coordinator'.executor": "Run",
&quot;Gradle.Tests in 'MediaProcessing.apps.processer'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'MediaProcessing.apps.processer'.executor": "Run",
&quot;Gradle.Tests in 'MediaProcessing.shared.common.test'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'MediaProcessing.shared.common.test'.executor": "Run",
&quot;Gradle.Tests in 'MediaProcessing.shared.eventi'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'MediaProcessing.shared.eventi'.executor": "Run",
&quot;Gradle.Tests in 'MediaProcessing.shared.eventi.test'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'MediaProcessing.shared.eventi.test'.executor": "Run",
&quot;Gradle.Tests in 'no.iktdev.eventi'.executor&quot;: &quot;Run&quot;, "Gradle.Tests in 'no.iktdev.eventi'.executor": "Run",
&quot;Gradle.ThirdEventListenerTest.validate1.executor&quot;: &quot;Run&quot;, "Gradle.ThirdEventListenerTest.validate1.executor": "Run",
&quot;Gradle.ThirdEventListenerTestBase.validate1.executor&quot;: &quot;Run&quot;, "Gradle.ThirdEventListenerTestBase.validate1.executor": "Run",
&quot;Gradle.ThridEventListenerTest.executor&quot;: &quot;Run&quot;, "Gradle.ThridEventListenerTest.executor": "Run",
&quot;Gradle.ThridEventListenerTest.validate1.executor&quot;: &quot;Debug&quot;, "Gradle.ThridEventListenerTest.validate1.executor": "Debug",
&quot;Gradle.ThridEventListenerTest.validate2.executor&quot;: &quot;Debug&quot;, "Gradle.ThridEventListenerTest.validate2.executor": "Debug",
&quot;JUnit.All in MediaProcessing.executor&quot;: &quot;Run&quot;, "JUnit.All in MediaProcessing.executor": "Run",
&quot;Kotlin.ConverterApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.ConverterApplicationKt.executor": "Run",
&quot;Kotlin.CoordinatorApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.CoordinatorApplicationKt.executor": "Run",
&quot;Kotlin.Env - CoordinatorApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.Env - CoordinatorApplicationKt.executor": "Debug",
&quot;Kotlin.EventiApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.EventiApplicationKt.executor": "Run",
&quot;Kotlin.ProcesserApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.ProcesserApplicationKt.executor": "Run",
&quot;Kotlin.UIApplicationKt.executor&quot;: &quot;Run&quot;, "Kotlin.UIApplicationKt.executor": "Run",
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;, "SHARE_PROJECT_CONFIGURATION_FILES": "true",
&quot;ShowUsagesActions.previewPropertyKey&quot;: &quot;true&quot;, "ShowUsagesActions.previewPropertyKey": "true",
&quot;com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary&quot;: &quot;JUnit5&quot;, "com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary": "JUnit5",
&quot;com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit5&quot;: &quot;&quot;, "com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit5": "",
&quot;git-widget-placeholder&quot;: &quot;v3&quot;, "git-widget-placeholder": "v3",
&quot;jdk.selected.JAVA_MODULE&quot;: &quot;azul-17&quot;, "jdk.selected.JAVA_MODULE": "azul-17",
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;, "kotlin-language-version-configured": "true",
&quot;last_opened_file_path&quot;: &quot;D:/Workspace/MediaProcessing2/shared/eventi&quot;, "last_opened_file_path": "D:/Workspace/MediaProcessing2/shared/eventi",
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;, "project.structure.last.edited": "Modules",
&quot;project.structure.proportion&quot;: &quot;0.15&quot;, "project.structure.proportion": "0.15",
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot; "project.structure.side.proportion": "0.2"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="D:\Workspace\MediaProcessing2\shared\contract\src\main\kotlin\no\iktdev\mediaprocessing\shared\contract\data" /> <recent name="D:\Workspace\MediaProcessing2\shared\contract\src\main\kotlin\no\iktdev\mediaprocessing\shared\contract\data" />
@ -269,7 +271,7 @@
<command value="gradle :clean" /> <command value="gradle :clean" />
</option> </option>
</component> </component>
<component name="RunManager" selected="JUnit.All in MediaProcessing"> <component name="RunManager" selected="Kotlin.Env - CoordinatorApplicationKt">
<configuration name="MediaProcessing2 [:clean]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true"> <configuration name="MediaProcessing2 [:clean]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings> <ExternalSystemSettings>
<option name="executionName" /> <option name="executionName" />
@ -370,16 +372,16 @@
<envs> <envs>
<env name="DATABASE_ADDRESS" value="192.168.2.250" /> <env name="DATABASE_ADDRESS" value="192.168.2.250" />
<env name="DATABASE_NAME_E" value="eventsV3" /> <env name="DATABASE_NAME_E" value="eventsV3" />
<env name="DATABASE_NAME_S" value="streamitDev3" /> <env name="DATABASE_NAME_S" value="streamit" />
<env name="DATABASE_PASSWORD" value="shFZ27eL2x2NoxyEDBMfDWkvFO" /> <env name="DATABASE_PASSWORD" value="shFZ27eL2x2NoxyEDBMfDWkvFO" />
<env name="DATABASE_PORT" value="3306" /> <env name="DATABASE_PORT" value="3306" />
<env name="DATABASE_USERNAME" value="root" /> <env name="DATABASE_USERNAME" value="root" />
<env name="DIRECTORY_CONTENT_INCOMING" value="G:\MediaProcessingPlayground\input" /> <env name="DIRECTORY_CONTENT_INCOMING" value="G:\MediaProcessingPlayground\input" />
<env name="DIRECTORY_CONTENT_OUTGOING" value="G:\MediaProcessingPlayground\output" /> <env name="DIRECTORY_CONTENT_OUTGOING" value="G:\MediaProcessingPlayground\output" />
<env name="DISABLE_COMPLETE" value="true" />
<env name="METADATA_TIMEOUT" value="0" /> <env name="METADATA_TIMEOUT" value="0" />
<env name="SUPPORTING_EXECUTABLE_FFMPEG" value="G:\MediaProcessingPlayground\ffmpeg.exe" /> <env name="SUPPORTING_EXECUTABLE_FFMPEG" value="G:\MediaProcessingPlayground\ffmpeg.exe" />
<env name="SUPPORTING_EXECUTABLE_FFPROBE" value="G:\MediaProcessingPlayground\ffprobe.exe" /> <env name="SUPPORTING_EXECUTABLE_FFPROBE" value="G:\MediaProcessingPlayground\ffprobe.exe" />
<env name="DISABLE_COMPLETE" value="true" />
</envs> </envs>
<option name="MAIN_CLASS_NAME" value="no.iktdev.mediaprocessing.coordinator.CoordinatorApplicationKt" /> <option name="MAIN_CLASS_NAME" value="no.iktdev.mediaprocessing.coordinator.CoordinatorApplicationKt" />
<module name="MediaProcessing.apps.coordinator.main" /> <module name="MediaProcessing.apps.coordinator.main" />
@ -415,20 +417,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1712771068889</updated> <updated>1712771068889</updated>
</task> </task>
<task id="LOCAL00139" summary="Version">
<option name="closed" value="true" />
<created>1719706352452</created>
<option name="number" value="LOCAL00139" />
<option name="presentableId" value="LOCAL00139" />
<updated>1719706352452</updated>
</task>
<task id="LOCAL00140" summary="Table">
<option name="closed" value="true" />
<created>1719708288857</created>
<option name="number" value="LOCAL00140" />
<option name="presentableId" value="LOCAL00140" />
<updated>1719708288857</updated>
</task>
<task id="LOCAL00141" summary="Fix"> <task id="LOCAL00141" summary="Fix">
<option name="closed" value="true" /> <option name="closed" value="true" />
<created>1719738757568</created> <created>1719738757568</created>
@ -758,7 +746,21 @@
<option name="presentableId" value="LOCAL00187" /> <option name="presentableId" value="LOCAL00187" />
<updated>1721320748899</updated> <updated>1721320748899</updated>
</task> </task>
<option name="localTasksCounter" value="188" /> <task id="LOCAL00188" summary="v3 24">
<option name="closed" value="true" />
<created>1721321619065</created>
<option name="number" value="LOCAL00188" />
<option name="presentableId" value="LOCAL00188" />
<updated>1721321619065</updated>
</task>
<task id="LOCAL00189" summary="v3 25">
<option name="closed" value="true" />
<created>1721329940691</created>
<option name="number" value="LOCAL00189" />
<option name="presentableId" value="LOCAL00189" />
<updated>1721329940691</updated>
</task>
<option name="localTasksCounter" value="190" />
<servers /> <servers />
</component> </component>
<component name="UnloadedModulesList"> <component name="UnloadedModulesList">
@ -778,8 +780,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="V3 - Moved to database polling" />
<MESSAGE value="v3 - db polling for pyMetadata" />
<MESSAGE value="v3" /> <MESSAGE value="v3" />
<MESSAGE value="v3 2" /> <MESSAGE value="v3 2" />
<MESSAGE value="v3 3" /> <MESSAGE value="v3 3" />
@ -803,7 +803,9 @@
<MESSAGE value="v3 21" /> <MESSAGE value="v3 21" />
<MESSAGE value="v3 22" /> <MESSAGE value="v3 22" />
<MESSAGE value="v3 23" /> <MESSAGE value="v3 23" />
<option name="LAST_COMMIT_MESSAGE" value="v3 23" /> <MESSAGE value="v3 24" />
<MESSAGE value="v3 25" />
<option name="LAST_COMMIT_MESSAGE" value="v3 25" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
@ -1004,14 +1006,6 @@
<line>73</line> <line>73</line>
<option name="timeStamp" value="275" /> <option name="timeStamp" value="275" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt</url>
<line>67</line>
<properties>
<option name="lambda-ordinal" value="-1" />
</properties>
<option name="timeStamp" value="288" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line"> <line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/ReadMediaFileStreamsTaskListener.kt</url> <url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/ReadMediaFileStreamsTaskListener.kt</url>
<line>44</line> <line>44</line>
@ -1063,7 +1057,7 @@
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line"> <line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url> <url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>40</line> <line>43</line>
<option name="timeStamp" value="334" /> <option name="timeStamp" value="334" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line"> <line-breakpoint enabled="true" type="kotlin-line">
@ -1084,6 +1078,62 @@
</properties> </properties>
<option name="timeStamp" value="346" /> <option name="timeStamp" value="346" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/build.gradle.kts</url>
<line>85</line>
<option name="timeStamp" value="347" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>46</line>
<option name="timeStamp" value="349" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>53</line>
<option name="timeStamp" value="350" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>59</line>
<option name="timeStamp" value="351" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>64</line>
<option name="timeStamp" value="352" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>88</line>
<option name="timeStamp" value="353" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt</url>
<line>47</line>
<properties>
<option name="lambda-ordinal" value="-1" />
</properties>
<option name="timeStamp" value="356" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt</url>
<line>64</line>
<properties>
<option name="lambda-ordinal" value="-1" />
</properties>
<option name="timeStamp" value="358" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/shared/eventi/src/main/kotlin/no/iktdev/eventi/implementations/EventCoordinator.kt</url>
<line>54</line>
<option name="timeStamp" value="359" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/apps/coordinator/src/main/kotlin/no/iktdev/mediaprocessing/coordinator/tasksV2/listeners/CoverFromMetadataTaskListener.kt</url>
<line>35</line>
<option name="timeStamp" value="360" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>

View File

@ -93,7 +93,7 @@ class EventsManager(dataSource: DataSource) : EventsManagerContract(dataSource)
return no.iktdev.eventi.database.withTransaction(dataSource.database) { return no.iktdev.eventi.database.withTransaction(dataSource.database) {
events.selectAll() events.selectAll()
.groupBy { it[events.referenceId] } .groupBy { it[events.referenceId] }
.mapNotNull { it.value.mapNotNull { v -> v.toEvent() } } .mapNotNull { it.value.mapNotNull { v -> v.toEvent() } }.filter { it.none { e -> e.eventType == Events.EventMediaProcessCompleted } }
} ?: emptyList() } ?: emptyList()
} }

View File

@ -33,8 +33,11 @@ class CoverFromMetadataTaskListener: CoordinatorEventListener() {
} }
override fun shouldIProcessAndHandleEvent(incomingEvent: Event, events: List<Event>): Boolean { override fun shouldIProcessAndHandleEvent(incomingEvent: Event, events: List<Event>): Boolean {
return super.shouldIProcessAndHandleEvent(incomingEvent, events) && incomingEvent.eventType in listensForEvents val state = super.shouldIProcessAndHandleEvent(incomingEvent, events)
if (!state) {
return false
}
return incomingEvent.eventType in listensForEvents
} }
override fun onEventsReceived(incomingEvent: ConsumableEvent<Event>, events: List<Event>) { override fun onEventsReceived(incomingEvent: ConsumableEvent<Event>, events: List<Event>) {

View File

@ -33,41 +33,59 @@ abstract class EventCoordinator<T : EventImpl, E : EventsManagerImpl<T>> {
} }
var taskMode: ActiveMode = ActiveMode.Active open var taskMode: ActiveMode = ActiveMode.Active
private val referencePool: MutableMap<String, Deferred<Boolean>> = mutableMapOf()
private fun referencePoolIsReadyForEvents(): Boolean {
return (referencePool.isEmpty() || referencePool.any { !it.value.isActive })
}
private var newEventProduced: Boolean = false private var newEventProduced: Boolean = false
private fun onEventsReceived(events: List<T>) = runBlocking {
private fun onEventGroupsReceived(eventGroup: List<List<T>>) {
val activePolls = referencePool.values.filter { it.isActive }.size
log.info { "Active polls $activePolls/${referencePool.values.size}" }
eventGroup.forEach {
val referenceId = it.first().referenceId()
val isAvailable = if (referenceId in referencePool.keys) {
referencePool[referenceId]?.isActive != true
} else true
if (isAvailable) {
referencePool[referenceId] = coroutine.async {
onEventsReceived(it)
}
}
}
}
private suspend fun onEventsReceived(events: List<T>): Boolean = coroutineScope {
val listeners = getListeners() val listeners = getListeners()
launch {
events.forEach { event -> events.forEach { event ->
listeners.forEach { listener -> listeners.forEach { listener ->
if (listener.shouldIProcessAndHandleEvent(event, events)) { if (listener.shouldIProcessAndHandleEvent(event, events)) {
val consumableEvent = ConsumableEvent(event) val consumableEvent = ConsumableEvent(event)
listener.onEventsReceived(consumableEvent, events) listener.onEventsReceived(consumableEvent, events)
if (consumableEvent.isConsumed) { if (consumableEvent.isConsumed) {
log.info { "Consumption detected for ${listener::class.java.simpleName} on event ${event.eventType}" } log.info { "Consumption detected for ${events.first().referenceId()} -> ${listener::class.java.simpleName} on event ${event.eventType}" }
return@launch return@coroutineScope true
} }
} }
} }
} }
log.debug { "No consumption detected for ${events.first().referenceId()}" } log.debug { "No consumption detected for ${events.first().referenceId()}" }
false
}
} }
private var newEventsProducedOnReferenceId: AtomicReference<List<String>> = AtomicReference(emptyList()) private var newEventsProducedOnReferenceId: AtomicReference<List<String>> = AtomicReference(emptyList())
private fun pullForEvents() { private fun pullForEvents() {
coroutine.launch { coroutine.launch {
while (taskMode == ActiveMode.Active) { while (taskMode == ActiveMode.Active) {
if (referencePoolIsReadyForEvents()) {
log.debug { "New pull on database" } log.debug { "New pull on database" }
val events = eventManager?.readAvailableEvents() val events = eventManager.readAvailableEvents()
if (events == null) { onEventGroupsReceived(events)
log.warn { "EventManager is not loaded!" }
} else {
events.forEach { group ->
onEventsReceived(group)
}
} }
waitForConditionOrTimeout(pullDelay.get()) { newEventProduced }.also { waitForConditionOrTimeout(pullDelay.get()) { newEventProduced }.also {
newEventProduced = false newEventProduced = false