Skip to content

Commit 428e95d

Browse files
committed
chore: remove handling of legacy mos data import
1 parent 9a3e400 commit 428e95d

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

meteor/server/api/snapshot.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,6 @@ async function restoreFromSnapshot(
498498
): Promise<void> {
499499
// Determine what kind of snapshot
500500

501-
// First, some special (debugging) cases:
502-
if (snapshotIsAMOSDataDump(snapshot)) {
503-
// Special: Not a snapshot, but a datadump of a MOS rundown
504-
return ingestFromSnapshot(snapshot)
505-
}
506-
507501
// Then, continue as if it's a normal snapshot:
508502
if (!snapshot.snapshot) throw new Meteor.Error(500, `Restore input data is not a snapshot (${_.keys(snapshot)})`)
509503

@@ -528,10 +522,7 @@ async function restoreFromSnapshot(
528522
throw new Meteor.Error(402, `Unknown snapshot type "${snapshot.snapshot.type}"`)
529523
}
530524
}
531-
function snapshotIsAMOSDataDump(snapshot: Record<string, any>): boolean {
532-
// Special: Is not a snapshot, but a datadump of a MOS rundown
533-
return snapshot.externalId && snapshot.segments && snapshot.type === 'mos'
534-
}
525+
535526
async function getStudioIdFromPlaylistSnapshot(playlistSnapshot: RundownPlaylistSnapshot): Promise<StudioId> {
536527
// TODO: Improve this. This matches the 'old' behaviour
537528
const studios = await Studios.findFetchAsync({})
@@ -545,16 +536,6 @@ async function ingestFromSnapshot(
545536
/** The snapshot data to restore */
546537
snapshot: AnySnapshot
547538
): Promise<void> {
548-
// First, some special (debugging) cases:
549-
if (snapshotIsAMOSDataDump(snapshot)) {
550-
// Special: Not a snapshot, but a datadump of a MOS rundown
551-
const studioId: StudioId = Meteor.settings.manualSnapshotIngestStudioId || 'studio0'
552-
const studioExists = await checkStudioExists(studioId)
553-
if (studioExists) {
554-
return importIngestRundown(studioId, snapshot as unknown as IngestRundown)
555-
} else throw new Meteor.Error(500, `No Studio found`)
556-
}
557-
558539
// Determine what kind of snapshot
559540
if (!snapshot.snapshot) throw new Meteor.Error(500, `Restore input data is not a snapshot (${_.keys(snapshot)})`)
560541
if (snapshot.snapshot.type === SnapshotType.RUNDOWNPLAYLIST) {

0 commit comments

Comments
 (0)