Skip to content

Commit 1ccd814

Browse files
committed
Merge branch 'release51' into release52
2 parents 91d2b48 + af75f8f commit 1ccd814

File tree

23 files changed

+614
-93
lines changed

23 files changed

+614
-93
lines changed

.github/workflows/node.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ jobs:
247247
- name: Trivy scanning
248248
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
249249
uses: aquasecurity/[email protected]
250+
env:
251+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
250252
with:
251253
image-ref: "${{ steps.trivy-image.outputs.image }}"
252254
format: "table"
@@ -396,6 +398,8 @@ jobs:
396398
- name: Trivy scanning
397399
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
398400
uses: aquasecurity/[email protected]
401+
env:
402+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
399403
with:
400404
image-ref: "${{ steps.trivy-image.outputs.image }}"
401405
format: "table"

.github/workflows/prune-container-images.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77

88
jobs:
99
prune-container-images:
10+
if: ${{ github.repository_owner == 'nrkno' }}
11+
1012
uses: nrkno/sofie-github-workflows/.github/workflows/prune-container-images.yml@main
1113
strategy:
1214
max-parallel: 1

.github/workflows/prune-tags.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ on:
1616

1717
jobs:
1818
prune-tags:
19+
if: ${{ github.repository_owner == 'nrkno' }}
20+
1921
name: Prune tags
2022
runs-on: ubuntu-latest
2123
timeout-minutes: 15

.github/workflows/trivy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
jobs:
88
trivy:
9+
if: ${{ github.repository_owner == 'nrkno' }}
10+
911
name: Trivy scan
1012
runs-on: ubuntu-latest
1113
strategy:
@@ -16,13 +18,17 @@ jobs:
1618
steps:
1719
- name: Run Trivy vulnerability scanner (json)
1820
uses: aquasecurity/[email protected]
21+
env:
22+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
1923
with:
2024
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
2125
format: json
2226
output: '${{ matrix.image }}-trivy-scan-results.json'
2327

2428
- name: Run Trivy vulnerability scanner (table)
2529
uses: aquasecurity/[email protected]
30+
env:
31+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
2632
with:
2733
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
2834
output: '${{ matrix.image }}-trivy-scan-results.txt'
@@ -39,6 +45,8 @@ jobs:
3945
4046
- name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph
4147
uses: aquasecurity/[email protected]
48+
env:
49+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
4250
with:
4351
format: 'github'
4452
output: 'dependency-results-${{ matrix.image }}.sbom.json'

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ This repository uses the following branches:
99
* **_master_** is our main branch. We consider it stable and it is used in production.
1010
* The **_releaseXX_** branches are our in-development branches. When a release is ready, we decide to “freeze” that branch and create a new **_releaseXX+1_** branch.
1111

