Skip to content

Commit

Permalink
Merge branch 'release50'
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Aug 8, 2024
2 parents b700f56 + c48a483 commit 50ee2cd
Show file tree
Hide file tree
Showing 61 changed files with 467 additions and 280 deletions.
17 changes: 17 additions & 0 deletions meteor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.50.4](///compare/v1.50.3...v1.50.4) (2024-08-08)


### Bug Fixes

* compensate for piece preroll for adlibbed pieces SOFIE-3369 ([#1236](undefined/undefined/undefined/issues/1236)) c8f7c42
* rundown timing drifting when playing parts with preroll SOFIE-3291 ([#1234](undefined/undefined/undefined/issues/1234)) a444857
* unexpected timeline updates while playing final part in rundown SOFIE-3371 ([#1237](undefined/undefined/undefined/issues/1237)) 393f0c1

### [1.50.3](https://github.com/nrkno/sofie-core/compare/v1.50.2...v1.50.3) (2024-06-24)


### Bug Fixes

* **DashboardPieceButton:** hover previews are not positioned correctly ([89fd219](https://github.com/nrkno/sofie-core/commit/89fd219d57fb775ed140ed2eaf5326a80194661f))
* input gateway devices lose rundown actions on reset SOFIE-3134 ([#1190](https://github.com/nrkno/sofie-core/issues/1190)) ([aa69e5d](https://github.com/nrkno/sofie-core/commit/aa69e5d2df512f0e79bb1ada51ed61560258c0cd))

### [1.50.2](///compare/v1.49.6...v1.50.2) (2024-05-15)


Expand Down
2 changes: 1 addition & 1 deletion meteor/__mocks__/defaultCollectionObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function defaultPart(_id: PartId, rundownId: RundownId, segmentId: Segmen
_rank: 0,
externalId: unprotectString(_id),
title: 'Default Part',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
}
export function defaultPiece(_id: PieceId, rundownId: RundownId, segmentId: SegmentId, partId: PartId): Piece {
Expand Down
10 changes: 5 additions & 5 deletions meteor/__mocks__/helpers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export async function setupDefaultRundown(
_rank: 0,
externalId: 'MOCK_PART_0_0',
title: 'Part 0 0',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part00)

Expand Down Expand Up @@ -730,7 +730,7 @@ export async function setupDefaultRundown(
_rank: 1,
externalId: 'MOCK_PART_0_1',
title: 'Part 0 1',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part01)

Expand Down Expand Up @@ -771,7 +771,7 @@ export async function setupDefaultRundown(
_rank: 0,
externalId: 'MOCK_PART_1_0',
title: 'Part 1 0',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part10)

Expand All @@ -782,7 +782,7 @@ export async function setupDefaultRundown(
_rank: 1,
externalId: 'MOCK_PART_1_1',
title: 'Part 1 1',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part11)

Expand All @@ -793,7 +793,7 @@ export async function setupDefaultRundown(
_rank: 2,
externalId: 'MOCK_PART_1_2',
title: 'Part 1 2',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part12)

Expand Down
2 changes: 1 addition & 1 deletion meteor/client/lib/__tests__/rundownTiming.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function makeMockPart(
_rank: rank,
rundownId: protectString(rundownId),
...durations,
expectedDurationWithPreroll: durations.expectedDuration,
expectedDurationWithTransition: durations.expectedDuration,
})
}

Expand Down
8 changes: 4 additions & 4 deletions meteor/client/lib/rundown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { FindOptions } from '../../lib/collections/lib'
import { getShowHiddenSourceLayers } from './localStorage'
import { Rundown } from '../../lib/collections/Rundowns'
import { IStudioSettings } from '@sofie-automation/corelib/dist/dataModel/Studio'
import { calculatePartInstanceExpectedDurationWithPreroll } from '@sofie-automation/corelib/dist/playout/timings'
import { calculatePartInstanceExpectedDurationWithTransition } from '@sofie-automation/corelib/dist/playout/timings'
import { AdLibPieceUi } from './shelf'
import { UIShowStyleBase } from '../../lib/api/showStyles'
import { PartId, PieceId, RundownId, SegmentId, ShowStyleBaseId } from '@sofie-automation/corelib/dist/dataModel/Ids'
Expand All @@ -63,7 +63,7 @@ export namespace RundownUtils {
return (
memo +
(part.instance.timings?.duration ||
calculatePartInstanceExpectedDurationWithPreroll(part.instance) ||
calculatePartInstanceExpectedDurationWithTransition(part.instance) ||
part.renderedDuration ||
(display ? Settings.defaultDisplayDuration : 0))
)
Expand Down Expand Up @@ -218,7 +218,7 @@ export namespace RundownUtils {
? part.instance.timings.duration + (part.instance.timings?.playOffset || 0)
: (partDuration ||
part.renderedDuration ||
calculatePartInstanceExpectedDurationWithPreroll(part.instance) ||
calculatePartInstanceExpectedDurationWithTransition(part.instance) ||
0) - (piece.renderedInPoint || 0)))
: part.instance.timings?.duration !== undefined
? part.instance.timings.duration + (part.instance.timings?.playOffset || 0)
Expand Down Expand Up @@ -422,7 +422,7 @@ export namespace RundownUtils {
partsE = segmentInfo.partInstances.map((partInstance, itIndex) => {
const partTimeline: SuperTimeline.TimelineObject[] = []

const partExpectedDuration = calculatePartInstanceExpectedDurationWithPreroll(partInstance)
const partExpectedDuration = calculatePartInstanceExpectedDurationWithTransition(partInstance)

// extend objects to match the Extended interface
const partE = literal<PartExtended>({
Expand Down
35 changes: 18 additions & 17 deletions meteor/client/lib/rundownTiming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { PartId, PartInstanceId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import { literal } from '@sofie-automation/corelib/dist/lib'
import { PlaylistTiming } from '@sofie-automation/corelib/dist/playout/rundownTiming'
import { calculatePartInstanceExpectedDurationWithPreroll } from '@sofie-automation/corelib/dist/playout/timings'
import { calculatePartInstanceExpectedDurationWithTransition } from '@sofie-automation/corelib/dist/playout/timings'
import { protectString, unprotectString } from '@sofie-automation/corelib/dist/protectedString'
import {
findPartInstanceInMapOrWrapToTemporary,
Expand Down Expand Up @@ -211,7 +211,7 @@ export class RundownTimingCalculator {
// if the Part is using budgetDuration, this budget is calculated when going through all the segments
// in the Rundown (see further down)
if (!segmentUsesBudget && !partIsUntimed) {
totalRundownDuration += calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0
totalRundownDuration += calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0
}

const lastStartedPlayback = partInstance.timings?.plannedStartedPlayback
Expand All @@ -225,7 +225,7 @@ export class RundownTimingCalculator {
let displayDurationFromGroup = 0

partExpectedDuration =
calculatePartInstanceExpectedDurationWithPreroll(partInstance) ||
calculatePartInstanceExpectedDurationWithTransition(partInstance) ||
partInstance.timings?.duration ||
0

Expand All @@ -248,7 +248,7 @@ export class RundownTimingCalculator {
) {
this.displayDurationGroups[partInstance.part.displayDurationGroup] =
(this.displayDurationGroups[partInstance.part.displayDurationGroup] || 0) +
(calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0)
(calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0)
displayDurationFromGroup =
partInstance.part.displayDuration ||
Math.max(
Expand All @@ -272,7 +272,7 @@ export class RundownTimingCalculator {
: undefined)
partDuration =
Math.max(
duration || calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0,
duration || calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0,
now - lastStartedPlayback
) - playOffset
// because displayDurationGroups have no actual timing on them, we need to have a copy of the
Expand All @@ -282,7 +282,7 @@ export class RundownTimingCalculator {
duration ||
(memberOfDisplayDurationGroup
? displayDurationFromGroup
: calculatePartInstanceExpectedDurationWithPreroll(partInstance)) ||
: calculatePartInstanceExpectedDurationWithTransition(partInstance)) ||
defaultDuration
partDisplayDuration = Math.max(partDisplayDurationNoPlayback, now - lastStartedPlayback)
this.partPlayed[unprotectString(partInstance.part._id)] = now - lastStartedPlayback
Expand All @@ -304,23 +304,23 @@ export class RundownTimingCalculator {
(duration ||
(memberOfDisplayDurationGroup
? displayDurationFromGroup
: calculatePartInstanceExpectedDurationWithPreroll(partInstance)) ||
: calculatePartInstanceExpectedDurationWithTransition(partInstance)) ||
0) -
(now - lastStartedPlayback)
)
}
} else {
partDuration =
(partInstance.timings?.duration ||
calculatePartInstanceExpectedDurationWithPreroll(partInstance) ||
calculatePartInstanceExpectedDurationWithTransition(partInstance) ||
0) - playOffset
partDisplayDurationNoPlayback = Math.max(
0,
(partInstance.timings?.duration && partInstance.timings?.duration + playOffset) ||
displayDurationFromGroup ||
ensureMinimumDefaultDurationIfNotAuto(
partInstance,
calculatePartInstanceExpectedDurationWithPreroll(partInstance),
calculatePartInstanceExpectedDurationWithTransition(partInstance),
defaultDuration
)
)
Expand All @@ -344,7 +344,7 @@ export class RundownTimingCalculator {
valToAddToAsPlayedDuration = partInstance.timings.duration
} else if (partCounts) {
valToAddToAsPlayedDuration =
calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0
calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0
}

asPlayedRundownDuration += valToAddToAsPlayedDuration
Expand Down Expand Up @@ -381,15 +381,15 @@ export class RundownTimingCalculator {
memberOfDisplayDurationGroup
? Math.max(
partExpectedDuration,
calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0
calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0
)
: calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0,
: calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0,
now - lastStartedPlayback
)
} else {
asDisplayedRundownDuration +=
partInstance.timings?.duration ||
calculatePartInstanceExpectedDurationWithPreroll(partInstance) ||
calculatePartInstanceExpectedDurationWithTransition(partInstance) ||
0
}

Expand Down Expand Up @@ -433,12 +433,12 @@ export class RundownTimingCalculator {
waitDuration =
partInstance.timings?.duration ||
partDisplayDuration ||
calculatePartInstanceExpectedDurationWithPreroll(partInstance) ||
calculatePartInstanceExpectedDurationWithTransition(partInstance) ||
0
} else {
waitDuration =
partInstance.timings?.duration ||
calculatePartInstanceExpectedDurationWithPreroll(partInstance) ||
calculatePartInstanceExpectedDurationWithTransition(partInstance) ||
0
}
if (segmentUsesBudget) {
Expand All @@ -462,7 +462,8 @@ export class RundownTimingCalculator {
// this needs to use partInstance.part.expectedDuration as opposed to partExpectedDuration, because
// partExpectedDuration is affected by displayGroups, and if it hasn't played yet then it shouldn't
// add any duration to the "remaining" time pool
remainingRundownDuration += calculatePartInstanceExpectedDurationWithPreroll(partInstance) || 0
remainingRundownDuration +=
calculatePartInstanceExpectedDurationWithTransition(partInstance) || 0
// item is onAir right now, and it's is currently shorter than expectedDuration
} else if (
lastStartedPlayback &&
Expand Down Expand Up @@ -599,7 +600,7 @@ export class RundownTimingCalculator {

let onAirPartDuration =
currentLivePartInstance.timings?.duration ||
calculatePartInstanceExpectedDurationWithPreroll(currentLivePartInstance) ||
calculatePartInstanceExpectedDurationWithTransition(currentLivePartInstance) ||
0
if (
currentLivePart.displayDurationGroup &&
Expand Down
4 changes: 2 additions & 2 deletions meteor/client/ui/ClockView/PresenterScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { DBShowStyleVariant } from '@sofie-automation/corelib/dist/dataModel/Sho
import { RundownLayoutsAPI } from '../../../lib/api/rundownLayouts'
import { ShelfDashboardLayout } from '../Shelf/ShelfDashboardLayout'
import { parse as queryStringParse } from 'query-string'
import { calculatePartInstanceExpectedDurationWithPreroll } from '@sofie-automation/corelib/dist/playout/timings'
import { calculatePartInstanceExpectedDurationWithTransition } from '@sofie-automation/corelib/dist/playout/timings'
import { getPlaylistTimingDiff } from '../../lib/rundownTiming'
import { UIShowStyleBase } from '../../../lib/api/showStyles'
import { UIShowStyleBases, UIStudios } from '../Collections'
Expand Down Expand Up @@ -467,7 +467,7 @@ export class PresenterScreenBase extends MeteorReactComponent<
showStyleBaseId={currentShowStyleBaseId}
rundownIds={this.props.rundownIds}
partAutoNext={currentPart.instance.part.autoNext || false}
partExpectedDuration={calculatePartInstanceExpectedDurationWithPreroll(currentPart.instance)}
partExpectedDuration={calculatePartInstanceExpectedDurationWithTransition(currentPart.instance)}
partStartedPlayback={currentPart.instance.timings?.plannedStartedPlayback}
playlistActivationId={this.props.playlist?.activationId}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withTiming, WithTiming } from './withTiming'
import { unprotectString } from '../../../../lib/lib'
import { RundownUtils } from '../../../lib/rundown'
import { PartUi } from '../../SegmentTimeline/SegmentTimelineContainer'
import { calculatePartInstanceExpectedDurationWithPreroll } from '@sofie-automation/corelib/dist/playout/timings'
import { calculatePartInstanceExpectedDurationWithTransition } from '@sofie-automation/corelib/dist/playout/timings'
import { SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'

interface ISegmentDurationProps {
Expand Down Expand Up @@ -45,7 +45,7 @@ export const SegmentDuration = withTiming<ISegmentDurationProps, {}>()(function
budget +=
part.instance.orphaned || part.instance.part.untimed
? 0
: calculatePartInstanceExpectedDurationWithPreroll(part.instance) || 0
: calculatePartInstanceExpectedDurationWithTransition(part.instance) || 0
})
}
props.parts.forEach((part) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as _ from 'underscore'

import { getElementWidth } from '../../../utils/dimensions'
import { MicFloatingInspector } from '../../FloatingInspectors/MicFloatingInspector'
import { calculatePartInstanceExpectedDurationWithPreroll } from '@sofie-automation/corelib/dist/playout/timings'
import { calculatePartInstanceExpectedDurationWithTransition } from '@sofie-automation/corelib/dist/playout/timings'
import { unprotectString } from '../../../../lib/lib'
import { IFloatingInspectorPosition } from '../../FloatingInspectors/IFloatingInspectorPosition'
import { logger } from '../../../../lib/logging'
Expand Down Expand Up @@ -135,8 +135,8 @@ export const MicSourceRenderer = withTranslation()(
_forceSizingRecheck = true
}

const expectedDuration = calculatePartInstanceExpectedDurationWithPreroll(this.props.part.instance)
const prevExpectedDuration = calculatePartInstanceExpectedDurationWithPreroll(prevProps.part.instance)
const expectedDuration = calculatePartInstanceExpectedDurationWithTransition(this.props.part.instance)
const prevExpectedDuration = calculatePartInstanceExpectedDurationWithTransition(prevProps.part.instance)

if (
!_forceSizingRecheck &&
Expand Down
2 changes: 1 addition & 1 deletion meteor/client/ui/SegmentTimeline/SegmentTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export const BUDGET_GAP_PART = {
gap: true,
title: 'gap',
invalid: true,
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}),
pieces: [],
renderedDuration: 0,
Expand Down
9 changes: 5 additions & 4 deletions meteor/client/ui/Shelf/DashboardPieceButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class DashboardPieceButtonBase<T = {}> extends MeteorReactComponent<
IState
> {
private element: HTMLDivElement | null = null
/** positionAndSize needs to be in document coordinate space */
private positionAndSize: {
top: number
left: number
Expand Down Expand Up @@ -206,8 +207,8 @@ export class DashboardPieceButtonBase<T = {}> extends MeteorReactComponent<
if (this.element) {
const { top, left, width, height } = this.element.getBoundingClientRect()
this.positionAndSize = {
top,
left,
top: window.scrollY + top,
left: window.scrollX + left,
width,
height,
}
Expand All @@ -224,8 +225,8 @@ export class DashboardPieceButtonBase<T = {}> extends MeteorReactComponent<
if (this.element) {
const { top, left, width, height } = this.element.getBoundingClientRect()
this.positionAndSize = {
top,
left,
top: window.scrollY + top,
left: window.scrollX + left,
width,
height,
}
Expand Down
2 changes: 1 addition & 1 deletion meteor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "automation-core",
"version": "1.50.2",
"version": "1.50.4",
"private": true,
"engines": {
"node": ">=14.19.1"
Expand Down
4 changes: 2 additions & 2 deletions meteor/server/__tests__/cronjobs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('cronjobs', () => {
segmentId: segment0._id,
externalId: '',
title: '',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part0)
const part1: DBPart = {
Expand All @@ -230,7 +230,7 @@ describe('cronjobs', () => {
segmentId: getRandomId<SegmentId>(), // non-existent
externalId: '',
title: '',
expectedDurationWithPreroll: undefined,
expectedDurationWithTransition: undefined,
}
await Parts.mutableCollection.insertAsync(part1)

Expand Down
Loading

0 comments on commit 50ee2cd

Please sign in to comment.