Skip to content

Commit

Permalink
fix: input gateway devices lose rundown actions on reset SOFIE-3134 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed May 24, 2024
1 parent d1a593c commit aa69e5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
14 changes: 5 additions & 9 deletions meteor/server/api/deviceTriggers/RundownContentObserver.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Meteor } from 'meteor/meteor'
import {
RundownId,
RundownPlaylistActivationId,
RundownPlaylistId,
ShowStyleBaseId,
} from '@sofie-automation/corelib/dist/dataModel/Ids'
import { RundownId, RundownPlaylistId, ShowStyleBaseId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import {
PartInstances,
Parts,
Expand Down Expand Up @@ -44,10 +39,9 @@ export class RundownContentObserver {
rundownPlaylistId: RundownPlaylistId,
showStyleBaseId: ShowStyleBaseId,
rundownIds: RundownId[],
activationId: RundownPlaylistActivationId,
onChanged: ChangedHandler
) {
logger.silly(`Creating RundownContentObserver for playlist "${rundownPlaylistId}" activation "${activationId}"`)
logger.silly(`Creating RundownContentObserver for playlist "${rundownPlaylistId}"`)
const { cache, cancel: cancelCache } = createReactiveContentCache(() => {
this.#cleanup = onChanged(cache)
if (this.#disposed) this.#cleanup()
Expand Down Expand Up @@ -93,7 +87,9 @@ export class RundownContentObserver {
),
PartInstances.observe(
{
playlistActivationId: activationId,
rundownId: {
$in: rundownIds,
},
reset: {
$ne: true,
},
Expand Down
19 changes: 6 additions & 13 deletions meteor/server/api/deviceTriggers/StudioObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,19 @@ export class StudioObserver extends EventEmitter {
this.#rundownsLiveQuery = undefined

const activePlaylistId = this.activePlaylistId
const activationId = this.activationId
this.showStyleBaseId = showStyleBaseId

let cleanupChanges: (() => void) | undefined = undefined

this.#rundownsLiveQuery = new RundownsObserver(activePlaylistId, (rundownIds) => {
logger.silly(`Creating new RundownContentObserver`)
const obs1 = new RundownContentObserver(
activePlaylistId,
showStyleBaseId,
rundownIds,
activationId,
(cache) => {
cleanupChanges = this.#changed(showStyleBaseId, cache)

return () => {
void 0
}
const obs1 = new RundownContentObserver(activePlaylistId, showStyleBaseId, rundownIds, (cache) => {
cleanupChanges = this.#changed(showStyleBaseId, cache)

return () => {
void 0
}
)
})

return () => {
obs1.stop()
Expand Down

0 comments on commit aa69e5d

Please sign in to comment.