From 90f4e99b0c2eb803dada47e4cb6a1fb9ab3931cb Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Fri, 13 Oct 2023 14:28:58 +0100 Subject: [PATCH] chore: move `PieceContentStatusObj` into more sensibly named file --- meteor/client/lib/shelf.ts | 2 +- meteor/client/ui/MediaStatus/MediaStatus.tsx | 2 +- .../ui/SegmentContainer/withResolvedSegment.ts | 2 +- .../ui/SegmentTimeline/withMediaObjectStatus.tsx | 2 +- meteor/lib/Rundown.ts | 2 +- .../{mediaObjects.ts => api/pieceContentStatus.ts} | 11 ----------- meteor/lib/api/rundownNotifications.ts | 2 +- .../pieceContentStatusUI/checkPieceContentStatus.ts | 13 ++++++++++++- 8 files changed, 18 insertions(+), 18 deletions(-) rename meteor/lib/{mediaObjects.ts => api/pieceContentStatus.ts} (65%) diff --git a/meteor/client/lib/shelf.ts b/meteor/client/lib/shelf.ts index 20db188267..b6318705ce 100644 --- a/meteor/client/lib/shelf.ts +++ b/meteor/client/lib/shelf.ts @@ -13,7 +13,7 @@ import { UIShowStyleBase } from '../../lib/api/showStyles' import { PieceId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids' import { PieceInstances } from '../collections' import { ReadonlyDeep } from 'type-fest' -import { PieceContentStatusObj } from '../../lib/mediaObjects' +import { PieceContentStatusObj } from '../../lib/api/pieceContentStatus' export interface ShelfDisplayOptions { enableBuckets: boolean diff --git a/meteor/client/ui/MediaStatus/MediaStatus.tsx b/meteor/client/ui/MediaStatus/MediaStatus.tsx index a8eb61656e..42f3b250a7 100644 --- a/meteor/client/ui/MediaStatus/MediaStatus.tsx +++ b/meteor/client/ui/MediaStatus/MediaStatus.tsx @@ -29,7 +29,7 @@ import { ProtectedString, unprotectString } from '@sofie-automation/corelib/dist import { ExpectedPackage } from '@sofie-automation/shared-lib/dist/package-manager/package' import { PartInvalidReason } from '@sofie-automation/corelib/dist/dataModel/Part' import { IBlueprintActionManifestDisplayContent, SourceLayerType } from '@sofie-automation/blueprints-integration' -import { PieceContentStatusObj } from '../../../lib/mediaObjects' +import { PieceContentStatusObj } from '../../../lib/api/pieceContentStatus' import { Piece, PieceStatusCode } from '@sofie-automation/corelib/dist/dataModel/Piece' import { assertNever, literal } from '@sofie-automation/corelib/dist/lib' import { UIPieceContentStatuses, UIShowStyleBases } from '../Collections' diff --git a/meteor/client/ui/SegmentContainer/withResolvedSegment.ts b/meteor/client/ui/SegmentContainer/withResolvedSegment.ts index 4fd57ba66c..3fd0fa997c 100644 --- a/meteor/client/ui/SegmentContainer/withResolvedSegment.ts +++ b/meteor/client/ui/SegmentContainer/withResolvedSegment.ts @@ -37,7 +37,7 @@ import { PieceInstances, Segments } from '../../collections' import { RundownPlaylistCollectionUtil } from '../../../lib/collections/rundownPlaylistUtil' import { CalculateTimingsPiece } from '@sofie-automation/corelib/dist/playout/timings' import { ReadonlyDeep } from 'type-fest' -import { PieceContentStatusObj } from '../../../lib/mediaObjects' +import { PieceContentStatusObj } from '../../../lib/api/pieceContentStatus' import { SegmentOrphanedReason } from '@sofie-automation/corelib/dist/dataModel/Segment' export interface SegmentUi extends SegmentExtended { diff --git a/meteor/client/ui/SegmentTimeline/withMediaObjectStatus.tsx b/meteor/client/ui/SegmentTimeline/withMediaObjectStatus.tsx index edf1e2a302..63725a20f6 100644 --- a/meteor/client/ui/SegmentTimeline/withMediaObjectStatus.tsx +++ b/meteor/client/ui/SegmentTimeline/withMediaObjectStatus.tsx @@ -10,7 +10,7 @@ import { AdLibPieceUi } from '../../lib/shelf' import { UIStudio } from '../../../lib/api/studios' import { UIBucketContentStatuses, UIPieceContentStatuses } from '../Collections' import { Piece, PieceStatusCode } from '@sofie-automation/corelib/dist/dataModel/Piece' -import { PieceContentStatusObj } from '../../../lib/mediaObjects' +import { PieceContentStatusObj } from '../../../lib/api/pieceContentStatus' import { deepFreeze } from '@sofie-automation/corelib/dist/lib' import _ from 'underscore' import { useTracker } from '../../lib/ReactMeteorData/ReactMeteorData' diff --git a/meteor/lib/Rundown.ts b/meteor/lib/Rundown.ts index 759adc0682..c39a3c4610 100644 --- a/meteor/lib/Rundown.ts +++ b/meteor/lib/Rundown.ts @@ -25,7 +25,7 @@ import { } from '@sofie-automation/corelib/dist/dataModel/Ids' import { PieceInstances, Pieces } from './collections/libCollections' import { RundownPlaylistCollectionUtil } from './collections/rundownPlaylistUtil' -import { PieceContentStatusObj } from './mediaObjects' +import { PieceContentStatusObj } from './api/pieceContentStatus' import { ReadonlyDeep } from 'type-fest' import { PieceInstanceWithTimings } from '@sofie-automation/corelib/dist/playout/processAndPrune' diff --git a/meteor/lib/mediaObjects.ts b/meteor/lib/api/pieceContentStatus.ts similarity index 65% rename from meteor/lib/mediaObjects.ts rename to meteor/lib/api/pieceContentStatus.ts index 28f4e3768d..d6612512c2 100644 --- a/meteor/lib/mediaObjects.ts +++ b/meteor/lib/api/pieceContentStatus.ts @@ -2,17 +2,6 @@ import { PackageInfo } from '@sofie-automation/blueprints-integration' import { PieceStatusCode } from '@sofie-automation/corelib/dist/dataModel/Piece' import { ITranslatableMessage } from '@sofie-automation/corelib/dist/TranslatableMessage' -export interface ScanInfoForPackages { - [packageId: string]: ScanInfoForPackage -} -export interface ScanInfoForPackage { - /** Display name of the package */ - packageName: string - scan?: PackageInfo.FFProbeScan['payload'] - deepScan?: PackageInfo.FFProbeDeepScan['payload'] - timebase?: number // derived from scan -} - export interface PieceContentStatusObj { status: PieceStatusCode messages: ITranslatableMessage[] diff --git a/meteor/lib/api/rundownNotifications.ts b/meteor/lib/api/rundownNotifications.ts index 46554b9b8f..c03042594b 100644 --- a/meteor/lib/api/rundownNotifications.ts +++ b/meteor/lib/api/rundownNotifications.ts @@ -13,7 +13,7 @@ import { SegmentId, } from '@sofie-automation/corelib/dist/dataModel/Ids' import { ProtectedString } from '../lib' -import { PieceContentStatusObj } from '../mediaObjects' +import { PieceContentStatusObj } from './pieceContentStatus' import { ITranslatableMessage } from '@sofie-automation/corelib/dist/TranslatableMessage' export type UISegmentPartNoteId = ProtectedString<'UISegmentPartNote'> diff --git a/meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts b/meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts index 364019f5d8..5c82683df9 100644 --- a/meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts +++ b/meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts @@ -31,7 +31,7 @@ import _ from 'underscore' import { getSideEffect } from '../../../lib/collections/ExpectedPackages' import { getActiveRoutes, getRoutedMappings } from '../../../lib/collections/Studios' import { ensureHasTrailingSlash, generateTranslation, unprotectString } from '../../../lib/lib' -import { PieceContentStatusObj, ScanInfoForPackage, ScanInfoForPackages } from '../../../lib/mediaObjects' +import { PieceContentStatusObj } from '../../../lib/api/pieceContentStatus' import { MediaObjects, PackageContainerPackageStatuses, PackageInfos } from '../../collections' import { mediaObjectFieldSpecifier, @@ -43,6 +43,17 @@ import { PieceDependencies, } from './common' +interface ScanInfoForPackages { + [packageId: string]: ScanInfoForPackage +} +interface ScanInfoForPackage { + /** Display name of the package */ + packageName: string + scan?: PackageInfo.FFProbeScan['payload'] + deepScan?: PackageInfo.FFProbeDeepScan['payload'] + timebase?: number // derived from scan +} + /** * Take properties from the mediainfo / medistream and transform into a * formatted string