12-
We encourage you to base your contributions on the latest **_releaseXX_** branch, alternatively the **_master_** branch or a recently frozen **_releaseXX_** branch. The [_Sofie Releases_](https://nrkno.github.io/sofie-core/releases) page collects the status and timeline of the releases.
12+
We require contributions to be based based on the latest **_release\*_** branch.
13+
The [_Sofie Releases_](https://nrkno.github.io/sofie-core/releases) page collects the status and timeline of the releases.

packages/blueprints-integration/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [1.51.0](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.3...v1.51.0) (2024-10-07)
7+
8+
**Note:** Version bump only for package @sofie-automation/blueprints-integration
9+
10+
11+
12+
13+
14+
# [1.51.0](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.3...v1.51.0) (2024-10-07)
15+
16+
**Note:** Version bump only for package @sofie-automation/blueprints-integration
17+
18+
19+
20+
21+
622
# [1.51.0-in-testing.3](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.2...v1.51.0-in-testing.3) (2024-09-25)
723

824
**Note:** Version bump only for package @sofie-automation/blueprints-integration

packages/corelib/src/playout/playlist.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { DBRundown } from '../dataModel/Rundown'
12
import { DBSegment } from '../dataModel/Segment'
23
import { DBPart } from '../dataModel/Part'
34
import { DBPartInstance } from '../dataModel/PartInstance'
@@ -105,3 +106,22 @@ export function compareMarkerPositions(a: MarkerPosition, b: MarkerPosition): nu
105106
if (a.partRank < b.partRank) return 1
106107
return 0
107108
}
109+
110+
export function sortRundownsWithinPlaylist(
111+
sortedPossibleIds: ReadonlyDeep<RundownId[]>,
112+
unsortedRundowns: DBRundown[]
113+
): DBRundown[] {
114+
return unsortedRundowns.slice().sort((a, b) => {
115+
const indexA = sortedPossibleIds.indexOf(a._id)
116+
const indexB = sortedPossibleIds.indexOf(b._id)
117+
if (indexA === -1 && indexB === -1) {
118+
return a._id.toString().localeCompare(b._id.toString())
119+
} else if (indexA === -1) {
120+
return 1
121+
} else if (indexB === -1) {
122+
return -1
123+
}
124+
125+
return indexA - indexB
126+
})
127+
}

packages/corelib/src/playout/timings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ export function getPartTimingsOrDefaults(
158158
}
159159

160160
function calculateExpectedDurationWithTransition(rawDuration: number, timings: PartCalculatedTimings): number {
161-
// toPartDelay needs to be subtracted, because it is added to `fromPartRemaining` when the `fromPartRemaining` value is calculated.
162-
return Math.max(0, rawDuration - (timings.fromPartRemaining - timings.toPartDelay))
161+
// toPartDelay and fromPartPostroll needs to be subtracted, because it is added to `fromPartRemaining` when the `fromPartRemaining` value is calculated.
162+
return Math.max(0, rawDuration - (timings.fromPartRemaining - timings.toPartDelay - timings.fromPartPostroll))
163163
}
164164

165165
export type CalculateExpectedDurationPart = Pick<DBPart, 'inTransition' | 'expectedDuration'>

packages/documentation/docs/for-developers/contribution-guidelines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sidebar_position: 2
77

88
# Contribution Guidelines
99

10+
_Last updated september 2024_
11+
1012
## About the Sofie TV Studio Automation Project
1113

1214
The Sofie project includes a number of open source applications and libraries developed and maintained by the Norwegian public service broadcaster, [NRK](https://www.nrk.no/about/). Sofie has been used to produce live shows at NRK since September 2018.
@@ -35,8 +37,8 @@ However, Sofie is a big project with many differing users and use cases. **Large
3537
3. (If needed) NRK establishes contact with the RFC author, who will be invited to a workshop where the RFC is discussed. Meeting notes are published publicly on the RFC thread.
3638
4. The contributor references the RFC when a pull request is ready.
3739

38-
### Base contributions on the in-development branch (or the master branch)
39-
In order to facilitate merging, we ask that contributions are based on the latest (at the time of the pull request) _in-development_ branch (often named `release*`), alternatively the stable (eg. `master`) branch. NRK will take responsibility for rebasing stable contributions to the latest in-development branch if needed.
40+
### Base contributions on the in-development branch
41+
In order to facilitate merging, we ask that contributions are based on the latest (at the time of the pull request) _in-development_ branch (often named `release*`).
4042
See **CONTRIBUTING.md** in each official repository for details on which branch to use as a base for contributions.
4143

4244
## Developer Guidelines

packages/job-worker/src/blueprints/postProcess.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ export function postProcessBucketAdLib(
397397
blueprintId: BlueprintId,
398398
bucketId: BucketId,
399399
rank: number | undefined,
400+
name: string | undefined,
400401
importVersions: RundownImportVersions
401402
): BucketAdLib {
402403
const id: PieceId = protectString(
@@ -416,6 +417,7 @@ export function postProcessBucketAdLib(
416417
importVersions,
417418
ingestInfo,
418419
_rank: rank || itemOrig._rank,
420+
name: name || itemOrig.name,
419421
timelineObjectsString: EmptyPieceTimelineObjectsBlob,
420422
}
421423
// Fill in ids of unnamed expectedPackages
@@ -446,6 +448,7 @@ export function postProcessBucketAction(
446448
blueprintId: BlueprintId,
447449
bucketId: BucketId,
448450
rank: number | undefined,
451+
label: string | undefined,
449452
importVersions: RundownImportVersions
450453
): BucketAdLibAction {
451454
const id: AdLibActionId = protectString(
@@ -463,7 +466,7 @@ export function postProcessBucketAction(
463466
bucketId,
464467
importVersions,
465468
ingestInfo,
466-
...processAdLibActionITranslatableMessages(itemOrig, blueprintId, rank),
469+
...processAdLibActionITranslatableMessages(itemOrig, blueprintId, rank, label),
467470
}
468471

469472
// Fill in ids of unnamed expectedPackages
@@ -498,12 +501,12 @@ function processAdLibActionITranslatableMessages<
498501
})[]
499502
},
500503
T extends IBlueprintActionManifest
501-
>(itemOrig: T, blueprintId: BlueprintId, rank?: number): Pick<K, 'display' | 'triggerModes'> {
504+
>(itemOrig: T, blueprintId: BlueprintId, rank?: number, label?: string): Pick<K, 'display' | 'triggerModes'> {
502505
return {
503506
display: {
504507
...itemOrig.display,
505508
_rank: rank ?? itemOrig.display._rank,
506-
label: wrapTranslatableMessageFromBlueprints(itemOrig.display.label, [blueprintId]),
509+
label: (label as any) ?? wrapTranslatableMessageFromBlueprints(itemOrig.display.label, [blueprintId]),
507510
triggerLabel:
508511
itemOrig.display.triggerLabel &&
509512
wrapTranslatableMessageFromBlueprints(itemOrig.display.triggerLabel, [blueprintId]),

0 commit comments

Comments
 (0)