Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ function generateExpectedPackageForDevice(
if (lookedUpSource) {
combinedSources.push(calculateCombinedSource(packageSource, lookedUpSource))
} else {
logger.warn(
`Pub.expectedPackagesForDevice: Source package container "${packageSource.containerId}" not found`
)
// This can happen if the blueprints reference a Package Container that is for another studio.
// checkPieceContentStatus will formulate a proper status for this situation

// Add a placeholder source, it's used to provide users with a hint of what's wrong
combinedSources.push({
containerId: packageSource.containerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,26 @@ async function checkPieceContentExpectedPackageStatus(
}
}

const fileName = getExpectedPackageFileName(expectedPackage) ?? ''

// Check if any of the sources exist and are valid
// Future: This might be better to do by passing packageManager an 'forcedError' property in the publication, but this direct check is simpler and enough for now
const hasValidSources =
expectedPackage.sources &&
(expectedPackage.sources.length === 0 ||
!expectedPackage.sources.find((source) => !studio.packageContainers[source.containerId]))
if (!hasValidSources) {
// The expected package has no valid sources

pushOrMergeMessage({
status: PieceStatusCode.SOURCE_MISSING,
message: PackageStatusMessage.FILE_MISSING_SOURCE_CONTAINERS,
fileName: fileName,
packageContainers: expectedPackage.sources.map((s) => s.containerId), // Ideally this would be labels, but the containers are missing
})
continue
}

let warningMessage: ContentMessageLight | null = null
let matchedExpectedPackageId: ExpectedPackageId | null = null
for (const expectedPackageId of expectedPackageIds) {
Expand Down Expand Up @@ -712,7 +732,6 @@ async function checkPieceContentExpectedPackageStatus(
break
}

const fileName = getExpectedPackageFileName(expectedPackage) ?? ''
const containerLabel = matchedPackageContainer[1].container.label

if (!matchedExpectedPackageId || warningMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const DEFAULT_MESSAGES: Record<PackageStatusMessage, ITranslatableMessage> = {
[PackageStatusMessage.FILE_IS_MISSING]: generateTranslation('{{sourceLayer}} is missing'),

// Package manager
[PackageStatusMessage.FILE_MISSING_SOURCE_CONTAINERS]: generateTranslation(
'{{sourceLayer}} has unsupported source: {{containerLabels}}'
),
[PackageStatusMessage.FILE_CANT_BE_FOUND_ON_PLAYOUT_SYSTEM]: generateTranslation(
`{{sourceLayer}} can't be found on the playout system`
),
Expand Down
4 changes: 4 additions & 0 deletions packages/shared-lib/src/packageStatusMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export enum PackageStatusMessage {
FILE_IS_MISSING = 'FILE_IS_MISSING',

// Package manager
/**
* The file has no valid source package containers
*/
FILE_MISSING_SOURCE_CONTAINERS = 'FILE_MISSING_SOURCE_CONTAINERS',
/**
* The file can't be found on the playout system
*/
Expand Down
Loading