conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import BoxSeries from './boxSeries';
import {
BoxSeriesType,
BoxSeriesDataType,
ColumnChartOptions,
BarChartOptions,
Point,
Connector,
StackType,
} from '@t/options';
=======
import BoxSeries, { SeriesRawData, isLeftBottomSide } from './boxSeries';
import { ColumnChartOptions, BarChartOptions, Point, Connector } from '@t/options';
>>>>>>>
import BoxSeries, { isLeftBottomSide } from './boxSeries';
import {
BoxSeriesType,
BoxSeriesDataType,
ColumnChartOptions,
BarChartOptions,
Point,
Connector,
} from '@t/options';
<<<<<<<
seriesRawData: BoxSeriesType<BoxSeriesDataType>[],
stackData: StackData,
=======
seriesRawData: SeriesRawData,
stackData: StackDataValues,
>>>>>>>
seriesRawData: BoxSeriesType<BoxSeriesDataType>[],
stackData: StackDataValues, |
<<<<<<<
declare module '*.json'
declare module '*.png'
declare module '*.jpg'
declare module '*.jpeg'
declare module '*.svg'
declare module '@generated' // .ovine/*
=======
declare module '@generated' // .ovine/*
interface Window {
BEFORE_OVINE_CREATE: any // 页面全局函数hook
AFTER_OVINE_CREATED: any // 页面全局函数hook
}
>>>>>>>
declare module '*.json'
declare module '*.png'
declare module '*.jpg'
declare module '*.jpeg'
declare module '*.svg'
declare module '@generated' // .ovine/*
interface Window {
BEFORE_OVINE_CREATE: any // 页面全局函数hook
AFTER_OVINE_CREATED: any // 页面全局函数hook
} |
<<<<<<<
// << (hide)
import {ModalDialogService} from "nativescript-angular/modal-dialog";
// >> (hide)
import { IfAndroidDirective, IfIosDirective } from "./ng-directives/create-custom-directive/create-custom-directive.component"
import { UnlessDirective } from "./ng-directives/unless-directive/directive-unless"
=======
import { IfAndroidDirective, IfIosDirective } from "./ui/ng-directives/create-custom-directive/create-custom-directive.component"
import { UnlessDirective } from "./ui/ng-directives/unless-directive/directive-unless"
>>>>>>>
// << (hide)
import {ModalDialogService} from "nativescript-angular/modal-dialog";
// >> (hide)
import { IfAndroidDirective, IfIosDirective } from "./ui/ng-directives/create-custom-directive/create-custom-directive.component"
import { UnlessDirective } from "./ui/ng-directives/unless-directive/directive-unless"
<<<<<<<
import { ItemComponent } from "./listview/using-item-template/using-item-template.component";
// << (hide)
import { ModalViewComponent } from "./modal-page/sample-modal-page-module-example/modal-view";
=======
import { ItemComponent } from "./ui/listview/using-item-template/using-item-template.component";
>>>>>>>
import { ItemComponent } from "./ui/listview/using-item-template/using-item-template.component";
// << (hide)
import { ModalViewComponent } from "./modal-page/sample-modal-page-module-example/modal-view";
<<<<<<<
// << (hide)
ModalViewComponent
=======
...examplePipes
>>>>>>>
// << (hide)
ModalViewComponent,
...examplePipes |
<<<<<<<
new Link("Formatted String", "/formattedStringExamplesComponent"),
new Link("Trace Module", "/traceExampleComponent"),
new Link("Timer Module", "/sampleTimerModuleExampleComponent"),
new Link("Platform Module ", "/platformExamplesComponent"),
new Link("Location Module", "/locationExamplesComponent"),
new Link("FPS Meter", "/fpsExamplesComponent"),
new Link("HTTP Module", "./httpModuleComponent")
=======
new Link("Formatted String", "/formattedStringExamplesComponent"),
new Link("Application", "/applicationExamplesComponent"),
new Link("Application Settings", "/applicationSettingsExamplesComponent"),
new Link("Color", "/colorExamplesComponent"),
new Link("Connectivity", "/connectivityExamplesComponent"),
new Link("Fetch", "/fetchExamplesComponent"),
new Link("File System", "/fileSystemxamplesComponent"),
>>>>>>>
new Link("Formatted String", "/formattedStringExamplesComponent"),
new Link("Trace Module", "/traceExampleComponent"),
new Link("Timer Module", "/sampleTimerModuleExampleComponent"),
new Link("Platform Module ", "/platformExamplesComponent"),
new Link("Location Module", "/locationExamplesComponent"),
new Link("FPS Meter", "/fpsExamplesComponent"),
new Link("HTTP Module", "./httpModuleComponent")
new Link("Application", "/applicationExamplesComponent"),
new Link("Application Settings", "/applicationSettingsExamplesComponent"),
new Link("Color", "/colorExamplesComponent"),
new Link("Connectivity", "/connectivityExamplesComponent"),
new Link("Fetch", "/fetchExamplesComponent"),
new Link("File System", "/fileSystemxamplesComponent"), |
<<<<<<<
{ path: "buttonTextExampleComponent", component: ButtonTextComponent, data: { title: "Text" } },
{ path: "buttonTapEventExampleComponent", component: ButtonTapEventComponent, data: { title: "Tap Event" } },
{ path: "scrollViewExampleComponent", component: ScrollViewExamplesComponent, data: { title: "Scroll View" } },
{ path: "scrollViewHorizontalExampleComponent", component: ScrollViewHorizontalComponent, data: { title: "Horizontal Orientation" } },
{ path: "scrollViewVertivalExampleComponent", component: ScrollViewVerticalComponent, data: { title: "Vertical Orientation" } },
{ path: "scrollEventExampleComponent", component: ScrollEventComponent, data: { title: "Scroll Event" } },
{ path: "searchBarExampleComponent", component: SearchBarExamplesComponent, data: { title: "Search Bar" } },
{ path: "basicSearchBarComponent", component: BasicSearchBarComponent, data: { title: "Basic Search Bar" } },
{ path: "clearSearchBarComponent", component: ClearSearchBarComponent, data: { title: "Clear Search Bar" } },
{ path: "searchBarBindingComponent", component: SearchBarBindingComponent, data: { title: "Search Bar Property Binding" } },
{ path: "segmentedBarExamplesComponent", component: SegmentedBarExamplesComponent, data: { title: "Segmented Bar" } },
{ path: "basicSegmentedBarComponent", component: BasicSegmentedBarComponent, data: { title: "Basic Segmented Bar" } },
{ path: "segmentedBarViewsComponent", component: SegmentedBarViewsComponent, data: { title: "Segmented Bar View Change" } },
{ path: "sliderExamplesComponent", component: SliderExamplesComponent, data: { title: "Slider" } },
{ path: "basicSliderComponent", component: BasicSliderComponent, data: { title: "Basic Slider" } },
{ path: "accessSliderValueComponent", component: SliderAccessValueComponent, data: { title: "Slider Value Slider" } },
{ path: "switchExamplesComponent", component: SwitchExamplesComponent, data: { title: "Switch" } },
{ path: "basicSwitchComponent", component: BasicSwitchComponent, data: { title: "Basic Switch" } },
{ path: "diableSwitchComponent", component: DisableSwitchComponent, data: { title: "Disable Switch Component" } },
{ path: "stylingSwitchComponent", component: StylingSwitchComponent, data: { title: "Styling Switch Component" } },
{ path: "tabViewExamplesComponent", component: TabViewExamplesComponent, data: { title: "Tab View" } },
{ path: "basicTabViewExamplesComponent", component: BacisTabViewComponent, data: { title: "Basic Tab View" } }
=======
{ path: "buttonTextComponent", component: ButtonTextComponent, data: { title: "Text" } },
{ path: "buttonTapEventComponent", component: ButtonTapEventComponent, data: { title: "Tap Event" } },
{ path: "buttonBindingTextComponent", component: ButtonBindingTextComponent, data: { title: "Binding Text" } },
{ path: "datePickerExamplesComponent", component: DatePickerExamplesComponent, data: { title: "Date Picker" } },
{ path: "configureDatePickerComponent", component: ConfigureDatePickerComponent, data: { title: "Configure Date Picker" } },
{ path: "dialogsExamplesComponent", component: DialogsExamplesComponent, data: { title: "Dialogs" } },
{ path: "displayDialogsComponent", component: DisplayDialogsComponent, data: { title: "Display Dialogs" } },
{ path: "layoutsExamplesComponent", component: LayoutsExamplesComponent, data: { title: "Layouts" } },
{ path: "absoluteLayoutComponent", component: AbsoluteLayoutComponent, data: { title: "Absolute Layout" } },
{ path: "dockLayoutComponent", component: DockLayoutComponent, data: { title: "Dock Layout" } },
{ path: "gridLayoutComponent", component: GridLayoutComponent, data: { title: "Grid Layout" } },
{ path: "stackLayoutComponent", component: StackLayoutComponent, data: { title: "Stack Layout" } },
{ path: "wrapLayoutComponent", component: WrapLayoutComponent, data: { title: "Wrap Layout" } },
{ path: "timePickerExamplesComponent", component: TimePickerExamplesComponent, data: { title: "Time Picker" } },
{ path: "configureTimePickerComponent", component: ConfigureTimePickerComponent, data: { title: "Configure Time Picker" } },
{ path: "labelExamplesComponent", component: LabelExamplesComponent, data: { title: "Label" } },
{ path: "creatingLabelExampleComponent", component: CreatingLabelComponent, data: { title: "Creating Label" } },
{ path: "listPickerExamplesComponent", component: ListPickerExamplesComponent, data: { title: "ListPicker" } },
{ path: "creatingListPickerExampleComponent", component: CreatingListPickerComponent, data: { title: "Create ListPicker" } },
{ path: "usingSelectedIndexExampleComponent", component: UsingSelectedIndexExampleComponent, data: { title: "Using selectedIndex" } },
{ path: "listViewExamplesComponent", component: ListViewExamplesComponent, data: { title: "ListView" } },
{ path: "creatingListViewExampleComponent", component: CreatingListViewComponent, data: { title: "Creating ListView" } },
{ path: "customizingListViewExampleComponent", component: CustomizingListViewComponent, data: { title: "Customizing ListView" } },
{ path: "usingItemTemplateExampleComponent", component: UsingItemTemplateComponent, data: { title: "Using ListView Item Template" } },
{ path: "usingAsyncPipeExampleComponent", component: UsingAsyncPipeComponent, data: { title: "Using Async Pipe" } },
{ path: "progressExamplesComponent", component: ProgressExamplesComponent, data: { title: "Progress" } },
{ path: "creatingProgressExampleComponent", component: CreatingProgressComponent, data: { title: "Creating Progress" } },
{ path: "settingProgressExampleComponent", component: SettingProgressComponent, data: { title: "Setting up Progress" } },
{ path: "ngForExampleComponent", component: NgForExamplesComponent, data: { title: "*ngFor" } },
{ path: "ngForRepeatItemsComponent", component: NgForRepeatItemsComponent, data: { title: "*ngFor Repeat Items" } }
>>>>>>>
{ path: "scrollViewExampleComponent", component: ScrollViewExamplesComponent, data: { title: "Scroll View" } },
{ path: "scrollViewHorizontalExampleComponent", component: ScrollViewHorizontalComponent, data: { title: "Horizontal Orientation" } },
{ path: "scrollViewVertivalExampleComponent", component: ScrollViewVerticalComponent, data: { title: "Vertical Orientation" } },
{ path: "scrollEventExampleComponent", component: ScrollEventComponent, data: { title: "Scroll Event" } },
{ path: "searchBarExampleComponent", component: SearchBarExamplesComponent, data: { title: "Search Bar" } },
{ path: "basicSearchBarComponent", component: BasicSearchBarComponent, data: { title: "Basic Search Bar" } },
{ path: "clearSearchBarComponent", component: ClearSearchBarComponent, data: { title: "Clear Search Bar" } },
{ path: "searchBarBindingComponent", component: SearchBarBindingComponent, data: { title: "Search Bar Property Binding" } },
{ path: "segmentedBarExamplesComponent", component: SegmentedBarExamplesComponent, data: { title: "Segmented Bar" } },
{ path: "basicSegmentedBarComponent", component: BasicSegmentedBarComponent, data: { title: "Basic Segmented Bar" } },
{ path: "segmentedBarViewsComponent", component: SegmentedBarViewsComponent, data: { title: "Segmented Bar View Change" } },
{ path: "sliderExamplesComponent", component: SliderExamplesComponent, data: { title: "Slider" } },
{ path: "basicSliderComponent", component: BasicSliderComponent, data: { title: "Basic Slider" } },
{ path: "accessSliderValueComponent", component: SliderAccessValueComponent, data: { title: "Slider Value Slider" } },
{ path: "switchExamplesComponent", component: SwitchExamplesComponent, data: { title: "Switch" } },
{ path: "basicSwitchComponent", component: BasicSwitchComponent, data: { title: "Basic Switch" } },
{ path: "diableSwitchComponent", component: DisableSwitchComponent, data: { title: "Disable Switch Component" } },
{ path: "stylingSwitchComponent", component: StylingSwitchComponent, data: { title: "Styling Switch Component" } },
{ path: "tabViewExamplesComponent", component: TabViewExamplesComponent, data: { title: "Tab View" } },
{ path: "basicTabViewExamplesComponent", component: BacisTabViewComponent, data: { title: "Basic Tab View" } },
{ path: "buttonTextComponent", component: ButtonTextComponent, data: { title: "Text" } },
{ path: "buttonTapEventComponent", component: ButtonTapEventComponent, data: { title: "Tap Event" } },
{ path: "buttonBindingTextComponent", component: ButtonBindingTextComponent, data: { title: "Binding Text" } },
{ path: "datePickerExamplesComponent", component: DatePickerExamplesComponent, data: { title: "Date Picker" } },
{ path: "configureDatePickerComponent", component: ConfigureDatePickerComponent, data: { title: "Configure Date Picker" } },
{ path: "dialogsExamplesComponent", component: DialogsExamplesComponent, data: { title: "Dialogs" } },
{ path: "displayDialogsComponent", component: DisplayDialogsComponent, data: { title: "Display Dialogs" } },
{ path: "layoutsExamplesComponent", component: LayoutsExamplesComponent, data: { title: "Layouts" } },
{ path: "absoluteLayoutComponent", component: AbsoluteLayoutComponent, data: { title: "Absolute Layout" } },
{ path: "dockLayoutComponent", component: DockLayoutComponent, data: { title: "Dock Layout" } },
{ path: "gridLayoutComponent", component: GridLayoutComponent, data: { title: "Grid Layout" } },
{ path: "stackLayoutComponent", component: StackLayoutComponent, data: { title: "Stack Layout" } },
{ path: "wrapLayoutComponent", component: WrapLayoutComponent, data: { title: "Wrap Layout" } },
{ path: "timePickerExamplesComponent", component: TimePickerExamplesComponent, data: { title: "Time Picker" } },
{ path: "configureTimePickerComponent", component: ConfigureTimePickerComponent, data: { title: "Configure Time Picker" } },
{ path: "labelExamplesComponent", component: LabelExamplesComponent, data: { title: "Label" } },
{ path: "creatingLabelExampleComponent", component: CreatingLabelComponent, data: { title: "Creating Label" } },
{ path: "listPickerExamplesComponent", component: ListPickerExamplesComponent, data: { title: "ListPicker" } },
{ path: "creatingListPickerExampleComponent", component: CreatingListPickerComponent, data: { title: "Create ListPicker" } },
{ path: "usingSelectedIndexExampleComponent", component: UsingSelectedIndexExampleComponent, data: { title: "Using selectedIndex" } },
{ path: "listViewExamplesComponent", component: ListViewExamplesComponent, data: { title: "ListView" } },
{ path: "creatingListViewExampleComponent", component: CreatingListViewComponent, data: { title: "Creating ListView" } },
{ path: "customizingListViewExampleComponent", component: CustomizingListViewComponent, data: { title: "Customizing ListView" } },
{ path: "usingItemTemplateExampleComponent", component: UsingItemTemplateComponent, data: { title: "Using ListView Item Template" } },
{ path: "usingAsyncPipeExampleComponent", component: UsingAsyncPipeComponent, data: { title: "Using Async Pipe" } },
{ path: "progressExamplesComponent", component: ProgressExamplesComponent, data: { title: "Progress" } },
{ path: "creatingProgressExampleComponent", component: CreatingProgressComponent, data: { title: "Creating Progress" } },
{ path: "settingProgressExampleComponent", component: SettingProgressComponent, data: { title: "Setting up Progress" } },
{ path: "ngForExampleComponent", component: NgForExamplesComponent, data: { title: "*ngFor" } },
{ path: "ngForRepeatItemsComponent", component: NgForRepeatItemsComponent, data: { title: "*ngFor Repeat Items" } } |
<<<<<<<
insertTimelineObject(cache, studioId, timelineObject)
cache.saveTimelineThenAllToDatabase()
=======
insertTimelineObject(this, cache, studioId, timelineObject)
waitForPromise(cache.saveAllToDatabase())
>>>>>>>
insertTimelineObject(this, cache, studioId, timelineObject)
cache.saveTimelineThenAllToDatabase()
<<<<<<<
removeTimelineObject(cache, studioId, id)
cache.saveTimelineThenAllToDatabase()
=======
removeTimelineObject(this, cache, studioId, id)
waitForPromise(cache.saveAllToDatabase())
>>>>>>>
removeTimelineObject(this, cache, studioId, id)
cache.saveTimelineThenAllToDatabase() |
<<<<<<<
import { mongoWhere, literal, Omit, ProtectedString, unprotectString, protectString, mongoModify, mongoFindOptions } from '../lib/lib'
=======
import {
pushOntoPath,
setOntoPath,
mongoWhere,
literal,
unsetPath,
pullFromPath,
Omit,
ProtectedString,
unprotectString,
protectString,
mongoModify,
mongoFindOptions,
} from '../lib/lib'
>>>>>>>
import {
mongoWhere,
literal,
Omit,
ProtectedString,
unprotectString,
protectString,
mongoModify,
mongoFindOptions,
} from '../lib/lib'
<<<<<<<
import { UpsertOptions, UpdateOptions, FindOptions, ObserveChangesCallbacks } from '../lib/typings/meteor'
=======
import {
UpsertOptions,
UpdateOptions,
MongoSelector,
FindOptions,
ObserveChangesCallbacks,
} from '../lib/typings/meteor'
>>>>>>>
import { UpsertOptions, UpdateOptions, FindOptions, ObserveChangesCallbacks } from '../lib/typings/meteor'
<<<<<<<
find (query: any, options?: FindOptions<T>) {
=======
find(query: any, options?: FindOptions) {
>>>>>>>
find(query: any, options?: FindOptions<T>) {
<<<<<<<
observeChanges (clbs: ObserveChangesCallbacks<T>) { // todo - finish implementing uses of callbacks
=======
observeChanges(clbs: Mongo.ObserveChangesCallbacks) {
// todo - finish implementing uses of callbacks
>>>>>>>
observeChanges(clbs: ObserveChangesCallbacks<T>) {
// todo - finish implementing uses of callbacks
<<<<<<<
observers.push(literal<ObserverEntry<T>>({
id: id,
callbacks: clbs,
query: query
}))
=======
observers.push(
literal<ObserverEntry>({
id: id,
callbacks: clbs,
query: query,
})
)
>>>>>>>
observers.push(
literal<ObserverEntry<T>>({
id: id,
callbacks: clbs,
query: query,
})
)
<<<<<<<
findOne (query, options?: Omit<FindOptions<T>, 'limit'>) {
=======
findOne(query, options?: Omit<FindOptions, 'limit'>) {
>>>>>>>
findOne(query, options?: Omit<FindOptions<T>, 'limit'>) { |
<<<<<<<
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id
}).map((piece) => { // run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find(i => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
segmentId: 1,
}
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if ((status !== RundownAPI.PieceStatusCode.OK) && (status !== RundownAPI.PieceStatusCode.UNKNOWN) && (status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET)) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message
=======
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id,
}).map((piece) => {
// run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find((i) => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
name: 1,
segmentId: 1,
},
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if (
status !== RundownAPI.PieceStatusCode.OK &&
status !== RundownAPI.PieceStatusCode.UNKNOWN &&
status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET
) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message,
}
}
>>>>>>>
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id,
}).map((piece) => {
// run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find((i) => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
segmentId: 1,
},
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if (
status !== RundownAPI.PieceStatusCode.OK &&
status !== RundownAPI.PieceStatusCode.UNKNOWN &&
status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET
) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message,
}
} |
<<<<<<<
if (mediaObject.mediainfo.streams) {
if (mediaObject.mediainfo.streams.length < 2) {
newStatus = RundownAPI.PieceStatusCode.SOURCE_BROKEN
messages.push(t('Source doesn\'t have audio & video', { fileName: displayName }))
}
const formats = getAcceptedFormats(settings)
const audioConfig = settings ? settings.supportedAudioStreams : ''
const expectedAudioStreams = audioConfig ? new Set<string>(audioConfig.split(',').map(v => v.trim())) : new Set<string>()
let timebase: number = 0
let audioStreams: number = 0
let isStereo: boolean = false
// check the streams for resolution info
for (const stream of mediaObject.mediainfo.streams) {
if (stream.width && stream.height) {
if (stream.codec.time_base) {
const formattedTimebase = /(\d+)\/(\d+)/.exec(stream.codec.time_base) as RegExpExecArray
timebase = 1000 * Number(formattedTimebase[1]) / Number(formattedTimebase[2])
}
const format = buildFormatString(mediaObject.mediainfo, stream)
if (!acceptFormat(format, formats)) {
messages.push(t('Source format ({{format}}) is not in accepted formats', { format }))
}
} else if (stream.codec.type === 'audio') {
// this is the first (and hopefully last) track of audio, and has 2 channels
if (audioStreams === 0 && stream.channels === 2) {
isStereo = true
}
audioStreams++
}
}
if (timebase) {
mediaObject.mediainfo.timebase = timebase
}
if (audioConfig && (!expectedAudioStreams.has(audioStreams.toString()) || (isStereo && !expectedAudioStreams.has('stereo')))) {
messages.push(t('Source has {{audioStreams}} audio streams', { audioStreams }))
}
if (timebase) {
// check for black/freeze frames
const addFrameWarning = (arr: Array<Anomaly>, type: string, t: i18next.TranslationFunction<any, object, string>) => {
if (arr.length === 1) {
const frames = Math.round(arr[0].duration * 1000 / timebase)
if (arr[0].start === 0) {
messages.push(t('Clip starts with {{frames}} {{type}} frame', { frames, type, count: frames }))
} else if (
mediaObject.mediainfo &&
mediaObject.mediainfo.format &&
arr[0].end === Number(mediaObject.mediainfo.format.duration)
) {
messages.push(t('Clip ends with {{frames}} {{type}} frame', { frames, type, count: frames }))
} else {
messages.push(t('{{frames}} {{type}} frame detected in clip.', { frames, type, count: frames }))
}
} else if (arr.length > 0) {
const dur = arr
.map(b => b.duration)
.reduce((a, b) => a + b, 0)
const frames = Math.round(dur * 1000 / timebase)
messages.push(t('{{frames}} {{type}} frame detected in clip.', { frames, type, count: frames }))
}
=======
const formats = getAcceptedFormats(settings)
const audioConfig = settings ? settings.supportedAudioStreams : ''
const expectedAudioStreams = audioConfig ? new Set<string>(audioConfig.split(',').map(v => v.trim())) : new Set<string>()
let timebase
let audioStreams = 0
let isStereo = false
// check the streams for resolution info
for (const stream of mediaObject.mediainfo.streams) {
if (stream.width && stream.height) {
if (stream.codec.time_base) {
const formattedTimebase = /(\d+)\/(\d+)/.exec(stream.codec.time_base) as RegExpExecArray
timebase = 1000 * Number(formattedTimebase[1]) / Number(formattedTimebase[2])
}
const format = buildFormatString(mediaObject.mediainfo, stream)
if (!acceptFormat(format, formats)) {
messages.push(t('Source format ({{format}}) is not in accepted formats', { format }))
}
} else if (stream.codec.type === 'audio') {
// this is the first (and hopefully last) track of audio, and has 2 channels
if (audioStreams === 0 && stream.channels === 2) {
isStereo = true
}
audioStreams++
const format = buildFormatString(mediaObject.mediainfo, stream)
if (!acceptFormat(format, formats)) {
messages.push(t('Source format ({{format}}) is not in accepted formats', { format }))
>>>>>>>
if (mediaObject.mediainfo.streams) {
if (mediaObject.mediainfo.streams.length < 2) {
newStatus = RundownAPI.PieceStatusCode.SOURCE_BROKEN
messages.push(t('Source doesn\'t have audio & video', { fileName: displayName }))
}
const formats = getAcceptedFormats(settings)
const audioConfig = settings ? settings.supportedAudioStreams : ''
const expectedAudioStreams = audioConfig ? new Set<string>(audioConfig.split(',').map(v => v.trim())) : new Set<string>()
let timebase: number = 0
let audioStreams: number = 0
let isStereo: boolean = false
// check the streams for resolution info
for (const stream of mediaObject.mediainfo.streams) {
if (stream.width && stream.height) {
if (stream.codec.time_base) {
const formattedTimebase = /(\d+)\/(\d+)/.exec(stream.codec.time_base) as RegExpExecArray
timebase = 1000 * Number(formattedTimebase[1]) / Number(formattedTimebase[2])
}
const format = buildFormatString(mediaObject.mediainfo, stream)
if (!acceptFormat(format, formats)) {
messages.push(t('Source format ({{format}}) is not in accepted formats', { format }))
}
} else if (stream.codec.type === 'audio') {
// this is the first (and hopefully last) track of audio, and has 2 channels
if (audioStreams === 0 && stream.channels === 2) {
isStereo = true
}
audioStreams++
const format = buildFormatString(mediaObject.mediainfo, stream)
if (!acceptFormat(format, formats)) {
messages.push(t('Source format ({{format}}) is not in accepted formats', { format }))
}
}
}
if (timebase) {
mediaObject.mediainfo.timebase = timebase
}
if (audioConfig && (!expectedAudioStreams.has(audioStreams.toString()) || (isStereo && !expectedAudioStreams.has('stereo')))) {
messages.push(t('Source has {{audioStreams}} audio streams', { audioStreams }))
}
if (timebase) {
// check for black/freeze frames
const addFrameWarning = (arr: Array<Anomaly>, type: string, t: i18next.TranslationFunction<any, object, string>) => {
if (arr.length === 1) {
const frames = Math.round(arr[0].duration * 1000 / timebase)
if (arr[0].start === 0) {
messages.push(t('Clip starts with {{frames}} {{type}} frame', { frames, type, count: frames }))
} else if (
mediaObject.mediainfo &&
mediaObject.mediainfo.format &&
arr[0].end === Number(mediaObject.mediainfo.format.duration)
) {
messages.push(t('Clip ends with {{frames}} {{type}} frame', { frames, type, count: frames }))
} else {
messages.push(t('{{frames}} {{type}} frame detected in clip.', { frames, type, count: frames }))
}
} else if (arr.length > 0) {
const dur = arr
.map(b => b.duration)
.reduce((a, b) => a + b, 0)
const frames = Math.round(dur * 1000 / timebase)
messages.push(t('{{frames}} {{type}} frame detected in clip.', { frames, type, count: frames }))
} |
<<<<<<<
import { TransformedCollection } from '../typings/meteor'
import { applyClassToDocument, Time, registerCollection, ProtectedString, ProtectedStringProperties, protectString, unprotectString, Omit } from '../lib'
=======
import { TransformedCollection, MongoSelector, FindOptions } from '../typings/meteor'
import {
applyClassToDocument,
Time,
registerCollection,
ProtectedString,
ProtectedStringProperties,
protectString,
unprotectString,
Omit,
} from '../lib'
>>>>>>>
import { TransformedCollection } from '../typings/meteor'
import {
applyClassToDocument,
Time,
registerCollection,
ProtectedString,
ProtectedStringProperties,
protectString,
unprotectString,
Omit,
} from '../lib' |
<<<<<<<
getAllAdLibPieces () {
return this.getAdLibPieces()
}
getTimings () {
// return a chronological list of timing events
let events: Array<{time: Time, type: string, elapsed: Time}> = []
_.each(['take', 'takeDone', 'startedPlayback', 'takeOut', 'stoppedPlayback', 'next'], (key) => {
if (this.timings) {
_.each(this.timings[key], (t: Time) => {
events.push({
time: t,
type: key,
elapsed: 0
})
})
}
})
let prevEv: any = null
return _.map(
_.sortBy(events, e => e.time),
(ev) => {
if (prevEv) {
ev.elapsed = ev.time - prevEv.time
}
prevEv = ev
return ev
}
)
}
=======
>>>>>>>
getAllAdLibPieces () {
return this.getAdLibPieces()
} |
<<<<<<<
import { Studios } from '../../lib/collections/Studios'
import { PeripheralDevices } from '../../lib/collections/PeripheralDevices'
import { ShowStyleBases } from '../../lib/collections/ShowStyleBases'
=======
import { CoreSystem } from '../../lib/collections/CoreSystem'
>>>>>>>
import { Studios } from '../../lib/collections/Studios'
import { PeripheralDevices } from '../../lib/collections/PeripheralDevices'
import { ShowStyleBases } from '../../lib/collections/ShowStyleBases'
import { CoreSystem } from '../../lib/collections/CoreSystem'
<<<<<<<
{
id: 'Studios: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
Studios.findOne({
organizationId: { $exists: false },
})
)
return 'Studio without organizationId'
return false
},
migrate: () => {
// add organizationId: null
Studios.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
{
id: 'PeripheralDevices: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
PeripheralDevices.findOne({
organizationId: { $exists: false },
})
)
return 'PeripheralDevice without organizationId'
return false
},
migrate: () => {
// add organizationId: null
PeripheralDevices.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
{
id: 'ShowStyleBases: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
ShowStyleBases.findOne({
organizationId: { $exists: false },
})
)
return 'ShowStyleBase without organizationId'
return false
},
migrate: () => {
// add organizationId: null
ShowStyleBases.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
//
//
// setExpectedVersion('expectedVersion.playoutDevice', PeripheralDeviceAPI.DeviceType.PLAYOUT, '_process', '^1.0.0'),
// setExpectedVersion('expectedVersion.mosDevice', PeripheralDeviceAPI.DeviceType.MOS, '_process', '^1.0.0'),
// setExpectedVersion('expectedVersion.mediaManager', PeripheralDeviceAPI.DeviceType.MEDIA_MANAGER, '_process', '^1.0.0'),
=======
{
id: 'Fix serviceMessages in CoreSystem',
canBeRunAutomatically: true,
validate: () => {
const core = CoreSystem.findOne()
if (core) {
for (let [key, message] of Object.entries(core.serviceMessages)) {
if (typeof message.timestamp === 'string') {
return true
}
}
return false
}
return false
},
migrate: () => {
const core = CoreSystem.findOne()
if (core) {
for (let [key, message] of Object.entries(core.serviceMessages)) {
if (typeof message.timestamp !== 'number') {
core.serviceMessages[key] = {
...message,
timestamp: new Date(message.timestamp).getTime(),
}
}
}
}
},
},
>>>>>>>
{
id: 'Studios: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
Studios.findOne({
organizationId: { $exists: false },
})
)
return 'Studio without organizationId'
return false
},
migrate: () => {
// add organizationId: null
Studios.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
{
id: 'PeripheralDevices: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
PeripheralDevices.findOne({
organizationId: { $exists: false },
})
)
return 'PeripheralDevice without organizationId'
return false
},
migrate: () => {
// add organizationId: null
PeripheralDevices.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
{
id: 'ShowStyleBases: Default organizationId',
canBeRunAutomatically: true,
validate: () => {
if (
ShowStyleBases.findOne({
organizationId: { $exists: false },
})
)
return 'ShowStyleBase without organizationId'
return false
},
migrate: () => {
// add organizationId: null
ShowStyleBases.update(
{
organizationId: { $exists: false },
},
{
$set: {
organizationId: null,
},
}
)
},
},
//
//
// setExpectedVersion('expectedVersion.playoutDevice', PeripheralDeviceAPI.DeviceType.PLAYOUT, '_process', '^1.0.0'),
// setExpectedVersion('expectedVersion.mosDevice', PeripheralDeviceAPI.DeviceType.MOS, '_process', '^1.0.0'),
// setExpectedVersion('expectedVersion.mediaManager', PeripheralDeviceAPI.DeviceType.MEDIA_MANAGER, '_process', '^1.0.0'),
{
id: 'Fix serviceMessages in CoreSystem',
canBeRunAutomatically: true,
validate: () => {
const core = CoreSystem.findOne()
if (core) {
for (let [key, message] of Object.entries(core.serviceMessages)) {
if (typeof message.timestamp === 'string') {
return true
}
}
return false
}
return false
},
migrate: () => {
const core = CoreSystem.findOne()
if (core) {
for (let [key, message] of Object.entries(core.serviceMessages)) {
if (typeof message.timestamp !== 'number') {
core.serviceMessages[key] = {
...message,
timestamp: new Date(message.timestamp).getTime(),
}
}
}
}
},
}, |
<<<<<<<
export function bucketsRemoveBucket(context: MethodContext, id: BucketId) {
return ClientAPI.responseSuccess(BucketsAPI.removeBucket(context, id))
=======
export function bucketsRemoveBucket(id: BucketId) {
check(id, String)
return ClientAPI.responseSuccess(BucketsAPI.removeBucket(id))
>>>>>>>
export function bucketsRemoveBucket(context: MethodContext, id: BucketId) {
check(id, String)
return ClientAPI.responseSuccess(BucketsAPI.removeBucket(context, id)) |
<<<<<<<
checkAccessAndGetPeripheralDevice,
=======
extendIngestRundownCore,
modifyPlaylistExternalId,
>>>>>>>
checkAccessAndGetPeripheralDevice,
extendIngestRundownCore,
modifyPlaylistExternalId, |
<<<<<<<
import { takeNextPartInner, afterTake } from './take'
import { syncPlayheadInfinitesForNextPartInstance } from './infinites'
=======
import { PeripheralDeviceAPI } from '../../../lib/api/peripheralDevice'
import { check, Match } from '../../../lib/check'
>>>>>>>
import { takeNextPartInner, afterTake } from './take'
import { syncPlayheadInfinitesForNextPartInstance } from './infinites'
import { PeripheralDeviceAPI } from '../../../lib/api/peripheralDevice'
import { check, Match } from '../../../lib/check'
<<<<<<<
rundownPlaylistId: RundownPlaylistId,
=======
_context: MethodContext,
rundownId: RundownId,
>>>>>>>
_context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
<<<<<<<
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
const rundowns = Rundowns.find({ playlistId: rundownPlaylistId }).fetch()
=======
triggerWriteAccessBecauseNoCheckNecessary() // tmp
const playlistId = getRundown(rundownId).playlistId
// TODO - confirm this is correct
return rundownPlaylistSyncFunction(playlistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
>>>>>>>
triggerWriteAccessBecauseNoCheckNecessary() // tmp
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
const rundowns = Rundowns.find({ playlistId: rundownPlaylistId }).fetch()
<<<<<<<
rundownPlaylistId: RundownPlaylistId,
=======
_context: MethodContext,
rundownId: RundownId,
>>>>>>>
_context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
<<<<<<<
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
const rundowns = Rundowns.find({ playlistId: rundownPlaylistId }).fetch()
=======
triggerWriteAccessBecauseNoCheckNecessary() // tmp
const playlistId = getRundown(rundownId).playlistId
>>>>>>>
triggerWriteAccessBecauseNoCheckNecessary() // tmp
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
const rundowns = Rundowns.find({ playlistId: rundownPlaylistId }).fetch()
<<<<<<<
export function onPartPlaybackStarted(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
startedPlayback: Time
) {
check(rundownPlaylistId, String)
=======
export function onPartPlaybackStarted(
_context: MethodContext,
rundownId: RundownId,
partInstanceId: PartInstanceId,
startedPlayback: Time
) {
check(rundownId, String)
>>>>>>>
export function onPartPlaybackStarted(
_context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
startedPlayback: Time
) {
check(rundownPlaylistId, String)
<<<<<<<
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
=======
triggerWriteAccessBecauseNoCheckNecessary() // tmp
const playlistId = getRundown(rundownId).playlistId
return rundownPlaylistSyncFunction(playlistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
>>>>>>>
triggerWriteAccessBecauseNoCheckNecessary() // tmp
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
<<<<<<<
export function onPartPlaybackStopped(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
stoppedPlayback: Time
) {
check(rundownPlaylistId, String)
=======
export function onPartPlaybackStopped(
_context: MethodContext,
rundownId: RundownId,
partInstanceId: PartInstanceId,
stoppedPlayback: Time
) {
check(rundownId, String)
>>>>>>>
export function onPartPlaybackStopped(
_context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
stoppedPlayback: Time
) {
check(rundownPlaylistId, String)
<<<<<<<
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
=======
triggerWriteAccessBecauseNoCheckNecessary() // tmp
const playlistId = getRundown(rundownId).playlistId
return rundownPlaylistSyncFunction(playlistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
>>>>>>>
triggerWriteAccessBecauseNoCheckNecessary() // tmp
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.CALLBACK_PLAYOUT, () => {
<<<<<<<
=======
export function rundownTogglePartArgument(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
property: string,
value: string
) {
// @TODO Check for a better solution to validate security methods
const dbPlaylist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
check(rundownPlaylistId, String)
check(partInstanceId, String)
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
if (dbPlaylist.holdState === RundownHoldState.ACTIVE || dbPlaylist.holdState === RundownHoldState.PENDING) {
throw new Meteor.Error(403, `Part Arguments can not be toggled when hold is used!`)
}
const cache = waitForPromise(initCacheForRundownPlaylist(dbPlaylist))
const playlist = cache.RundownPlaylists.findOne(dbPlaylist._id) as RundownPlaylist
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found in cache!`)
let partInstance = cache.PartInstances.findOne(partInstanceId)
if (!partInstance) throw new Meteor.Error(404, `PartInstance "${partInstanceId}" not found!`)
const rundown = cache.Rundowns.findOne(partInstance.rundownId)
if (!rundown) throw new Meteor.Error(501, `Rundown "${partInstance.rundownId}" not found!`)
const rArguments = partInstance.part.runtimeArguments || {}
if (rArguments[property] === value) {
// unset property
const mUnset: any = {}
const mUnset1: any = {}
mUnset['runtimeArguments.' + property] = 1
mUnset1['part.runtimeArguments.' + property] = 1
cache.Parts.update(partInstance.part._id, {
$unset: mUnset,
$set: {
dirty: true,
},
})
cache.PartInstances.update(partInstance._id, {
$unset: mUnset1,
$set: {
dirty: true,
},
})
delete rArguments[property]
} else {
// set property
const mSet: any = {}
const mSet1: any = {}
mSet['runtimeArguments.' + property] = value
mSet1['part.runtimeArguments.' + property] = value
mSet.dirty = true
cache.Parts.update(partInstance.part._id, { $set: mSet })
cache.PartInstances.update(partInstance._id, { $set: mSet1 })
rArguments[property] = value
}
waitForPromise(refreshPart(cache, rundown, partInstance.part))
// Only take time to update the timeline if there's a point to do it
if (playlist.active) {
// If this part is rundown's next, check if current part has autoNext
if (playlist.nextPartInstanceId === partInstance._id && playlist.currentPartInstanceId) {
const currentPartInstance = cache.PartInstances.findOne(playlist.currentPartInstanceId)
if (currentPartInstance && currentPartInstance.part.autoNext) {
updateTimeline(cache, rundown.studioId)
}
// If this is rundown's current part, update immediately
} else if (playlist.currentPartInstanceId === partInstance._id) {
updateTimeline(cache, rundown.studioId)
}
}
waitForPromise(cache.saveAllToDatabase())
return ClientAPI.responseSuccess(undefined)
})
}
>>>>>>> |
<<<<<<<
currentSegment: false,
showThumbnailsInList: false
=======
currentSegment: false,
>>>>>>>
currentSegment: false,
showThumbnailsInList: false, |
<<<<<<<
constructor (localName: string, options?: any) {
this.localName = localName
=======
private _transform?: (o: T) => T
constructor (name: string, options: any) {
>>>>>>>
private _transform?: (o: T) => T
constructor (name: string, options?: any) { |
<<<<<<<
import { check, Match } from 'meteor/check'
import { Rundowns, Rundown, RundownHoldState, RundownData } from '../../../lib/collections/Rundowns'
=======
import { check } from 'meteor/check'
import { Rundowns, Rundown, RundownHoldState } from '../../../lib/collections/Rundowns'
>>>>>>>
import { check, Match } from 'meteor/check'
import { Rundowns, Rundown, RundownHoldState } from '../../../lib/collections/Rundowns'
<<<<<<<
getPreviousPartForSegment,
getNextPart
=======
getPartBeforeSegment,
selectNextPart,
isTooCloseToAutonext
>>>>>>>
getPartBeforeSegment,
selectNextPart,
isTooCloseToAutonext
<<<<<<<
activateRundown as libActivateRundown,
deactivateRundown as libDeactivateRundown,
deactivateRundownInner,
standDownStudio
=======
activateRundownPlaylist as libActivateRundownPlaylist,
deactivateRundownPlaylist as libDeactivateRundownPlaylist,
deactivateRundownPlaylistInner
>>>>>>>
activateRundownPlaylist as libActivateRundownPlaylist,
deactivateRundownPlaylist as libDeactivateRundownPlaylist,
deactivateRundownPlaylistInner,
standDownStudio
<<<<<<<
libResetRundown(rundown)
prepareStudioForBroadcast(rundown.getStudio(), true, rundown)
=======
libResetRundownPlaylist(playlist)
prepareStudioForBroadcast(playlist.getStudio())
>>>>>>>
libResetRundownPlaylist(playlist)
prepareStudioForBroadcast(playlist.getStudio(), true, playlist)
<<<<<<<
libResetRundown(rundown)
prepareStudioForBroadcast(rundown.getStudio(), true, rundown)
=======
libResetRundownPlaylist(playlist)
>>>>>>>
libResetRundownPlaylist(playlist)
prepareStudioForBroadcast(playlist.getStudio(), true, playlist)
<<<<<<<
libResetRundown(rundown)
prepareStudioForBroadcast(rundown.getStudio(), true, rundown)
=======
libResetRundownPlaylist(playlist)
>>>>>>>
libResetRundownPlaylist(playlist)
prepareStudioForBroadcast(playlist.getStudio(), true, playlist)
<<<<<<<
prepareStudioForBroadcast(rundown.getStudio(), true, rundown)
return libActivateRundown(rundown, rehearsal)
=======
return libActivateRundownPlaylist(playlist, rehearsal)
>>>>>>>
prepareStudioForBroadcast(playlist.getStudio(), true, playlist)
return libActivateRundownPlaylist(playlist, rehearsal)
<<<<<<<
standDownStudio(rundown.getStudio(), true)
return libDeactivateRundown(rundown)
=======
return libDeactivateRundownPlaylist(playlist)
>>>>>>>
standDownStudio(playlist.getStudio(), true)
return libDeactivateRundownPlaylist(playlist)
<<<<<<<
let previousPart = (rundown.currentPartId ?
rundownData.partsMap[rundown.currentPartId]
: null
)
let takePart = rundownData.partsMap[rundown.nextPartId]
if (!takePart) throw new Meteor.Error(404, 'takePart not found!')
let nextPart: Part | null = getNextPart(rundown, rundownData.parts, takePart) || null
=======
let previousPartInstance = rundownData.currentPartInstance || null
let takePartInstance = rundownData.nextPartInstance
if (!takePartInstance) throw new Meteor.Error(404, 'takePart not found!')
const takeRundown: Rundown | undefined = rundownData.rundownsMap[takePartInstance.rundownId]
if (!takeRundown) throw new Meteor.Error(500, `takeRundown: takeRundown not found! ("${takePartInstance.rundownId}")`)
// let takeSegment = rundownData.segmentsMap[takePart.segmentId]
const nextPart = selectNextPart(takePartInstance, rundownData.parts)
>>>>>>>
let previousPartInstance = rundownData.currentPartInstance || null
let takePartInstance = rundownData.nextPartInstance
if (!takePartInstance) throw new Meteor.Error(404, 'takePart not found!')
const takeRundown: Rundown | undefined = rundownData.rundownsMap[takePartInstance.rundownId]
if (!takeRundown) throw new Meteor.Error(500, `takeRundown: takeRundown not found! ("${takePartInstance.rundownId}")`)
// let takeSegment = rundownData.segmentsMap[takePart.segmentId]
const nextPart = selectNextPart(playlist, takePartInstance, rundownData.parts)
<<<<<<<
rundown = _.extend(rundown, m) as Rundown
libSetNextPart(rundown, nextPart, takePart)
=======
playlist = _.extend(playlist, m) as RundownPlaylist
// rundownData = {
// ...rundownData,
// previousPartInstance: rundownData.currentPartInstance,
// currentPartInstance: rundownData.nextPartInstance,
// nextPartInstance: undefined
// }
libSetNextPart(playlist, nextPart ? nextPart.part : null)
>>>>>>>
playlist = _.extend(playlist, m) as RundownPlaylist
// rundownData = {
// ...rundownData,
// previousPartInstance: rundownData.currentPartInstance,
// currentPartInstance: rundownData.nextPartInstance,
// nextPartInstance: undefined
// }
libSetNextPart(playlist, nextPart ? nextPart.part : null)
<<<<<<<
const takePart = rundown.currentPartId && Parts.findOne(rundown.currentPartId) || null
libSetNextPart(rundown, nextPart, takePart, setManually, nextTimeOffset)
=======
libSetNextPart(playlist, nextPart, setManually, nextTimeOffset)
>>>>>>>
libSetNextPart(playlist, nextPart, setManually, nextTimeOffset)
<<<<<<<
export function setNextSegment (
rundownId: string,
nextSegmentId: string | null
): ClientAPI.ClientResponse {
check(rundownId, String)
if (nextSegmentId) check(nextSegmentId, String)
return rundownSyncFunction(rundownId, RundownSyncFunctionPriority.Playout, () => {
const rundown = Rundowns.findOne(rundownId)
if (!rundown) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
if (!rundown.active) throw new Meteor.Error(501, `Rundown "${rundown._id}" is not active!`)
let nextSegment: Segment | null = null
if (nextSegmentId) {
nextSegment = Segments.findOne(nextSegmentId) || null
if (!nextSegment) throw new Meteor.Error(404, `Segment "${nextSegmentId}" not found!`)
}
libSetNextSegment(rundown, nextSegment)
return ClientAPI.responseSuccess()
})
}
export function activateHold (rundownId: string) {
check(rundownId, String)
=======
export function activateHold (rundownPlaylistId: string) {
check(rundownPlaylistId, String)
>>>>>>>
export function setNextSegment (
rundownPlaylistId: string,
nextSegmentId: string | null
): ClientAPI.ClientResponse {
check(rundownPlaylistId, String)
if (nextSegmentId) check(nextSegmentId, String)
return rundownSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.Playout, () => {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (!playlist.active) throw new Meteor.Error(501, `Rundown Playlist "${rundownPlaylistId}" is not active!`)
let nextSegment: Segment | null = null
if (nextSegmentId) {
nextSegment = Segments.findOne(nextSegmentId) || null
if (!nextSegment) throw new Meteor.Error(404, `Segment "${nextSegmentId}" not found!`)
const acceptableRundownIds = playlist.getRundownIDs()
if (acceptableRundownIds.indexOf(nextSegment.rundownId) === -1) {
throw new Meteor.Error(501, `Segment "${nextSegmentId}" does not belong to Rundown Playlist "${rundownPlaylistId}"!`)
}
}
libSetNextSegment(playlist, nextSegment)
return ClientAPI.responseSuccess()
})
}
export function activateHold (rundownPlaylistId: string) {
check(rundownPlaylistId, String)
<<<<<<<
let nextPart: Part | null = getNextPart(rundown, rundown.getParts(), playingPart) || null
setRundownStartedPlayback(rundown, startedPlayback) // Set startedPlayback on the rundown if this is the first item to be played
const rundownChange = {
previousPartId: null,
currentPartId: playingPart._id,
=======
setRundownStartedPlayback(playlist, rundown, startedPlayback) // Set startedPlayback on the rundown if this is the first item to be played
const playlistChange = literal<Partial<RundownPlaylist>>({
previousPartInstanceId: null,
currentPartInstanceId: playingPartInstance._id,
>>>>>>>
setRundownStartedPlayback(playlist, rundown, startedPlayback) // Set startedPlayback on the rundown if this is the first item to be played
const playlistChange = literal<Partial<RundownPlaylist>>({
previousPartInstanceId: null,
currentPartInstanceId: playingPartInstance._id,
<<<<<<<
export function sourceLayerOnPartStop (rundownId: string, partId: string, sourceLayerIds: string[] | string) {
check(rundownId, String)
check(partId, String)
check(sourceLayerIds, Match.OneOf(String, Array))
if (_.isString(sourceLayerIds)) sourceLayerIds = [sourceLayerIds]
=======
export function sourceLayerOnPartStop (rundownPlaylistId: string, partInstanceId: string, sourceLayerId: string) {
check(rundownPlaylistId, String)
check(partInstanceId, String)
check(sourceLayerId, String)
>>>>>>>
export function sourceLayerOnPartStop (rundownPlaylistId: string, partInstanceId: string, sourceLayerIds: string[] | string) {
check(rundownPlaylistId, String)
check(partInstanceId, String)
check(sourceLayerIds, Match.OneOf(String, Array))
if (_.isString(sourceLayerIds)) sourceLayerIds = [sourceLayerIds]
<<<<<<<
orderedPieces.forEach((piece) => {
if (sourceLayerIds.indexOf(piece.sourceLayerId) !== -1) {
if (!piece.userDuration) {
=======
orderedPieces.forEach((pieceInstance) => {
if (pieceInstance.piece.sourceLayerId === sourceLayerId) {
if (!pieceInstance.piece.userDuration) {
>>>>>>>
orderedPieces.forEach((pieceInstance) => {
if (sourceLayerIds.indexOf(pieceInstance.piece.sourceLayerId) !== -1) {
if (!pieceInstance.piece.userDuration) { |
<<<<<<<
waitForPromise,
PreparedChanges,
prepareSaveIntoDb,
savePreparedChanges,
Optional
=======
waitForPromise,
asyncCollectionFindOne,
waitForPromiseAll,
asyncCollectionRemove,
normalizeArray,
normalizeArrayFunc,
asyncCollectionInsert
>>>>>>>
waitForPromise,
PreparedChanges,
prepareSaveIntoDb,
savePreparedChanges,
asyncCollectionFindOne,
waitForPromiseAll,
asyncCollectionRemove,
normalizeArray,
normalizeArrayFunc,
asyncCollectionInsert,
Optional
<<<<<<<
import { extractExpectedPlayoutItems, updateExpectedPlayoutItemsOnRundown } from './expectedPlayoutItems'
import { ExpectedPlayoutItem, ExpectedPlayoutItems } from '../../../lib/collections/ExpectedPlayoutItems'
=======
import { RundownPlaylists, DBRundownPlaylist, RundownPlaylist } from '../../../lib/collections/RundownPlaylists'
import { Mongo } from 'meteor/mongo'
import { isTooCloseToAutonext } from '../playout/lib'
import { PartInstances, PartInstance } from '../../../lib/collections/PartInstances'
import { PieceInstances, wrapPieceToInstance, PieceInstance } from '../../../lib/collections/PieceInstances'
>>>>>>>
import { extractExpectedPlayoutItems, updateExpectedPlayoutItemsOnRundown } from './expectedPlayoutItems'
import { ExpectedPlayoutItem, ExpectedPlayoutItems } from '../../../lib/collections/ExpectedPlayoutItems'
import { RundownPlaylists, DBRundownPlaylist, RundownPlaylist } from '../../../lib/collections/RundownPlaylists'
import { Mongo } from 'meteor/mongo'
import { isTooCloseToAutonext } from '../playout/lib'
import { PartInstances, PartInstance } from '../../../lib/collections/PartInstances'
import { PieceInstances, wrapPieceToInstance, PieceInstance } from '../../../lib/collections/PieceInstances'
<<<<<<<
// Prepare updates:
const prepareSaveSegments = prepareSaveIntoDb(Segments, {
rundownId: rundownId
}, segments)
const prepareSaveParts = prepareSaveIntoDb<Part, DBPart>(Parts, {
rundownId: rundownId,
}, parts)
const prepareSavePieces = prepareSaveIntoDb<Piece, Piece>(Pieces, {
rundownId: rundownId,
dynamicallyInserted: { $ne: true } // do not affect dynamically inserted pieces (such as adLib pieces)
}, segmentPieces)
const prepareSaveAdLibPieces = prepareSaveIntoDb<AdLibPiece, AdLibPiece>(AdLibPieces, {
rundownId: rundownId,
}, adlibPieces)
// determine if update is allowed here
if (!isUpdateAllowed(dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundown(dbRundown._id)
return false
}
changes = sumChanges(
changes,
=======
const allChanges = sumChanges(
rundownChanges,
playlistChanges,
>>>>>>>
// Prepare updates:
const prepareSaveSegments = prepareSaveIntoDb(Segments, {
rundownId: rundownId
}, segments)
const prepareSaveParts = prepareSaveIntoDb<Part, DBPart>(Parts, {
rundownId: rundownId,
}, parts)
const prepareSavePieces = prepareSaveIntoDb<Piece, Piece>(Pieces, {
rundownId: rundownId,
dynamicallyInserted: { $ne: true } // do not affect dynamically inserted pieces (such as adLib pieces)
}, segmentPieces)
const prepareSaveAdLibPieces = prepareSaveIntoDb<AdLibPiece, AdLibPiece>(AdLibPieces, {
rundownId: rundownId,
}, adlibPieces)
// determine if update is allowed here
if (!isUpdateAllowed(dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundown(dbRundown._id)
return false
}
const allChanges = sumChanges(
rundownChanges,
playlistChanges,
<<<<<<<
const didChange = anythingChanged(changes)
=======
syncChangesToSelectedPartInstances(dbRundown.getRundownPlaylist(), parts, segmentPieces)
const didChange = anythingChanged(allChanges)
>>>>>>>
syncChangesToSelectedPartInstances(dbRundown.getRundownPlaylist(), parts, segmentPieces)
const didChange = anythingChanged(allChanges)
<<<<<<<
updateExpectedPlayoutItemsOnRundown(rundown._id)
updatePartRanks(rundown._id)
=======
updatePartRanks(rundown)
>>>>>>>
updateExpectedPlayoutItemsOnRundown(rundown._id)
updatePartRanks(rundown) |
<<<<<<<
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
=======
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
>>>>>>>
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
<<<<<<<
if (!playlist.nextPartInstanceId) {
=======
if (!playlist.nextPartId) {
>>>>>>>
if (!playlist.nextPartInstanceId) {
<<<<<<<
if (playlist.currentPartInstanceId) {
const currentPartInstance = PartInstances.findOne(playlist.currentPartInstanceId)
if (currentPartInstance && currentPartInstance.part.timings) {
const lastStartedPlayback = _.last(currentPartInstance.part.timings.startedPlayback || []) || 0
const lastTake = _.last(currentPartInstance.part.timings.take || []) || 0
=======
if (playlist.currentPartId) {
const currentPart = Parts.findOne(playlist.currentPartId)
if (currentPart && currentPart.timings) {
const lastStartedPlayback = currentPart.timings.startedPlayback ? currentPart.timings.startedPlayback[currentPart.timings.startedPlayback.length - 1] : 0
const lastTake = currentPart.timings.take ? currentPart.timings.take[currentPart.timings.take.length - 1] : 0
>>>>>>>
if (playlist.currentPartInstanceId) {
const currentPartInstance = PartInstances.findOne(playlist.currentPartInstanceId)
if (currentPartInstance && currentPartInstance.part.timings) {
const lastStartedPlayback = _.last(currentPartInstance.part.timings.startedPlayback || []) || 0
const lastTake = _.last(currentPartInstance.part.timings.take || []) || 0
<<<<<<<
logger.error(`PartInstance "${playlist.currentPartInstanceId}", set as currentPart in "${rundownPlaylistId}", not found!`)
=======
logger.error(`Part "${playlist.currentPartId}", set as currentPart in "${rundownPlaylistId}", not found!`)
>>>>>>>
logger.error(`PartInstance "${playlist.currentPartInstanceId}", set as currentPart in "${rundownPlaylistId}", not found!`)
<<<<<<<
if (!playlist.nextPartInstanceId && !playlist.currentPartInstanceId) {
return ClientAPI.responseError('RundownPlaylist has no next and no current part!')
=======
if (!playlist.nextPartId && !playlist.currentPartId) {
return ClientAPI.responseError('RundownPlaylist has no next and no current part!')
>>>>>>>
if (!playlist.nextPartInstanceId && !playlist.currentPartInstanceId) {
return ClientAPI.responseError('RundownPlaylist has no next and no current part!')
<<<<<<<
export function togglePartArgument (rundownPlaylistId: string, partInstanceId: string, property: string, value: string) {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
=======
export function togglePartArgument(rundownPlaylistId: string, partId: string, property: string, value: string) {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
>>>>>>>
export function togglePartArgument (rundownPlaylistId: string, partInstanceId: string, property: string, value: string) {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
<<<<<<<
ServerPlayoutAPI.pieceTakeNow(rundownPlaylistId, partInstanceId, pieceInstanceIdOrPieceIdToCopy)
=======
ServerPlayoutAPI.pieceTakeNow(rundownPlaylistId, partId, pieceId)
>>>>>>>
ServerPlayoutAPI.pieceTakeNow(rundownPlaylistId, partInstanceId, pieceInstanceIdOrPieceIdToCopy)
<<<<<<<
export function segmentAdLibPieceStart (rundownPlaylistId: string, rundownId: string, partInstanceId: string, adlibPieceId: string, queue: boolean) {
check(rundownPlaylistId, String)
check(rundownId, String)
check(partInstanceId, String)
check(adlibPieceId, String)
=======
export function segmentAdLibPieceStart (rundownPlaylistId: string, partId: string, slaiId: string, queue: boolean) {
check(rundownPlaylistId, String)
check(partId, String)
check(slaiId, String)
>>>>>>>
export function segmentAdLibPieceStart (rundownPlaylistId: string, partInstanceId: string, adlibPieceId: string, queue: boolean) {
check(rundownPlaylistId, String)
check(partInstanceId, String)
check(adlibPieceId, String)
<<<<<<<
ServerPlayoutAPI.stopAdLibPiece(rundownPlaylistId, rundownId, partInstanceId, pieceInstanceId)
=======
ServerPlayoutAPI.stopAdLibPiece(rundownPlaylistId, partId, pieceId)
>>>>>>>
ServerPlayoutAPI.stopAdLibPiece(rundownPlaylistId, partInstanceId, pieceInstanceId)
<<<<<<<
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) return ClientAPI.responseError(`The Rundown isn't active, please activate it before starting a sticky-item!`)
if (!playlist.currentPartInstanceId) return ClientAPI.responseError(`No part is playing, please Take a part before starting a sticky-item.`)
=======
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) return ClientAPI.responseError(`The Rundown isn't active, please activate it before starting a sticky-item!`)
if (!playlist.currentPartId) return ClientAPI.responseError(`No part is playing, please Take a part before starting a sticky-item.`)
>>>>>>>
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) return ClientAPI.responseError(`The Rundown isn't active, please activate it before starting a sticky-item!`)
if (!playlist.currentPartInstanceId) return ClientAPI.responseError(`No part is playing, please Take a part before starting a sticky-item.`)
<<<<<<<
let rundown = RundownPlaylists.findOne(rundownId)
if (!rundown) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
if (rundown.active) return ClientAPI.responseError(`The Rundown is currently active, you can't remove an active Rundown!`)
=======
let playlist = Rundowns.findOne(rundownId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
>>>>>>>
let playlist = Rundowns.findOne(rundownId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`) |
<<<<<<<
getRundownIDs (selector?: MongoQuery<DBRundown>, options?: FindOptions<DBRundown>): RundownId[] {
return this.getRundowns(selector, _.extend({
sort: {
_rank: 1,
_id: 1
},
fields: {
_rank: 1,
_id: 1
}
}, options)).map(i => i._id)
=======
getRundownIDs(selector?: MongoSelector<DBRundownPlaylist>, options?: FindOptions): RundownId[] {
return this.getRundowns(
selector,
_.extend(
{
sort: {
_rank: 1,
_id: 1,
},
fields: {
_rank: 1,
_id: 1,
},
},
options
)
).map((i) => i._id)
>>>>>>>
getRundownIDs(selector?: MongoQuery<DBRundown>, options?: FindOptions<DBRundown>): RundownId[] {
return this.getRundowns(
selector,
_.extend(
{
sort: {
_rank: 1,
_id: 1,
},
fields: {
_rank: 1,
_id: 1,
},
},
options
)
).map((i) => i._id)
<<<<<<<
async getSegmentsAndParts (rundowns0?: DBRundown[]): Promise<{ segments: Segment[], parts: Part[] }> {
=======
async getSegmentsAndParts(rundowns0?: DBRundown[]): Promise<{ segments: Segment[]; parts: Part[] }> {
>>>>>>>
async getSegmentsAndParts(rundowns0?: DBRundown[]): Promise<{ segments: Segment[]; parts: Part[] }> {
<<<<<<<
getSegmentsAndPartsSync (segmentsQuery?: Mongo.Query<DBSegment> | Mongo.QueryWithModifiers<DBSegment>, partsQuery?: Mongo.Query<DBPart> | Mongo.QueryWithModifiers<DBPart>): { segments: Segment[], parts: Part[] } {
=======
getSegmentsAndPartsSync(
segmentsQuery?: Mongo.Query<DBSegment> | Mongo.QueryWithModifiers<DBSegment>,
partsQuery?: Mongo.Query<DBPart> | Mongo.QueryWithModifiers<DBPart>
): { segments: Segment[]; parts: Part[] } {
>>>>>>>
getSegmentsAndPartsSync(
segmentsQuery?: Mongo.Query<DBSegment> | Mongo.QueryWithModifiers<DBSegment>,
partsQuery?: Mongo.Query<DBPart> | Mongo.QueryWithModifiers<DBPart>
): { segments: Segment[]; parts: Part[] } {
<<<<<<<
getAllStoredNotes (): Array<GenericNote & { rank: number }> {
const rundownNotes: RundownNote[] = _.flatten(_.compact(this.getRundowns({}, {
fields: {
notes: 1
}
}).map(r => r.notes)))
=======
getAllStoredNotes(): Array<GenericNote & { rank: number }> {
const rundownNotes: RundownNote[] = _.flatten(
_.compact(
this.getRundowns(
{},
{
fields: {
notes: 1,
},
}
).map((r) => r.notes)
)
)
>>>>>>>
getAllStoredNotes(): Array<GenericNote & { rank: number }> {
const rundownNotes: RundownNote[] = _.flatten(
_.compact(
this.getRundowns(
{},
{
fields: {
notes: 1,
},
}
).map((r) => r.notes)
)
)
<<<<<<<
notes = notes.concat(rundownNotes.map(note => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(this.getSegments({}, {
fields: {
_rank: 1,
notes: 1
}
}).map(segment => [segment._id, {
rank: segment._rank,
notes: segment.notes
}])) as { [key: string]: { notes: GenericNote[], rank: number } }
this.getUnorderedParts({}, {
fields: {
segmentId: 1,
notes: 1
=======
notes = notes.concat(rundownNotes.map((note) => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(
this.getSegments(
{},
{
fields: {
rank: 1,
notes: 1,
},
}
).map((segment) => [
segment._id,
{
rank: segment._rank,
notes: segment.notes,
},
])
) as { [key: string]: { notes: GenericNote[]; rank: number } }
this.getUnorderedParts(
{},
{
fields: {
segmentId: 1,
notes: 1,
},
>>>>>>>
notes = notes.concat(rundownNotes.map((note) => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(
this.getSegments(
{},
{
fields: {
_rank: 1,
notes: 1,
},
}
).map((segment) => [
segment._id,
{
rank: segment._rank,
notes: segment.notes,
},
])
) as { [key: string]: { notes: GenericNote[]; rank: number } }
this.getUnorderedParts(
{},
{
fields: {
segmentId: 1,
notes: 1,
}, |
<<<<<<<
rundowns.map((i) => {
const cache = waitForPromise(initCacheForRundownPlaylistFromRundown(i._id)) // todo: is this correct? - what if rundown has no playlist?
updateExpectedMediaItemsOnRundown(cache, i._id)
waitForPromise(cache.saveAllToDatabase())
})
}
})
}
=======
const cache = waitForPromise(initCacheForRundownPlaylistFromRundown(rundown._id))
const prevPart = previousPartId ? cache.Parts.findOne(previousPartId) : undefined
updateSourceLayerInfinitesAfterPart(cache, rundown, prevPart, runToEnd)
waitForPromise(cache.saveAllToDatabase())
logger.info('debug_updateSourceLayerInfinitesAfterPart: done')
},
debug_recreateExpectedMediaItems() {
const rundowns = Rundowns.find().fetch()
rundowns.map((i) => {
const cache = waitForPromise(initCacheForRundownPlaylistFromRundown(i._id)) // todo: is this correct? - what if rundown has no playlist?
updateExpectedMediaItemsOnRundown(cache, i._id)
waitForPromise(cache.saveAllToDatabase())
})
},
})
>>>>>>>
rundowns.map((i) => {
const cache = waitForPromise(initCacheForRundownPlaylistFromRundown(i._id)) // todo: is this correct? - what if rundown has no playlist?
updateExpectedMediaItemsOnRundown(cache, i._id)
waitForPromise(cache.saveAllToDatabase())
})
},
})
} |
<<<<<<<
import { PartInstance } from '../../../lib/collections/PartInstances'
import { PieceInstance } from '../../../lib/collections/PieceInstances'
=======
import { isNumber } from 'util'
>>>>>>>
import { PartInstance } from '../../../lib/collections/PartInstances'
import { PieceInstance } from '../../../lib/collections/PieceInstances'
import { isNumber } from 'util' |
<<<<<<<
import { getCurrentTime, literal, protectString, unprotectString, getRandomId, waitForPromise, unprotectStringArray } from '../../../lib/lib'
=======
import {
getCurrentTime,
literal,
protectString,
unprotectString,
getRandomId,
waitForPromise,
MeteorPromiseCall,
} from '../../../lib/lib'
>>>>>>>
import {
getCurrentTime,
literal,
protectString,
unprotectString,
getRandomId,
waitForPromise,
unprotectStringArray,
} from '../../../lib/lib'
<<<<<<<
const sourceLayer = showStyleBase.sourceLayers.find(i => i._id === pieceToCopy.sourceLayerId)
if (sourceLayer && sourceLayer.type !== SourceLayerType.GRAPHICS) throw new Meteor.Error(403, `PieceInstance or Piece "${pieceInstanceIdOrPieceIdToCopy}" is not a GRAPHICS item!`)
=======
const sourceL = showStyleBase.sourceLayers.find((i) => i._id === pieceToCopy.sourceLayerId)
if (sourceL && sourceL.type !== SourceLayerType.GRAPHICS)
throw new Meteor.Error(
403,
`PieceInstance or Piece "${pieceInstanceIdOrPieceIdToCopy}" is not a GRAPHICS item!`
)
>>>>>>>
const sourceLayer = showStyleBase.sourceLayers.find((i) => i._id === pieceToCopy.sourceLayerId)
if (sourceLayer && sourceLayer.type !== SourceLayerType.GRAPHICS)
throw new Meteor.Error(
403,
`PieceInstance or Piece "${pieceInstanceIdOrPieceIdToCopy}" is not a GRAPHICS item!`
)
<<<<<<<
=======
if (newPieceInstance.piece.content && newPieceInstance.piece.content.timelineObjects) {
newPieceInstance.piece.content.timelineObjects = prefixAllObjectIds(
_.compact(
_.map(newPieceInstance.piece.content.timelineObjects, (obj) => {
return literal<TimelineObjGeneric>({
...obj,
// @ts-ignore _id
_id: obj.id || obj._id,
studioId: protectString(''), // set later
objectType: TimelineObjType.RUNDOWN,
})
})
),
unprotectString(newPieceInstance._id)
)
}
>>>>>>>
<<<<<<<
// stopInfinitesRunningOnLayer(cache, rundownPlaylist, rundown, partInstance, newPieceInstance.piece.sourceLayerId)
updateSourceLayerInfinitesAfterPart(cache, rundown, partInstance.part)
=======
stopInfinitesRunningOnLayer(
cache,
rundownPlaylist,
rundown,
partInstance,
newPieceInstance.piece.sourceLayerId
)
>>>>>>>
// stopInfinitesRunningOnLayer(cache, rundownPlaylist, rundown, partInstance, newPieceInstance.piece.sourceLayerId)
updateSourceLayerInfinitesAfterPart(cache, rundown, partInstance.part)
<<<<<<<
function innerStartOrQueueAdLibPiece(cache: CacheForRundownPlaylist,
=======
function innerStartAdLibPiece(
cache: CacheForRundownPlaylist,
>>>>>>>
function innerStartOrQueueAdLibPiece(
cache: CacheForRundownPlaylist,
<<<<<<<
export function sourceLayerStickyPieceStart(rundownPlaylistId: RundownPlaylistId, sourceLayerId: string) {
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (!playlist.currentPartInstanceId) throw new Meteor.Error(400, `A part needs to be active to place a sticky item`)
=======
// insert a NEW, adlibbed part after this part
partInstanceId = adlibQueueInsertPartInstance(
cache,
rundownPlaylist,
rundown,
previousPartInstance,
adLibPiece
)
}
let partInstance = cache.PartInstances.findOne({
_id: partInstanceId,
rundownId: rundown._id,
})
if (!partInstance) throw new Meteor.Error(404, `PartInstance "${partInstanceId}" not found!`)
>>>>>>>
export function sourceLayerStickyPieceStart(rundownPlaylistId: RundownPlaylistId, sourceLayerId: string) {
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (!playlist.currentPartInstanceId)
throw new Meteor.Error(400, `A part needs to be active to place a sticky item`)
<<<<<<<
// TODO-PartInstance - pending new data flow - the call to setNextPart will prune the partInstance, so this will not be needed
const afterPartId = currentPartInstance.part.afterPart || currentPartInstance.part._id
const alreadyQueuedPartInstance = cache.PartInstances.findOne({
rundownId: rundown._id,
segmentId: currentPartInstance.segmentId,
'part.afterPart': afterPartId,
'part._rank': { $gt: currentPartInstance.part._rank }
}, {
sort: { _rank: -1, _id: -1 }
})
=======
const afterPartId = afterPartInstance.part.afterPart || afterPartInstance.part._id
const alreadyQueuedPartInstance = cache.PartInstances.findOne(
{
rundownId: rundown._id,
segmentId: afterPartInstance.segmentId,
'part.afterPart': afterPartId,
'part._rank': { $gt: afterPartInstance.part._rank },
},
{
sort: { _rank: -1, _id: -1 },
}
)
>>>>>>>
// TODO-PartInstance - pending new data flow - the call to setNextPart will prune the partInstance, so this will not be needed
const afterPartId = currentPartInstance.part.afterPart || currentPartInstance.part._id
const alreadyQueuedPartInstance = cache.PartInstances.findOne(
{
rundownId: rundown._id,
segmentId: currentPartInstance.segmentId,
'part.afterPart': afterPartId,
'part._rank': { $gt: currentPartInstance.part._rank },
},
{
sort: { _rank: -1, _id: -1 },
}
)
<<<<<<<
// Ensure it is labelled as dynamic
newPartInstance.part.afterPart = afterPartId
newPartInstance.part.dynamicallyInserted = true
=======
const newPartInstanceId = protectString<PartInstanceId>(Random.id())
const newPart = literal<DBPart>({
_id: getRandomId(),
_rank: 99999, // something high, so it will be placed after current part. The rank will be updated later to its correct value
externalId: '',
segmentId: afterPartInstance.segmentId,
rundownId: rundown._id,
title: adLibPiece.name,
dynamicallyInserted: true,
afterPart: afterPartInstance.part.afterPart || afterPartInstance.part._id,
typeVariant: 'adlib',
prerollDuration: adLibPiece.adlibPreroll,
expectedDuration: adLibPiece.expectedDuration,
})
cache.PartInstances.insert({
_id: newPartInstanceId,
rundownId: newPart.rundownId,
segmentId: newPart.segmentId,
takeCount: afterPartInstance.takeCount + 1,
part: new Part(newPart),
})
>>>>>>>
// Ensure it is labelled as dynamic
newPartInstance.part.afterPart = afterPartId
newPartInstance.part.dynamicallyInserted = true
<<<<<<<
cache.PieceInstances.insert(pieceInstance)
// TODO-PartInstance - pending new data flow
cache.Pieces.insert(pieceInstance.piece)
})
=======
return newPartInstanceId
}
export function sourceLayerStickyPieceStart(rundownPlaylistId: RundownPlaylistId, sourceLayerId: string) {
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
const playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (!playlist.currentPartInstanceId)
throw new Meteor.Error(400, `A part needs to be active to place a sticky item`)
>>>>>>>
cache.PieceInstances.insert(pieceInstance)
// TODO-PartInstance - pending new data flow
cache.Pieces.insert(pieceInstance.piece)
})
<<<<<<<
=======
if (!queue && rundownPlaylist.currentPartInstanceId !== partInstanceId)
throw new Meteor.Error(403, `Part AdLib-pieces can be only placed in a currently playing part!`)
>>>>>>> |
<<<<<<<
/** If true, enables security measures, access control and user accounts. */
enableUserAccounts: boolean
=======
/** Allow Segments to become unsynced, rather than the entire rundown */
allowUnsyncedSegments: boolean
>>>>>>>
/** If true, enables security measures, access control and user accounts. */
enableUserAccounts: boolean
/** Allow Segments to become unsynced, rather than the entire rundown */
allowUnsyncedSegments: boolean
<<<<<<<
allowGrabbingTimeline: true,
enableUserAccounts: true
=======
allowGrabbingTimeline: true,
allowUnsyncedSegments: false
>>>>>>>
allowGrabbingTimeline: true,
enableUserAccounts: true,
allowUnsyncedSegments: false |
<<<<<<<
=======
let methods: Methods = {}
methods[PlayoutAPI.methods.rundownPrepareForBroadcast] = (playlistId: string) => {
return ServerPlayoutAPI.prepareRundownForBroadcast(playlistId)
}
methods[PlayoutAPI.methods.rundownResetRundown] = (playlistId: string) => {
return ServerPlayoutAPI.resetRundown(playlistId)
}
methods[PlayoutAPI.methods.rundownResetAndActivate] = (playlistId: string, rehearsal?: boolean) => {
return ServerPlayoutAPI.resetAndActivateRundown(playlistId, rehearsal)
}
methods[PlayoutAPI.methods.rundownActivate] = (playlistId: string, rehearsal: boolean) => {
return ServerPlayoutAPI.activateRundown(playlistId, rehearsal)
}
methods[PlayoutAPI.methods.rundownDeactivate] = (playlistId: string) => {
return ServerPlayoutAPI.deactivateRundown(playlistId)
}
methods[PlayoutAPI.methods.reloadData] = (playlistId: string) => {
return ServerPlayoutAPI.reloadData(playlistId)
}
methods[PlayoutAPI.methods.pieceTakeNow] = (playlistId: string, partInstanceId: string, pieceInstanceIdOrPieceIdToCopy: string) => {
return ServerPlayoutAPI.pieceTakeNow(playlistId, partInstanceId, pieceInstanceIdOrPieceIdToCopy)
}
methods[PlayoutAPI.methods.rundownTake] = (playlistId: string) => {
return ServerPlayoutAPI.takeNextPart(playlistId)
}
methods[PlayoutAPI.methods.rundownTogglePartArgument] = (playlistId: string, partId: string, property: string, value: string) => {
return ServerPlayoutAPI.rundownTogglePartArgument(playlistId, partId, property, value)
}
methods[PlayoutAPI.methods.rundownSetNext] = (playlistId: string, partId: string, timeOffset?: number | undefined) => {
return ServerPlayoutAPI.setNextPart(playlistId, partId, true, timeOffset)
}
methods[PlayoutAPI.methods.rundownMoveNext] = (playlistId: string, horisontalDelta: number, verticalDelta: number) => {
return ServerPlayoutAPI.moveNextPart(playlistId, horisontalDelta, verticalDelta, true)
}
methods[PlayoutAPI.methods.rundownActivateHold] = (playlistId: string) => {
return ServerPlayoutAPI.activateHold(playlistId)
}
methods[PlayoutAPI.methods.rundownDisableNextPiece] = (rundownPlaylistId: string, undo?: boolean) => {
return ServerPlayoutAPI.disableNextPiece(rundownPlaylistId, undo)
}
// methods[PlayoutAPI.methods.partPlaybackStartedCallback] = (rundownId: string, partId: string, startedPlayback: number) => {
// return ServerPlayoutAPI.onPartPlaybackStarted(rundownId, partId, startedPlayback)
// }
// methods[PlayoutAPI.methods.piecePlaybackStartedCallback] = (rundownId: string, pieceId: string, startedPlayback: number) => {
// return ServerPlayoutAPI.onPiecePlaybackStarted(rundownId, pieceId, startedPlayback)
// }
methods[PlayoutAPI.methods.segmentAdLibPieceStart] = (rundownPlaylistId: string, partId: string, pieceId: string, queue: boolean) => {
return ServerPlayoutAPI.segmentAdLibPieceStart(rundownPlaylistId, partId, pieceId, queue)
}
methods[PlayoutAPI.methods.rundownBaselineAdLibPieceStart] = (rundownPlaylistId: string, partId: string, pieceId: string, queue: boolean) => {
return ServerPlayoutAPI.rundownBaselineAdLibPieceStart(rundownPlaylistId, partId, pieceId, queue)
}
methods[PlayoutAPI.methods.sourceLayerOnPartStop] = (rundownPlaylistId: string, partId: string, sourceLayerIds: string[]) => {
return ServerPlayoutAPI.sourceLayerOnPartStop(rundownPlaylistId, partId, sourceLayerIds)
}
// methods[PlayoutAPI.methods.timelineTriggerTimeUpdateCallback] = (timelineObjId: string, time: number) => {
// return ServerPlayoutAPI.timelineTriggerTimeUpdateCallback(timelineObjId, time)
// }
methods[PlayoutAPI.methods.sourceLayerStickyPieceStart] = (playlistId: string, sourceLayerId: string) => {
return ServerPlayoutAPI.sourceLayerStickyPieceStart(playlistId, sourceLayerId)
}
methods[PlayoutAPI.methods.updateStudioBaseline] = (studioId: string) => {
return ServerPlayoutAPI.updateStudioBaseline(studioId)
}
methods[PlayoutAPI.methods.shouldUpdateStudioBaseline] = (studioId: string) => {
return ServerPlayoutAPI.shouldUpdateStudioBaseline(studioId)
}
// Apply methods:
setMeteorMethods(methods)
>>>>>>> |
<<<<<<<
getRundownIDs (selector?: MongoSelector<DBRundownPlaylist>, options?: FindOptions<DBRundown>): RundownId[] {
return this.getRundowns(selector, _.extend({
sort: {
_rank: 1,
_id: 1
},
fields: {
_rank: 1,
_id: 1
}
}, options)).map(i => i._id)
=======
getRundownIDs(selector?: MongoSelector<DBRundownPlaylist>, options?: FindOptions): RundownId[] {
return this.getRundowns(
selector,
_.extend(
{
sort: {
_rank: 1,
_id: 1,
},
fields: {
_rank: 1,
_id: 1,
},
},
options
)
).map((i) => i._id)
>>>>>>>
getRundownIDs(selector?: MongoSelector<DBRundownPlaylist>, options?: FindOptions<DBRundown>): RundownId[] {
return this.getRundowns(
selector,
_.extend(
{
sort: {
_rank: 1,
_id: 1,
},
fields: {
_rank: 1,
_id: 1,
},
},
options
)
).map((i) => i._id)
<<<<<<<
notes = notes.concat(rundownNotes.map(note => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(this.getSegments({}, {
fields: {
_rank: 1,
notes: 1
}
}).map(segment => [segment._id, {
rank: segment._rank,
notes: segment.notes
}])) as { [key: string]: { notes: GenericNote[], rank: number } }
this.getUnorderedParts({}, {
fields: {
segmentId: 1,
notes: 1
=======
notes = notes.concat(rundownNotes.map((note) => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(
this.getSegments(
{},
{
fields: {
rank: 1,
notes: 1,
},
}
).map((segment) => [
segment._id,
{
rank: segment._rank,
notes: segment.notes,
},
])
) as { [key: string]: { notes: GenericNote[]; rank: number } }
this.getUnorderedParts(
{},
{
fields: {
segmentId: 1,
notes: 1,
},
>>>>>>>
notes = notes.concat(rundownNotes.map((note) => _.extend(note, { rank: 0 })))
const segmentNotes = _.object(
this.getSegments(
{},
{
fields: {
_rank: 1,
notes: 1,
},
}
).map((segment) => [
segment._id,
{
rank: segment._rank,
notes: segment.notes,
},
])
) as { [key: string]: { notes: GenericNote[]; rank: number } }
this.getUnorderedParts(
{},
{
fields: {
segmentId: 1,
notes: 1,
}, |
<<<<<<<
=======
import { Timeline, getTimelineId, TimelineComplete, TimelineHash } from '../../lib/collections/Timeline'
import { Studios } from '../../lib/collections/Studios'
>>>>>>>
import { Timeline, TimelineComplete, TimelineHash } from '../../lib/collections/Timeline'
<<<<<<<
import { initCacheForNoRundownPlaylist, initCacheForRundownPlaylist, CacheForRundownPlaylist } from '../DatabaseCaches'
import { RundownPlaylist } from '../../lib/collections/RundownPlaylists'
import { getActiveRundownPlaylistsInStudio } from './playout/studio'
import { StudioId } from '../../lib/collections/Studios'
=======
import { initCacheForNoRundownPlaylist, initCacheForStudio, initCacheForRundownPlaylist } from '../DatabaseCaches'
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PieceInstanceId } from '../../lib/collections/PieceInstances'
import { getValidActivationCache } from '../ActivationCache'
import { UserActionsLog } from '../../lib/collections/UserActionsLog'
>>>>>>>
import { initCacheForNoRundownPlaylist, initCacheForRundownPlaylist, CacheForRundownPlaylist } from '../DatabaseCaches'
import { RundownPlaylist } from '../../lib/collections/RundownPlaylists'
import { getActiveRundownPlaylistsInStudio } from './playout/studio'
import { StudioId } from '../../lib/collections/Studios'
import { getValidActivationCache } from '../ActivationCache'
import { UserActionsLog } from '../../lib/collections/UserActionsLog'
<<<<<<<
disabled: true,
hidden: true,
=======
timeline: timelineObjs,
timelineHash: getRandomId(),
generated: getCurrentTime(),
>>>>>>>
disabled: true,
hidden: true, |
<<<<<<<
cache.saveTimelineThenAllToDatabase()
=======
if (actionContext.takeAfterExecute) {
return ServerPlayoutAPI.callTakeWithCache(context, rundownPlaylistId, now, cache)
} else {
if (
actionContext.currentPartState !== ActionPartChange.NONE ||
actionContext.nextPartState !== ActionPartChange.NONE
) {
updateTimeline(cache, playlist.studioId)
}
waitForPromise(cache.saveAllToDatabase())
}
>>>>>>>
if (actionContext.takeAfterExecute) {
return ServerPlayoutAPI.callTakeWithCache(context, rundownPlaylistId, now, cache)
} else {
if (
actionContext.currentPartState !== ActionPartChange.NONE ||
actionContext.nextPartState !== ActionPartChange.NONE
) {
updateTimeline(cache, playlist.studioId)
}
cache.saveTimelineThenAllToDatabase()
} |
<<<<<<<
import { ReloadRundownResponse } from '../../../lib/api/userActions'
import { INewsDeviceActions } from './iNewsDevice/actions'
import { waitForPromise } from '../../../lib/lib'
import { initCacheForRundownPlaylist } from '../../DatabaseCaches'
=======
import { TriggerReloadDataResponse } from '../../../lib/api/userActions'
import { Segment } from '../../../lib/collections/Segments'
import { GenericDeviceActions } from './genericDevice/actions'
>>>>>>>
import { TriggerReloadDataResponse } from '../../../lib/api/userActions'
import { waitForPromise } from '../../../lib/lib'
import { initCacheForRundownPlaylist } from '../../DatabaseCaches'
import { Segment } from '../../../lib/collections/Segments'
import { GenericDeviceActions } from './genericDevice/actions' |
<<<<<<<
import { getHash, formatDateAsTimecode, formatDurationAsTimecode, unprotectString, unprotectObject, unprotectObjectArray, protectString, check, getCurrentTime } from '../../../lib/lib'
=======
import {
getHash,
formatDateAsTimecode,
formatDurationAsTimecode,
unprotectString,
unprotectObject,
unprotectObjectArray,
protectString,
getCurrentTime,
} from '../../../lib/lib'
>>>>>>>
import {
getHash,
formatDateAsTimecode,
formatDurationAsTimecode,
unprotectString,
unprotectObject,
unprotectObjectArray,
protectString,
check,
getCurrentTime,
} from '../../../lib/lib' |
<<<<<<<
const infiniteGroup = createPartGroup(currentPartInstance, { duration: piece.piece.enable.duration || undefined })
infiniteGroup.id = getPartGroupId(unprotectString(piece._id)) + '_infinite' // This doesnt want to belong to a part, so force the ids
=======
const infiniteGroup = createPartGroup(currentPart, {
start: `#${currentPartGroup.id}.start`, // This gets overriden with a concrete time if the original piece is known to have already started
duration: piece.piece.enable.duration || undefined
})
infiniteGroup.id = getPartGroupId(piece._id) + '_infinite'
>>>>>>>
const infiniteGroup = createPartGroup(currentPartInstance, {
start: `#${currentPartGroup.id}.start`, // This gets overriden with a concrete time if the original piece is known to have already started
duration: piece.piece.enable.duration || undefined
})
infiniteGroup.id = getPartGroupId(unprotectString(piece._id)) + '_infinite' // This doesnt want to belong to a part, so force the ids |
<<<<<<<
getRandomId,
=======
getRandomId,
applyToArray,
>>>>>>>
getRandomId,
applyToArray,
<<<<<<<
let tloldo: TimelineObjGeneric | undefined = oldTimelineObjsMap[tlo.id]
// let tlo: TimelineObjGeneric | undefined = timelineObjs.find((x) => x._id === tloldo._id)
=======
let tloldo: TimelineObjGeneric | undefined = oldTimelineObjsMap[unprotectString(tlo._id)]
>>>>>>>
let tloldo: TimelineObjGeneric | undefined = oldTimelineObjsMap[tlo.id] |
<<<<<<<
blueprint: makeMethods(BlueprintAPIMethods),
client: makeMethods(ClientAPIMethods),
externalMessages: makeMethods(ExternalMessageQueueAPIMethods),
manualPlayout: makeMethods(ManualPlayoutAPIMethods),
migration: makeMethods(MigrationAPIMethods),
peripheralDevice: makeMethods(PeripheralDeviceAPIMethods),
playout: makeMethods(PlayoutAPIMethods),
rundown: makeMethods(RundownAPIMethods),
rundownLayout: makeMethods(RundownLayoutsAPIMethods),
snapshot: makeMethods(SnapshotAPIMethods),
showstyles: makeMethods(ShowStylesAPIMethods),
studio: makeMethods(StudiosAPIMethods),
systemStatus: makeMethods(SystemStatusAPIMethods),
testTools: makeMethods(TestToolsAPIMethods),
user: makeMethods(UserAPIMethods),
userAction: makeMethods(UserActionAPIMethods),
organization: makeMethods(OrganizationAPIMethods),
rundownNotifications: makeMethods(RundownNotificationsAPIMethods),
=======
blueprint: makeMethods(BlueprintAPIMethods),
client: makeMethods(ClientAPIMethods),
externalMessages: makeMethods(ExternalMessageQueueAPIMethods),
manualPlayout: makeMethods(ManualPlayoutAPIMethods),
migration: makeMethods(MigrationAPIMethods),
peripheralDevice: makeMethods(PeripheralDeviceAPIMethods),
playout: makeMethods(PlayoutAPIMethods),
rundown: makeMethods(RundownAPIMethods),
rundownLayout: makeMethods(RundownLayoutsAPIMethods),
snapshot: makeMethods(SnapshotAPIMethods),
showstyles: makeMethods(ShowStylesAPIMethods),
studio: makeMethods(StudiosAPIMethods),
systemStatus: makeMethods(SystemStatusAPIMethods),
testTools: makeMethods(TestToolsAPIMethods),
userAction: makeMethods(UserActionAPIMethods),
rundownNotifications: makeMethods(RundownNotificationsAPIMethods),
>>>>>>>
blueprint: makeMethods(BlueprintAPIMethods),
client: makeMethods(ClientAPIMethods),
externalMessages: makeMethods(ExternalMessageQueueAPIMethods),
manualPlayout: makeMethods(ManualPlayoutAPIMethods),
migration: makeMethods(MigrationAPIMethods),
peripheralDevice: makeMethods(PeripheralDeviceAPIMethods),
playout: makeMethods(PlayoutAPIMethods),
rundown: makeMethods(RundownAPIMethods),
rundownLayout: makeMethods(RundownLayoutsAPIMethods),
snapshot: makeMethods(SnapshotAPIMethods),
showstyles: makeMethods(ShowStylesAPIMethods),
studio: makeMethods(StudiosAPIMethods),
systemStatus: makeMethods(SystemStatusAPIMethods),
testTools: makeMethods(TestToolsAPIMethods),
user: makeMethods(UserAPIMethods),
userAction: makeMethods(UserActionAPIMethods),
organization: makeMethods(OrganizationAPIMethods),
rundownNotifications: makeMethods(RundownNotificationsAPIMethods),
<<<<<<<
userId?: UserId
/** Info about the connection that called the method. Undefined if called internally from server-side */
connection?: {
clientAddress: string
}
}
/** Abstarct class to be used when defining Mehod-classes */
export abstract class MethodContextAPI implements MethodContext {
public userId?: UserId
public connection?: {
=======
userId: string | null
connection: {
>>>>>>>
userId?: UserId
/** Info about the connection that called the method. Undefined if called internally from server-side */
connection?: {
clientAddress: string
} | null
}
/** Abstarct class to be used when defining Mehod-classes */
export abstract class MethodContextAPI implements MethodContext {
public userId?: UserId
public connection?: { |
<<<<<<<
let parts = playlist.getParts()
let segments = playlist.getSegments()
=======
const parts = rundown.getParts()
const partsInSegments: {[segmentId: string]: Part[]} = {}
const segmentsWithParts: Segment[] = []
_.each(rundown.getSegments(), segment => {
let partsInSegment = segment.getParts()
if (partsInSegment.length) {
segmentsWithParts.push(segment)
partsInSegments[segment._id] = partsInSegment
}
})
>>>>>>>
const partsInSegments: {[segmentId: string]: Part[]} = {}
const segmentsWithParts = playlist.getSegments()
const parts: Part[] = []
_.each(segmentsWithParts, segment => {
let partsInSegment = segment.getParts()
if (partsInSegment.length) {
partsInSegments[segment._id] = partsInSegment
parts.push(...partsInSegment)
}
})
<<<<<<<
if ((part._id === playlist.currentPartId && !nextPartId0) || part.invalid) {
=======
if ((part._id === rundown.currentPartId && !nextPartId0) || part.invalid || part.floated) {
>>>>>>>
if ((part._id === playlist.currentPartId && !nextPartId0) || part.invalid || part.floated) { |
<<<<<<<
import { getCurrentTime, literal, protectString, unprotectString, getRandomId, waitForPromise } from '../../../lib/lib'
=======
import { getCurrentTime, literal, protectString, unprotectString, getRandomId, MeteorPromiseCall } from '../../../lib/lib'
>>>>>>>
import { getCurrentTime, literal, protectString, unprotectString, getRandomId, waitForPromise, MeteorPromiseCall } from '../../../lib/lib'
<<<<<<<
import { initCacheForRundownPlaylist, CacheForRundownPlaylist } from '../../DatabaseCaches'
=======
import { BucketAdLib, BucketAdLibs } from '../../../lib/collections/BucketAdlibs'
>>>>>>>
import { initCacheForRundownPlaylist, CacheForRundownPlaylist } from '../../DatabaseCaches'
import { BucketAdLib, BucketAdLibs } from '../../../lib/collections/BucketAdlibs'
<<<<<<<
cache.PieceInstances.update(pieceInstanceToCopy._id, {$set: {
'piece.disabled': true,
'piece.hidden': true
}})
=======
PieceInstances.update(pieceInstanceToCopy._id, {
$set: {
'piece.disabled': true,
'piece.hidden': true
}
})
>>>>>>>
cache.PieceInstances.update(pieceInstanceToCopy._id, {
$set: {
'piece.disabled': true,
'piece.hidden': true
}
})
<<<<<<<
cache.Pieces.update(pieceInstanceToCopy.piece._id, {$set: {
disabled: true,
hidden: true
}})
=======
Pieces.update(pieceInstanceToCopy.piece._id, {
$set: {
disabled: true,
hidden: true
}
})
>>>>>>>
cache.Pieces.update(pieceInstanceToCopy.piece._id, {
$set: {
disabled: true,
hidden: true
}
})
<<<<<<<
function innerStartAdLibPiece (
cache: CacheForRundownPlaylist,
rundownPlaylist: RundownPlaylist,
rundown: Rundown,
queue: boolean,
partInstanceId0: PartInstanceId,
adLibPiece: AdLibPiece
) {
=======
function innerStartAdLibPiece(rundownPlaylist: RundownPlaylist, rundown: Rundown, queue: boolean, partInstanceId0: PartInstanceId, adLibPiece: AdLibPiece | BucketAdLib) {
>>>>>>>
function innerStartAdLibPiece (
cache: CacheForRundownPlaylist,
rundownPlaylist: RundownPlaylist,
rundown: Rundown,
queue: boolean,
partInstanceId0: PartInstanceId,
adLibPiece: AdLibPiece | BucketAdLib
) {
<<<<<<<
function adlibQueueInsertPartInstance (
cache: CacheForRundownPlaylist,
rundownPlaylist: RundownPlaylist,
rundown: Rundown,
afterPartInstance: PartInstance,
adLibPiece: AdLibPiece
): PartInstanceId {
=======
function adlibQueueInsertPartInstance(rundownPlaylist: RundownPlaylist, rundown: Rundown, afterPartInstance: PartInstance, adLibPiece: AdLibPiece | BucketAdLib): PartInstanceId {
>>>>>>>
function adlibQueueInsertPartInstance (
cache: CacheForRundownPlaylist,
rundownPlaylist: RundownPlaylist,
rundown: Rundown,
afterPartInstance: PartInstance,
adLibPiece: AdLibPiece | BucketAdLib
): PartInstanceId { |
<<<<<<<
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment, loadCachedRundownData, LocalIngestRundown, LocalIngestSegment, makeNewIngestSegment, makeNewIngestPart, makeNewIngestRundown, updateIngestRundownWithData, isLocalIngestRundown } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated, getRundownPlaylist } from './lib'
=======
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment, loadCachedRundownData } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated, getRundownPlaylist, getSegment } from './lib'
>>>>>>>
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment, loadCachedRundownData, LocalIngestRundown, LocalIngestSegment, makeNewIngestSegment, makeNewIngestPart, makeNewIngestRundown, updateIngestRundownWithData, isLocalIngestRundown } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated, getRundownPlaylist, getSegment } from './lib'
<<<<<<<
import { CacheForRundownPlaylist, initCacheForRundownPlaylist } from '../../DatabaseCaches'
import { prepareSaveIntoCache, savePreparedChangesIntoCache, saveIntoCache } from '../../DatabaseCache'
=======
import { Settings } from '../../../lib/Settings'
>>>>>>>
import { CacheForRundownPlaylist, initCacheForRundownPlaylist } from '../../DatabaseCaches'
import { prepareSaveIntoCache, savePreparedChangesIntoCache, saveIntoCache } from '../../DatabaseCache'
import { Settings } from '../../../lib/Settings'
<<<<<<<
const prepareSaveSegments = prepareSaveIntoCache(cache.Segments, {
=======
let prepareSaveSegments = prepareSaveIntoDb(Segments, {
>>>>>>>
let prepareSaveSegments = prepareSaveIntoCache(cache.Segments, {
<<<<<<<
const prepareSaveParts = prepareSaveIntoCache(cache.Parts, {
=======
let prepareSaveParts = prepareSaveIntoDb<Part, DBPart>(Parts, {
>>>>>>>
let prepareSaveParts = prepareSaveIntoCache(cache.Parts, {
<<<<<<<
const prepareSavePieces = prepareSaveIntoCache(cache.Pieces, {
=======
let prepareSavePieces = prepareSaveIntoDb<Piece, Piece>(Pieces, {
>>>>>>>
let prepareSavePieces = prepareSaveIntoCache(cache.Pieces, {
<<<<<<<
const prepareSaveAdLibPieces = prepareSaveIntoCache<AdLibPiece, AdLibPiece>(cache.AdLibPieces, {
=======
let prepareSaveAdLibPieces = prepareSaveIntoDb<AdLibPiece, AdLibPiece>(AdLibPieces, {
>>>>>>>
let prepareSaveAdLibPieces = prepareSaveIntoCache<AdLibPiece, AdLibPiece>(cache.AdLibPieces, {
<<<<<<<
// determine if update is allowed here
if (!isUpdateAllowed(cache, dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundownInner(cache, dbRundown._id)
waitForPromise(cache.saveAllToDatabase())
return false
=======
if (Settings.allowUnsyncedSegments) {
if (!isUpdateAllowed(dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] })) {
ServerRundownAPI.unsyncRundown(dbRundown._id)
return false
} else {
const segmentChanges: SegmentChanges[] = splitIntoSegments(
prepareSaveSegments,
prepareSaveParts,
prepareSavePieces,
prepareSaveAdLibPieces
)
const approvedSegmentChanges: SegmentChanges[] = []
_.each(segmentChanges, segmentChange => {
if (isUpdateAllowed(dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, segmentChange.segment, segmentChange.parts)) {
approvedSegmentChanges.push(segmentChange)
} else {
ServerRundownAPI.unsyncSegment(segmentChange.segmentId)
}
})
prepareSaveSegments = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSaveParts = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSavePieces = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSaveAdLibPieces = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
approvedSegmentChanges.forEach((segmentChange) => {
for (const key in prepareSaveSegments) {
prepareSaveSegments[key].push(...segmentChange.segment[key])
prepareSaveParts[key].push(...segmentChange.parts[key])
prepareSavePieces[key].push(...segmentChange.pieces[key])
prepareSaveAdLibPieces[key].push(...segmentChange.adlibPieces[key])
}
})
}
} else {
if (!isUpdateAllowed(dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundown(dbRundown._id)
return false
}
>>>>>>>
if (Settings.allowUnsyncedSegments) {
if (!isUpdateAllowed(cache, dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundownInner(cache, dbRundown._id)
waitForPromise(cache.saveAllToDatabase())
return false
} else {
const segmentChanges: SegmentChanges[] = splitIntoSegments(
prepareSaveSegments,
prepareSaveParts,
prepareSavePieces,
prepareSaveAdLibPieces
)
const approvedSegmentChanges: SegmentChanges[] = []
_.each(segmentChanges, segmentChange => {
if (isUpdateAllowed(cache, dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, segmentChange.segment, segmentChange.parts)) {
approvedSegmentChanges.push(segmentChange)
} else {
ServerRundownAPI.unsyncSegmentInner(cache, rundownId, segmentChange.segmentId)
}
})
prepareSaveSegments = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSaveParts = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSavePieces = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
prepareSaveAdLibPieces = {
inserted: [],
changed: [],
removed: [],
unchanged: []
}
approvedSegmentChanges.forEach((segmentChange) => {
for (const key in prepareSaveSegments) {
prepareSaveSegments[key].push(...segmentChange.segment[key])
prepareSaveParts[key].push(...segmentChange.parts[key])
prepareSavePieces[key].push(...segmentChange.pieces[key])
prepareSaveAdLibPieces[key].push(...segmentChange.adlibPieces[key])
}
})
}
} else {
// determine if update is allowed here
if (!isUpdateAllowed(cache, dbPlaylist, dbRundown, { changed: [{ doc: dbRundown, oldId: dbRundown._id }] }, prepareSaveSegments, prepareSaveParts)) {
ServerRundownAPI.unsyncRundownInner(cache, dbRundown._id)
waitForPromise(cache.saveAllToDatabase())
return false
}
<<<<<<<
if (canBeUpdated(rundown, segmentId)) {
if (!isUpdateAllowed(cache, playlist, rundown, {}, { removed: [segment] }, {})) {
ServerRundownAPI.unsyncRundownInner(cache, rundown._id)
=======
if (canBeUpdated(rundown, segment)) {
if (!isUpdateAllowed(playlist, rundown, {}, { removed: [segment] }, {})) {
ServerRundownAPI.unsyncRundown(rundown._id)
>>>>>>>
if (canBeUpdated(rundown, segment)) {
if (!isUpdateAllowed(cache, playlist, rundown, {}, { removed: [segment] }, {})) {
ServerRundownAPI.unsyncRundownInner(cache, rundown._id)
<<<<<<<
if (!canBeUpdated(rundown, segmentId)) return
const cache = waitForPromise(initCacheForRundownPlaylist(playlist))
cache.defer(() => { // can we do this?
saveSegmentCache(rundown._id, segmentId, makeNewIngestSegment(ingestSegment))
})
const updatedSegmentId = updateSegmentFromIngestData(cache, studio, playlist, rundown, ingestSegment)
=======
const segment = Segments.findOne(segmentId) // Note: undefined is valid here, as it means this is a new segment
if (!canBeUpdated(rundown, segment)) return
saveSegmentCache(rundown._id, segmentId, ingestSegment)
const updatedSegmentId = updateSegmentFromIngestData(studio, playlist, rundown, ingestSegment)
>>>>>>>
const segment = Segments.findOne(segmentId) // Note: undefined is valid here, as it means this is a new segment
if (!canBeUpdated(rundown, segment)) return
const cache = waitForPromise(initCacheForRundownPlaylist(playlist))
cache.defer(() => { // can we do this?
saveSegmentCache(rundown._id, segmentId, makeNewIngestSegment(ingestSegment))
})
const updatedSegmentId = updateSegmentFromIngestData(cache, studio, playlist, rundown, ingestSegment)
<<<<<<<
const cache = waitForPromise(initCacheForRundownPlaylist(playlist))
if (canBeUpdated(rundown, segmentId, partId)) {
const part = cache.Parts.findOne({
=======
if (canBeUpdated(rundown, segment, partId)) {
const part = Parts.findOne({
>>>>>>>
const cache = waitForPromise(initCacheForRundownPlaylist(playlist))
if (canBeUpdated(rundown, segment, partId)) {
const part = cache.Parts.findOne({ |
<<<<<<<
import { removeRundownFromCache, removeRundownPlaylistFromCache, getRundownsSegmentsAndPartsFromCache } from './playout/lib'
import { AdLibActions, AdLibAction } from '../../lib/collections/AdLibActions'
=======
import {
removeRundownFromCache,
removeRundownPlaylistFromCache,
getRundownsSegmentsAndPartsFromCache,
} from './playout/lib'
>>>>>>>
import {
removeRundownFromCache,
removeRundownPlaylistFromCache,
getRundownsSegmentsAndPartsFromCache,
} from './playout/lib'
import { AdLibActions, AdLibAction } from '../../lib/collections/AdLibActions'
<<<<<<<
const rundownsInPlaylist = Rundowns.find({
playlistExternalId: playlist.externalId
}, {
sort: {
name: 1
}
}).fetch()
=======
const rundownsInPlaylist = Rundowns.find(
{
playlistExternalId: playlist.externalId,
},
{
sort: {
name: 1,
},
}
).fetch()
>>>>>>>
const rundownsInPlaylist = Rundowns.find(
{
playlistExternalId: playlist.externalId,
},
{
sort: {
name: 1,
},
}
).fetch()
<<<<<<<
saveIntoCache(cache.Parts, {
rundownId: rundownId,
segmentId: { $in: segmentIds }
}, [], {
afterRemoveAll(parts) {
afterRemoveParts(cache, rundownId, parts)
}
})
=======
saveIntoCache(
cache.Parts,
{
rundownId: rundownId,
segmentId: { $in: segmentIds },
},
[],
{
afterRemoveAll(parts) {
afterRemoveParts(cache, rundownId, parts)
},
}
)
>>>>>>>
saveIntoCache(
cache.Parts,
{
rundownId: rundownId,
segmentId: { $in: segmentIds },
},
[],
{
afterRemoveAll(parts) {
afterRemoveParts(cache, rundownId, parts)
},
}
)
<<<<<<<
saveIntoCache(cache.Parts, {
rundownId: rundownId,
dynamicallyInserted: true,
afterPart: { $in: _.map(removedParts, p => p._id) }
}, [], {
afterRemoveAll(parts) {
// Do the same for any affected dynamicallyInserted Parts
afterRemoveParts(cache, rundownId, parts)
}
})
=======
saveIntoCache(
cache.Parts,
{
rundownId: rundownId,
dynamicallyInserted: true,
afterPart: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(parts) {
// Do the same for any affected dynamicallyInserted Parts
afterRemoveParts(cache, rundownId, parts)
},
}
)
>>>>>>>
saveIntoCache(
cache.Parts,
{
rundownId: rundownId,
dynamicallyInserted: true,
afterPart: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(parts) {
// Do the same for any affected dynamicallyInserted Parts
afterRemoveParts(cache, rundownId, parts)
},
}
)
<<<<<<<
saveIntoCache<Piece, Piece>(cache.Pieces, {
rundownId: rundownId,
partId: { $in: _.map(removedParts, p => p._id) }
}, [], {
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
}
})
=======
saveIntoCache<Piece, Piece>(
cache.Pieces,
{
rundownId: rundownId,
partId: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
},
}
)
>>>>>>>
saveIntoCache<Piece, Piece>(
cache.Pieces,
{
rundownId: rundownId,
partId: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
},
}
)
<<<<<<<
saveIntoDb<AdLibPiece, AdLibPiece>(AdLibPieces, {
rundownId: rundownId,
partId: { $in: _.map(removedParts, p => p._id) }
}, [], {
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
}
})
AdLibActions.remove({
rundownId: rundownId,
partId: { $in: _.map(removedParts, p => p._id) }
})
AdLibActions.remove({
rundownId: rundownId,
partId: { $in: _.map(removedParts, p => p._id) }
})
=======
saveIntoDb<AdLibPiece, AdLibPiece>(
AdLibPieces,
{
rundownId: rundownId,
partId: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
},
}
)
>>>>>>>
saveIntoDb<AdLibPiece, AdLibPiece>(
AdLibPieces,
{
rundownId: rundownId,
partId: { $in: _.map(removedParts, (p) => p._id) },
},
[],
{
afterRemoveAll(pieces) {
afterRemovePieces(cache, rundownId, pieces)
},
}
)
AdLibActions.remove({
rundownId: rundownId,
partId: { $in: _.map(removedParts, (p) => p._id) },
})
<<<<<<<
export function unsyncSegmentInner(cache: CacheForRundownPlaylist, rundownId: RundownId, segmentId: SegmentId): void {
=======
export function unsyncSegmentInner(
cache: CacheForRundownPlaylist,
rundownId: RundownId,
segmentId: SegmentId
): void {
>>>>>>>
export function unsyncSegmentInner(
cache: CacheForRundownPlaylist,
rundownId: RundownId,
segmentId: SegmentId
): void {
<<<<<<<
cache.Segments.update(segmentId, {
$set: {
unsynced: true,
unsyncedTime: getCurrentTime()
}
})
=======
cache.Segments.update(segmentId, {
$set: {
unsynced: true,
unsyncedTime: getCurrentTime(),
},
})
>>>>>>>
cache.Segments.update(segmentId, {
$set: {
unsynced: true,
unsyncedTime: getCurrentTime(),
},
}) |
<<<<<<<
import { RundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
=======
import { RundownLayouts, RundownLayoutBase } from '../../lib/collections/RundownLayouts'
>>>>>>>
import { RundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { RundownLayouts, RundownLayoutBase } from '../../lib/collections/RundownLayouts' |
<<<<<<<
// export function fetchBefore<T>(
// collection: TransformedCollection<T, any>,
// selector: MongoQuery<T> = {},
// rank: number = Number.POSITIVE_INFINITY
// ): T {
// return collection
// .find(
// _.extend(selector, {
// _rank: { $lt: rank },
// }),
// {
// sort: {
// _rank: -1,
// _id: -1,
// },
// limit: 1,
// }
// )
// .fetch()[0]
// }
// export function fetchNext<T extends { _id: ProtectedString<any> }>(
// values: Array<T>,
// currentValue: T | undefined
// ): T | undefined {
// if (!currentValue) return values[0]
// let nextValue: T | undefined
// let found: boolean = false
// return _.find(values, (value) => {
// if (found) {
// nextValue = value
// return true
// }
// if (currentValue._id) {
// found = currentValue._id === value._id
// } else {
// found = currentValue === value
// }
// return false
// })
// }
/**
* Returns a rank number, to be used to insert new objects in a ranked list
* @param before The element before the one-to-be-inserted, null/undefined if inserted first
* @param after The element after the one-to-be-inserted, null/undefined if inserted last
* @param i If inserting multiple elements; the internal rank of the to-be-inserted element
* @param count If inserting multiple elements, this is total count of inserted elements
*/
export function getRank<T extends { _rank: number }>(
before: T | null | undefined,
after: T | null | undefined,
i: number = 0,
count: number = 1
): number {
let newRankMax
let newRankMin
if (after) {
if (before) {
newRankMin = before._rank
newRankMax = after._rank
} else {
// First
newRankMin = after._rank - 1
newRankMax = after._rank
}
} else {
if (before) {
// Last
newRankMin = before._rank
newRankMax = before._rank + 1
} else {
// Empty list
newRankMin = 0
newRankMax = 1
}
}
return newRankMin + ((i + 1) / (count + 1)) * (newRankMax - newRankMin)
}
=======
// /**
// * Returns a rank number, to be used to insert new objects in a ranked list
// * @param before Object before, null/undefined if inserted first
// * @param after Object after, null/undefined if inserted last
// * @param i If inserting multiple objects, this is the number of this object
// * @param count If inserting multiple objects, this is total count of objects
// */
// export function getRank<T extends { _rank: number }>(
// before: T | null | undefined,
// after: T | null | undefined,
// i: number = 0,
// count: number = 1
// ): number {
// let newRankMax
// let newRankMin
// if (after) {
// if (before) {
// newRankMin = before._rank
// newRankMax = after._rank
// } else {
// // First
// newRankMin = after._rank - 1
// newRankMax = after._rank
// }
// } else {
// if (before) {
// // Last
// newRankMin = before._rank
// newRankMax = before._rank + 1
// } else {
// // Empty list
// newRankMin = 0
// newRankMax = 1
// }
// }
// return newRankMin + ((i + 1) / (count + 1)) * (newRankMax - newRankMin)
// }
export function normalizeArrayFuncFilter<T>(
array: Array<T>,
getKey: (o: T) => string | undefined
): { [indexKey: string]: T } {
const normalizedObject: any = {}
for (let i = 0; i < array.length; i++) {
const key = getKey(array[i])
if (key !== undefined) {
normalizedObject[key] = array[i]
}
}
return normalizedObject as { [key: string]: T }
}
>>>>>>>
// export function fetchBefore<T>(
// collection: TransformedCollection<T, any>,
// selector: MongoQuery<T> = {},
// rank: number = Number.POSITIVE_INFINITY
// ): T {
// return collection
// .find(
// _.extend(selector, {
// _rank: { $lt: rank },
// }),
// {
// sort: {
// _rank: -1,
// _id: -1,
// },
// limit: 1,
// }
// )
// .fetch()[0]
// }
// export function fetchNext<T extends { _id: ProtectedString<any> }>(
// values: Array<T>,
// currentValue: T | undefined
// ): T | undefined {
// if (!currentValue) return values[0]
// let nextValue: T | undefined
// let found: boolean = false
// return _.find(values, (value) => {
// if (found) {
// nextValue = value
// return true
// }
// if (currentValue._id) {
// found = currentValue._id === value._id
// } else {
// found = currentValue === value
// }
// return false
// })
// }
/**
* Returns a rank number, to be used to insert new objects in a ranked list
* @param before The element before the one-to-be-inserted, null/undefined if inserted first
* @param after The element after the one-to-be-inserted, null/undefined if inserted last
* @param i If inserting multiple elements; the internal rank of the to-be-inserted element
* @param count If inserting multiple elements, this is total count of inserted elements
*/
export function getRank<T extends { _rank: number }>(
before: T | null | undefined,
after: T | null | undefined,
i: number = 0,
count: number = 1
): number {
let newRankMax
let newRankMin
if (after) {
if (before) {
newRankMin = before._rank
newRankMax = after._rank
} else {
// First
newRankMin = after._rank - 1
newRankMax = after._rank
}
} else {
if (before) {
// Last
newRankMin = before._rank
newRankMax = before._rank + 1
} else {
// Empty list
newRankMin = 0
newRankMax = 1
}
}
return newRankMin + ((i + 1) / (count + 1)) * (newRankMax - newRankMin)
}
export function normalizeArrayFuncFilter<T>(
array: Array<T>,
getKey: (o: T) => string | undefined
): { [indexKey: string]: T } {
const normalizedObject: any = {}
for (let i = 0; i < array.length; i++) {
const key = getKey(array[i])
if (key !== undefined) {
normalizedObject[key] = array[i]
}
}
return normalizedObject as { [key: string]: T }
} |
<<<<<<<
import { ExpectedPlayoutItems } from '../../lib/collections/ExpectedPlayoutItems'
import { updateExpectedPlayoutItemsOnPart } from './ingest/expectedPlayoutItems'
=======
import { DBRundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PeripheralDevice } from '../../lib/collections/PeripheralDevices'
import { PartInstances } from '../../lib/collections/PartInstances'
>>>>>>>
import { ExpectedPlayoutItems } from '../../lib/collections/ExpectedPlayoutItems'
import { updateExpectedPlayoutItemsOnPart } from './ingest/expectedPlayoutItems'
import { DBRundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PeripheralDevice } from '../../lib/collections/PeripheralDevices'
import { PartInstances } from '../../lib/collections/PartInstances'
<<<<<<<
// TODO - is there anything else to remove?
ExpectedPlayoutItems.remove({
=======
Pieces.remove({
>>>>>>>
// TODO - is there anything else to remove?
ExpectedPlayoutItems.remove({ |
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: '',
stoppedPlayback: true
=======
stoppedPlayback: true,
>>>>>>>
stoppedPlayback: true
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
=======
>>>>>>>
<<<<<<<
subTypeVariant: ''
}
=======
},
>>>>>>>
}, |
<<<<<<<
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated, getRundownPlaylist } from './lib'
=======
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment, loadCachedRundownData } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated } from './lib'
>>>>>>>
import { saveRundownCache, saveSegmentCache, loadCachedIngestSegment, loadCachedRundownData } from './ingestCache'
import { getRundownId, getSegmentId, getPartId, getStudioFromDevice, getRundown, canBeUpdated, getRundownPlaylist } from './lib' |
<<<<<<<
import { PeripheralDeviceAPI, PeripheralDeviceAPIMethods } from '../../../../lib/api/peripheralDevice'
import { setupDefaultStudioEnvironment } from '../../../../__mocks__/helpers/database'
=======
import { PeripheralDeviceAPI } from '../../../../lib/api/peripheralDevice'
import { setupDefaultStudioEnvironment, setupMockPeripheralDevice } from '../../../../__mocks__/helpers/database'
>>>>>>>
import { PeripheralDeviceAPI, PeripheralDeviceAPIMethods } from '../../../../lib/api/peripheralDevice'
import { setupDefaultStudioEnvironment, setupMockPeripheralDevice } from '../../../../__mocks__/helpers/database' |
<<<<<<<
import { RundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstance, PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
=======
import { RundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists';
>>>>>>>
import { RundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstance, PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
<<<<<<<
if (partInstance) {
let rundown: Rundown
let playlist: RundownPlaylist
=======
if (part) {
let rundown: Rundown | undefined
let playlist: RundownPlaylist
>>>>>>>
if (partInstance) {
let rundown: Rundown | undefined
<<<<<<<
} else if (!rundown)
logger.error(`Rundown "${partInstance.rundownId}" not found in reportPartHasStarted "${partInstance._id}"`)
else
logger.error(`rundown playlist "${rundown.playlistId}" not found in reportPartHasStarted "${partInstance._id}"`)
} else logger.error(`PartInstance not found in reportPartHasStarted "${partInstanceOrId}"`)
=======
} else if (!rundown)
logger.error(`rundown "${part.rundownId}" not found in reportPartHasStarted "${part._id}"`)
else
logger.error(`rundown playlist "${rundown.playlistId}" not found in reportPartHasStarted "${part._id}"`)
} else logger.error(`part not found in reportPartHasStarted "${partOrId}"`)
>>>>>>>
} else
logger.error(`Rundown "${partInstance.rundownId}" not found in reportPartHasStarted "${partInstance._id}"`)
} else logger.error(`PartInstance not found in reportPartHasStarted "${partInstanceOrId}"`)
<<<<<<<
if (partInstance) {
let rundown: Rundown
=======
if (part) {
let rundown: Rundown | undefined
>>>>>>>
if (partInstance) {
let rundown: Rundown | undefined
<<<<<<<
if (pieceInstance) {
let rundown: Rundown
let partInstance: PartInstance
=======
if (piece) {
let rundown: Rundown | undefined
let part: Part | undefined
>>>>>>>
if (pieceInstance) {
let rundown: Rundown | undefined
let partInstance: PartInstance | undefined
<<<<<<<
partInstance = r[2]
const playlist = rundown.getRundownPlaylist()
=======
part = r[2]
const playlist = rundown.getRundownPlaylist()
>>>>>>>
partInstance = r[2]
<<<<<<<
if (!partInstance) {
logger.error(`PartInstance "${pieceInstance.partInstanceId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else if (!rundown) {
logger.error(`Rundown "${pieceInstance.rundownId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else {
=======
if (rundown && part) {
>>>>>>>
if (!partInstance) {
logger.error(`PartInstance "${pieceInstance.partInstanceId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else if (!rundown) {
logger.error(`Rundown "${pieceInstance.rundownId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else {
const playlist = rundown.getRundownPlaylist()
<<<<<<<
}
=======
} else if (part) {
logger.error(`Part "${piece.partId}" not found in reportPieceHasStarted "${piece._id}"`)
} else {
logger.error(`Rundown "${piece.rundownId}" not found in reportPieceHasStarted "${piece._id}"`)
}
>>>>>>>
}
<<<<<<<
if (pieceInstance) {
let rundown: Rundown
let partInstance: PartInstance
=======
if (piece) {
let rundown: Rundown | undefined
let part: Part | undefined
>>>>>>>
if (pieceInstance) {
let rundown: Rundown
let partInstance: PartInstance
<<<<<<<
partInstance = r[2]
const playlist = rundown.getRundownPlaylist()
=======
part = r[2]
const playlist = rundown.getRundownPlaylist()
>>>>>>>
partInstance = r[2]
<<<<<<<
if (!partInstance) {
logger.error(`PartInstance "${pieceInstance.partInstanceId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else if (!rundown) {
logger.error(`Rundown "${pieceInstance.rundownId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else {
=======
if (rundown && part) {
>>>>>>>
if (!partInstance) {
logger.error(`PartInstance "${pieceInstance.partInstanceId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else if (!rundown) {
logger.error(`Rundown "${pieceInstance.rundownId}" not found in reportPieceHasStarted "${pieceInstanceOrId}"`)
} else {
const playlist = rundown.getRundownPlaylist()
<<<<<<<
}
=======
} else if (part) {
logger.error(`Part "${piece.partId}" not found in reportPieceHasStopped "${piece._id}"`)
} else {
logger.error(`Rundown "${piece.rundownId}" not found in reportPieceHasStopped "${piece._id}"`)
}
>>>>>>>
} |
<<<<<<<
import { check } from '../../lib/check'
=======
>>>>>>>
import { check } from '../../lib/check'
<<<<<<<
_.each(parts, (part) => {
let title: string | undefined = part ? part.title : undefined
if (
part &&
part.typeVariant &&
part.typeVariant.toString &&
part.typeVariant
.toString()
.toLowerCase()
.trim() === 'full'
) {
title = 'FULL'
}
if (title) {
title = title.replace(/.*;/, '') // DIREKTE PUNKT FESTIVAL;Split
}
=======
_.each(parts, (part) => {
>>>>>>>
_.each(parts, (part) => {
<<<<<<<
title: title,
pieces: [],
=======
title: part.title,
pieces: [],
>>>>>>>
title: part.title,
pieces: [], |
<<<<<<<
import { literal, getCurrentTime } from '../../lib/lib'
import { ensureCollectionProperty } from './lib'
import { addMigrationSteps } from './databaseMigration'
import { Rundowns } from '../../lib/collections/Rundowns'
import { RundownPlaylists, DBRundownPlaylist } from '../../lib/collections/RundownPlaylists'
import { Rundown as Rundown_1_0_0 } from './deprecatedDataTypes/1_0_1'
import { Random } from 'meteor/random'
=======
import { addMigrationSteps, CURRENT_SYSTEM_VERSION } from './databaseMigration'
>>>>>>>
import { literal, getCurrentTime } from '../../lib/lib'
import { ensureCollectionProperty } from './lib'
import { Rundowns } from '../../lib/collections/Rundowns'
import { RundownPlaylists, DBRundownPlaylist } from '../../lib/collections/RundownPlaylists'
import { Rundown as Rundown_1_0_0 } from './deprecatedDataTypes/1_0_1'
import { Random } from 'meteor/random'
import { addMigrationSteps, CURRENT_SYSTEM_VERSION } from './databaseMigration' |
<<<<<<<
const DEFAULT_CONTEXT: MethodContext = {}
describe('Test blueprint management api', () => {
=======
describe('Test blueprint management api', () => {
>>>>>>>
const DEFAULT_CONTEXT: MethodContext = {}
describe('Test blueprint management api', () => {
<<<<<<<
organizationId: null,
code: `{default: (() => 5)()}`,
=======
code: `({default: (() => 5)()})`,
>>>>>>>
organizationId: null,
code: `({default: (() => 5)()})`,
<<<<<<<
uploadBlueprint({}, protectString('blueprint99'), `{default: (() => 5)()}`)
fail('expected to throw')
=======
uploadBlueprint(protectString('blueprint99'), `({default: (() => 5)()})`)
expect(true).toBe(false) // Please throw and don't get here
>>>>>>>
uploadBlueprint({}, protectString('blueprint99'), `({default: (() => 5)()})`)
fail('expected to throw')
<<<<<<<
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
organizationId: null,
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
organizationId: null,
<<<<<<<
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString(''),
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
blueprintId: protectString(''),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString(''),
<<<<<<<
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString('sys'),
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
blueprintId: protectString('sys'),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString('sys'),
<<<<<<<
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString(''),
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
blueprintId: protectString(''),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString(''),
<<<<<<<
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString('ss1'),
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
blueprintId: protectString('ss1'),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString('ss1'), |
<<<<<<<
return memo + (part.duration || part.expectedDuration || part.renderedDuration || (display ? DEFAULT_DISPLAY_DURATION : 0))
=======
return memo + (part.instance.part.duration || part.instance.part.expectedDuration || part.renderedDuration || 0)
>>>>>>>
return memo + (part.instance.part.duration || part.instance.part.expectedDuration || part.renderedDuration || (display ? DEFAULT_DISPLAY_DURATION : 0)) |
<<<<<<<
import { ActionUserData } from 'tv-automation-sofie-blueprints-integration'
import { AdLibActionId, AdLibActionCommon } from '../collections/AdLibActions'
import { BucketAdLibAction } from '../collections/BucketAdlibActions'
=======
import { ActionUserData } from '@sofie-automation/blueprints-integration'
>>>>>>>
import { AdLibActionId, AdLibActionCommon } from '../collections/AdLibActions'
import { BucketAdLibAction } from '../collections/BucketAdlibActions' |
<<<<<<<
mongoFindOptions,
ProtectedString
=======
mongoFindOptions,
>>>>>>>
mongoFindOptions,
ProtectedString,
<<<<<<<
const rawDocs = ['1','2','3','4','5','6','7'].map(s => ({ _id: protectString(s) }))
=======
const rawDocs = [1, 2, 3, 4, 5, 6, 7]
>>>>>>>
const rawDocs = ['1', '2', '3', '4', '5', '6', '7'].map((s) => ({ _id: protectString(s) }))
<<<<<<<
expect(mongoFindOptions(rawDocs, { limit: 4 }).map(s => s._id)).toEqual(['1','2','3','4'])
expect(mongoFindOptions(rawDocs, { skip: 4 }).map(s => s._id)).toEqual(['5','6','7'])
expect(mongoFindOptions(rawDocs, { skip: 2, limit: 3 }).map(s => s._id)).toEqual(['3','4','5'])
=======
expect(mongoFindOptions(rawDocs, { limit: 4 })).toEqual([1, 2, 3, 4])
expect(mongoFindOptions(rawDocs, { skip: 4 })).toEqual([5, 6, 7])
expect(mongoFindOptions(rawDocs, { skip: 2, limit: 3 })).toEqual([3, 4, 5])
>>>>>>>
expect(mongoFindOptions(rawDocs, { limit: 4 }).map((s) => s._id)).toEqual(['1', '2', '3', '4'])
expect(mongoFindOptions(rawDocs, { skip: 4 }).map((s) => s._id)).toEqual(['5', '6', '7'])
expect(mongoFindOptions(rawDocs, { skip: 2, limit: 3 }).map((s) => s._id)).toEqual(['3', '4', '5'])
<<<<<<<
expect(() => mongoFindOptions(rawDocs, { transform: () => ({ _id: '1' }) })).toThrowError('options.transform not implemented')
=======
expect(() => mongoFindOptions(rawDocs, { transform: () => 1 })).toThrowError(
'options.transform not implemented'
)
>>>>>>>
expect(() => mongoFindOptions(rawDocs, { transform: () => ({ _id: '1' }) })).toThrowError(
'options.transform not implemented'
)
<<<<<<<
// those are covered by MongoFieldSpecifier type:
// expect(() => mongoFindOptions(rawDocs, { fields: { val: 0, val2: 1 } })).toThrowError('options.fields cannot contain both include and exclude rules')
// expect(() => mongoFindOptions(rawDocs, { fields: { _id: 0, val2: 1 } })).not.toThrowError()
// expect(() => mongoFindOptions(rawDocs, { fields: { _id: '1', val: 0 } })).not.toThrowError()
=======
expect(() => mongoFindOptions(rawDocs, { fields: { val: 0, val2: 1 } })).toThrowError(
'options.fields cannot contain both include and exclude rules'
)
expect(() => mongoFindOptions(rawDocs, { fields: { _id: 0, val2: 1 } })).not.toThrowError()
expect(() => mongoFindOptions(rawDocs, { fields: { _id: 1, val: 0 } })).not.toThrowError()
>>>>>>>
// those are covered by MongoFieldSpecifier type:
// expect(() => mongoFindOptions(rawDocs, { fields: { val: 0, val2: 1 } })).toThrowError('options.fields cannot contain both include and exclude rules')
// expect(() => mongoFindOptions(rawDocs, { fields: { _id: 0, val2: 1 } })).not.toThrowError()
// expect(() => mongoFindOptions(rawDocs, { fields: { _id: '1', val: 0 } })).not.toThrowError() |
<<<<<<<
import { PieceResolved, getResolvedPieces, orderPieces } from './pieces'
=======
import {
PieceResolved,
getOrderedPiece,
getResolvedPieces,
convertAdLibToPieceInstance,
convertPieceToAdLibPiece,
orderPieces,
} from './pieces'
>>>>>>>
import {
PieceResolved,
getOrderedPiece,
getResolvedPieces,
convertAdLibToPieceInstance,
convertPieceToAdLibPiece,
orderPieces,
} from './pieces'
<<<<<<<
export function executeAction (rundownPlaylistId: RundownPlaylistId, actionId: string, userData: any) {
check(rundownPlaylistId, String)
check(actionId, String)
check(userData, Match.Any)
return executeActionInner(rundownPlaylistId, (context, cache, rundown) => {
const blueprint = getBlueprintOfRundown(rundown) // todo: database again
if (!blueprint.blueprint.executeAction) {
throw new Meteor.Error(400, 'ShowStyle blueprint does not support executing actions')
}
blueprint.blueprint.executeAction(context, actionId, userData)
})
}
export function executeActionInner(rundownPlaylistId: RundownPlaylistId, func: (context: ActionExecutionContext, cache: CacheForRundownPlaylist, rundown: Rundown, currentPartInstance: PartInstance) => void) {
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
const tmpPlaylist = RundownPlaylists.findOne(rundownPlaylistId)
if (!tmpPlaylist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!tmpPlaylist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (!tmpPlaylist.currentPartInstanceId) throw new Meteor.Error(400, `A part needs to be active to execute an action`)
const cache = waitForPromise(initCacheForRundownPlaylist(tmpPlaylist))
const playlist = cache.RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
const studio = cache.Studios.findOne(playlist.studioId)
if (!studio) throw new Meteor.Error(501, `Current Studio "${playlist.studioId}" could not be found`)
const currentPartInstance = playlist.currentPartInstanceId ? cache.PartInstances.findOne(playlist.currentPartInstanceId) : undefined
if (!currentPartInstance) throw new Meteor.Error(501, `Current PartInstance "${playlist.currentPartInstanceId}" could not be found.`)
const rundown = cache.Rundowns.findOne(currentPartInstance.rundownId)
if (!rundown) throw new Meteor.Error(501, `Current Rundown "${currentPartInstance.rundownId}" could not be found`)
const notesContext = new NotesContext(`${rundown.name}(${playlist.name})`, `playlist=${playlist._id},rundown=${rundown._id},currentPartInstance=${currentPartInstance._id}`, true)
const context = new ActionExecutionContext(cache, notesContext, studio, playlist, rundown)
// If any action cannot be done due to timings, that needs to be rejected by the context
func(context, cache, rundown, currentPartInstance)
// Mark the parts as dirty if needed, so that they get a reimport on reset to undo any changes
if (context.currentPartState === ActionPartChange.MARK_DIRTY) {
cache.PartInstances.update(currentPartInstance._id, {
$set: {
'part.dirty': true
}
})
// TODO-PartInstance - pending new data flow
cache.Parts.update(currentPartInstance.part._id, {
$set: {
dirty: true
}
})
}
if (context.nextPartState === ActionPartChange.MARK_DIRTY) {
if (!playlist.nextPartInstanceId) throw new Meteor.Error(500, `Cannot mark non-existant partInstance as dirty`)
const nextPartInstance = cache.PartInstances.findOne(playlist.nextPartInstanceId)
if (!nextPartInstance) throw new Meteor.Error(500, `Cannot mark non-existant partInstance as dirty`)
if (!nextPartInstance.part.dynamicallyInserted) {
cache.PartInstances.update(nextPartInstance._id, {
$set: {
'part.dirty': true
}
})
// TODO-PartInstance - pending new data flow
cache.Parts.update(nextPartInstance.part._id, {
$set: {
dirty: true
}
})
}
}
if (context.currentPartState !== ActionPartChange.NONE || context.nextPartState !== ActionPartChange.NONE) {
updateSourceLayerInfinitesAfterPart(cache, rundown, currentPartInstance.part)
}
if (context.currentPartState !== ActionPartChange.NONE || context.nextPartState !== ActionPartChange.NONE) {
updateTimeline(cache, playlist.studioId)
}
waitForPromise(cache.saveAllToDatabase())
})
}
export function sourceLayerOnPartStop (rundownPlaylistId: RundownPlaylistId, partInstanceId: PartInstanceId, sourceLayerIds: string[]) {
=======
export function sourceLayerOnPartStop(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
sourceLayerIds: string[]
) {
>>>>>>>
export function executeAction(rundownPlaylistId: RundownPlaylistId, actionId: string, userData: any) {
check(rundownPlaylistId, String)
check(actionId, String)
check(userData, Match.Any)
return executeActionInner(rundownPlaylistId, (context, cache, rundown) => {
const blueprint = getBlueprintOfRundown(rundown) // todo: database again
if (!blueprint.blueprint.executeAction) {
throw new Meteor.Error(400, 'ShowStyle blueprint does not support executing actions')
}
blueprint.blueprint.executeAction(context, actionId, userData)
})
}
export function executeActionInner(
rundownPlaylistId: RundownPlaylistId,
func: (
context: ActionExecutionContext,
cache: CacheForRundownPlaylist,
rundown: Rundown,
currentPartInstance: PartInstance
) => void
) {
return rundownPlaylistSyncFunction(rundownPlaylistId, RundownSyncFunctionPriority.USER_PLAYOUT, () => {
const tmpPlaylist = RundownPlaylists.findOne(rundownPlaylistId)
if (!tmpPlaylist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!tmpPlaylist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (!tmpPlaylist.currentPartInstanceId)
throw new Meteor.Error(400, `A part needs to be active to execute an action`)
const cache = waitForPromise(initCacheForRundownPlaylist(tmpPlaylist))
const playlist = cache.RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
const studio = cache.Studios.findOne(playlist.studioId)
if (!studio) throw new Meteor.Error(501, `Current Studio "${playlist.studioId}" could not be found`)
const currentPartInstance = playlist.currentPartInstanceId
? cache.PartInstances.findOne(playlist.currentPartInstanceId)
: undefined
if (!currentPartInstance)
throw new Meteor.Error(
501,
`Current PartInstance "${playlist.currentPartInstanceId}" could not be found.`
)
const rundown = cache.Rundowns.findOne(currentPartInstance.rundownId)
if (!rundown)
throw new Meteor.Error(501, `Current Rundown "${currentPartInstance.rundownId}" could not be found`)
const notesContext = new NotesContext(
`${rundown.name}(${playlist.name})`,
`playlist=${playlist._id},rundown=${rundown._id},currentPartInstance=${currentPartInstance._id}`,
true
)
const context = new ActionExecutionContext(cache, notesContext, studio, playlist, rundown)
// If any action cannot be done due to timings, that needs to be rejected by the context
func(context, cache, rundown, currentPartInstance)
// Mark the parts as dirty if needed, so that they get a reimport on reset to undo any changes
if (context.currentPartState === ActionPartChange.MARK_DIRTY) {
cache.PartInstances.update(currentPartInstance._id, {
$set: {
'part.dirty': true,
},
})
// TODO-PartInstance - pending new data flow
cache.Parts.update(currentPartInstance.part._id, {
$set: {
dirty: true,
},
})
}
if (context.nextPartState === ActionPartChange.MARK_DIRTY) {
if (!playlist.nextPartInstanceId)
throw new Meteor.Error(500, `Cannot mark non-existant partInstance as dirty`)
const nextPartInstance = cache.PartInstances.findOne(playlist.nextPartInstanceId)
if (!nextPartInstance) throw new Meteor.Error(500, `Cannot mark non-existant partInstance as dirty`)
if (!nextPartInstance.part.dynamicallyInserted) {
cache.PartInstances.update(nextPartInstance._id, {
$set: {
'part.dirty': true,
},
})
// TODO-PartInstance - pending new data flow
cache.Parts.update(nextPartInstance.part._id, {
$set: {
dirty: true,
},
})
}
}
if (context.currentPartState !== ActionPartChange.NONE || context.nextPartState !== ActionPartChange.NONE) {
updateSourceLayerInfinitesAfterPart(cache, rundown, currentPartInstance.part)
}
if (context.currentPartState !== ActionPartChange.NONE || context.nextPartState !== ActionPartChange.NONE) {
updateTimeline(cache, playlist.studioId)
}
waitForPromise(cache.saveAllToDatabase())
})
}
export function sourceLayerOnPartStop(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
sourceLayerIds: string[]
) {
<<<<<<<
if (sourceLayerIds.length === 0) return
=======
>>>>>>>
if (sourceLayerIds.length === 0) return
<<<<<<<
ServerPlayoutAdLibAPI.innerStopPieces(cache, partInstance, pieceInstance => sourceLayerIds.indexOf(pieceInstance.piece.sourceLayerId) !== -1, undefined)
=======
const now = getCurrentTime()
const relativeNow = now - lastStartedPlayback
const orderedPieces = getResolvedPieces(cache, partInstance)
orderedPieces.forEach((pieceInstance) => {
if (sourceLayerIds.indexOf(pieceInstance.piece.sourceLayerId) !== -1) {
if (!pieceInstance.piece.userDuration) {
let newExpectedDuration: number | undefined = undefined
if (
pieceInstance.piece.infiniteId &&
pieceInstance.piece.infiniteId !== pieceInstance.piece._id
) {
newExpectedDuration = now - lastStartedPlayback
} else if (
pieceInstance.piece.startedPlayback && // currently playing
(pieceInstance.resolvedStart || 0) < relativeNow && // is relative, and has started
!pieceInstance.piece.stoppedPlayback // and not yet stopped
) {
newExpectedDuration = now - pieceInstance.piece.startedPlayback
}
if (newExpectedDuration !== undefined) {
console.log(`Cropping PieceInstance "${pieceInstance._id}" to ${newExpectedDuration}`)
PieceInstances.update(
{
_id: pieceInstance._id,
},
{
$set: {
'piece.userDuration': {
duration: newExpectedDuration,
},
},
}
)
// TODO-PartInstance - pending new data flow
Pieces.update(
{
_id: pieceInstance.piece._id,
},
{
$set: {
userDuration: {
duration: newExpectedDuration,
},
},
}
)
}
}
}
})
>>>>>>>
ServerPlayoutAdLibAPI.innerStopPieces(
cache,
partInstance,
(pieceInstance) => sourceLayerIds.indexOf(pieceInstance.piece.sourceLayerId) !== -1,
undefined
) |
<<<<<<<
function setNextSegmentLine (runningOrder: RunningOrder, nextSegmentLine: DBSegmentLine | null ) {
let ps: Array<Promise<any>> = []
=======
function setNextSegmentLine (runningOrder: RunningOrder, nextSegmentLine: DBSegmentLine | null, setManually?: boolean) {
>>>>>>>
function setNextSegmentLine (runningOrder: RunningOrder, nextSegmentLine: DBSegmentLine | null, setManually?: boolean) {
let ps: Array<Promise<any>> = []
<<<<<<<
export function roMoveNext (roId: string, horisontalDelta: number, verticalDelta: number, currentNextSegmentLineItemId?: string) {
=======
export function roMoveNext (roId: string, horisonalDelta: number, verticalDelta: number, setManually: boolean, currentNextSegmentLineItemId?: string) {
>>>>>>>
export function roMoveNext (roId: string, horisontalDelta: number, verticalDelta: number, setManually: boolean, currentNextSegmentLineItemId?: string) {
<<<<<<<
return ServerPlayoutAPI.roMoveNext (roId, horisontalDelta, verticalDelta, segmentLine._id)
=======
return ServerPlayoutAPI.roMoveNext (roId, horisonalDelta, verticalDelta, setManually, segmentLine._id)
>>>>>>>
return ServerPlayoutAPI.roMoveNext (roId, horisontalDelta, verticalDelta, setManually, segmentLine._id)
<<<<<<<
})
Meteor.call(PlayoutAPI.methods.roSetNext, roId, newNextLine.length > 0 ? newNextLine[0]._id : null)
} else if (!currentSegmentLine && nextSegmentLine && onAirNextWindowWidth === undefined && nextPosition !== undefined) {
=======
})[0]
setNextSegmentLine(runningOrder, newNextLine || null)
} else if (!currentSegmentLine && nextSegmentLineItem && onAirNextWindowWidth === undefined && nextPosition !== undefined) {
>>>>>>>
})[0]
setNextSegmentLine(runningOrder, newNextLine || null)
} else if (!currentSegmentLine && nextSegmentLine && onAirNextWindowWidth === undefined && nextPosition !== undefined) {
<<<<<<<
methods[PlayoutAPI.methods.roMoveNext] = (roId: string, horisontalDelta: number, verticalDelta: number) => {
return ServerPlayoutAPI.roMoveNext(roId, horisontalDelta, verticalDelta)
=======
methods[PlayoutAPI.methods.roMoveNext] = (roId: string, horisonalDelta: number, verticalDelta: number) => {
return ServerPlayoutAPI.roMoveNext(roId, horisonalDelta, verticalDelta, true)
>>>>>>>
methods[PlayoutAPI.methods.roMoveNext] = (roId: string, horisontalDelta: number, verticalDelta: number) => {
return ServerPlayoutAPI.roMoveNext(roId, horisontalDelta, verticalDelta, true) |
<<<<<<<
import { Rundowns, Rundown, DBRundown, RundownId } from '../../lib/collections/Rundowns'
import { Part, Parts, DBPart, PartId } from '../../lib/collections/Parts'
import { Pieces } from '../../lib/collections/Pieces'
import { AdLibPieces } from '../../lib/collections/AdLibPieces'
import { Segments, SegmentId } from '../../lib/collections/Segments'
=======
import { Rundowns, Rundown, DBRundown } from '../../lib/collections/Rundowns'
import { Part, Parts, DBPart } from '../../lib/collections/Parts'
import { Pieces, Piece } from '../../lib/collections/Pieces'
import { AdLibPieces, AdLibPiece } from '../../lib/collections/AdLibPieces'
import { Segments } from '../../lib/collections/Segments'
>>>>>>>
import { Rundowns, Rundown, DBRundown, RundownId } from '../../lib/collections/Rundowns'
import { Part, Parts, DBPart, PartId } from '../../lib/collections/Parts'
import { Pieces, Piece } from '../../lib/collections/Pieces'
import { AdLibPieces, AdLibPiece } from '../../lib/collections/AdLibPieces'
import { Segments, SegmentId } from '../../lib/collections/Segments'
<<<<<<<
import { DBRundownPlaylist, RundownPlaylists, RundownPlaylistId } from '../../lib/collections/RundownPlaylists'
=======
import { ExpectedPlayoutItems } from '../../lib/collections/ExpectedPlayoutItems'
import { updateExpectedPlayoutItemsOnPart } from './ingest/expectedPlayoutItems'
import { DBRundownPlaylist, RundownPlaylists } from '../../lib/collections/RundownPlaylists'
>>>>>>>
import { DBRundownPlaylist, RundownPlaylists, RundownPlaylistId } from '../../lib/collections/RundownPlaylists'
import { ExpectedPlayoutItems } from '../../lib/collections/ExpectedPlayoutItems'
import { updateExpectedPlayoutItemsOnPart } from './ingest/expectedPlayoutItems' |
<<<<<<<
import { MethodContext } from '../../../lib/api/methods'
import { RundownPlaylistContentWriteAccess } from '../../security/rundownPlaylist'
import { triggerWriteAccessBecauseNoCheckNecessary } from '../../security/lib/securityVerify'
import { StudioContentWriteAccess } from '../../security/studio'
import { initCacheForRundownPlaylist, CacheForRundownPlaylist, initCacheForStudio, initCacheForNoRundownPlaylist, CacheForStudio } from '../../DatabaseCaches'
=======
import {
initCacheForRundownPlaylist,
CacheForRundownPlaylist,
initCacheForStudio,
initCacheForNoRundownPlaylist,
CacheForStudio,
} from '../../DatabaseCaches'
>>>>>>>
import { MethodContext } from '../../../lib/api/methods'
import { RundownPlaylistContentWriteAccess } from '../../security/rundownPlaylist'
import { triggerWriteAccessBecauseNoCheckNecessary } from '../../security/lib/securityVerify'
import { StudioContentWriteAccess } from '../../security/studio'
import {
initCacheForRundownPlaylist,
CacheForRundownPlaylist,
initCacheForStudio,
initCacheForNoRundownPlaylist,
CacheForStudio,
} from '../../DatabaseCaches'
<<<<<<<
export function activateRundownPlaylist (context: MethodContext, rundownPlaylistId: RundownPlaylistId, rehearsal: boolean) {
=======
export function activateRundownPlaylist(rundownPlaylistId: RundownPlaylistId, rehearsal: boolean) {
>>>>>>>
export function activateRundownPlaylist(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
rehearsal: boolean
) {
<<<<<<<
export function deactivateRundownPlaylist (context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
=======
export function deactivateRundownPlaylist(rundownPlaylistId: RundownPlaylistId) {
>>>>>>>
export function deactivateRundownPlaylist(context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
<<<<<<<
export function reloadRundownPlaylistData (context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
=======
export function reloadRundownPlaylistData(rundownPlaylistId: RundownPlaylistId) {
>>>>>>>
export function reloadRundownPlaylistData(context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
<<<<<<<
export function takeNextPart (context: MethodContext, rundownPlaylistId: RundownPlaylistId): ClientAPI.ClientResponse<void> {
=======
export function takeNextPart(rundownPlaylistId: RundownPlaylistId): ClientAPI.ClientResponse<void> {
>>>>>>>
export function takeNextPart(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId
): ClientAPI.ClientResponse<void> {
<<<<<<<
export function setNextPart (
context: MethodContext,
=======
export function setNextPart(
>>>>>>>
export function setNextPart(
context: MethodContext,
<<<<<<<
export function setNextPartInner (
=======
export function setNextPartInner(
>>>>>>>
export function setNextPartInner(
<<<<<<<
export function moveNextPart (
context: MethodContext,
=======
export function moveNextPart(
>>>>>>>
export function moveNextPart(
context: MethodContext,
<<<<<<<
=======
if (!horizontalDelta && !verticalDelta)
throw new Meteor.Error(402, `rundownMoveNext: invalid delta: (${horizontalDelta}, ${verticalDelta})`)
>>>>>>>
<<<<<<<
export function setNextSegment (
context: MethodContext,
=======
export function setNextSegment(
>>>>>>>
export function setNextSegment(
context: MethodContext,
<<<<<<<
export function activateHold (context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
=======
export function activateHold(rundownPlaylistId: RundownPlaylistId) {
>>>>>>>
export function activateHold(context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
<<<<<<<
export function deactivateHold (context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
=======
export function deactivateHold(rundownPlaylistId: RundownPlaylistId) {
>>>>>>>
export function deactivateHold(context: MethodContext, rundownPlaylistId: RundownPlaylistId) {
<<<<<<<
const dbPlaylist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
=======
let playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `RundownPlaylist "${rundownPlaylistId}" not found!`)
if (playlist.holdState !== RundownHoldState.PENDING)
throw new Meteor.Error(400, `RundownPlaylist "${rundownPlaylistId}" is not pending a hold!`)
>>>>>>>
const dbPlaylist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
<<<<<<<
export function disableNextPiece (context: MethodContext, rundownPlaylistId: RundownPlaylistId, undo?: boolean) {
=======
export function disableNextPiece(rundownPlaylistId: RundownPlaylistId, undo?: boolean) {
>>>>>>>
export function disableNextPiece(context: MethodContext, rundownPlaylistId: RundownPlaylistId, undo?: boolean) {
<<<<<<<
export function onPiecePlaybackStarted (_context: MethodContext, rundownId: RundownId, pieceInstanceId: PieceInstanceId, dynamicallyInserted: boolean, startedPlayback: Time) {
=======
export function onPiecePlaybackStarted(
rundownId: RundownId,
pieceInstanceId: PieceInstanceId,
dynamicallyInserted: boolean,
startedPlayback: Time
) {
>>>>>>>
export function onPiecePlaybackStarted(
_context: MethodContext,
rundownId: RundownId,
pieceInstanceId: PieceInstanceId,
dynamicallyInserted: boolean,
startedPlayback: Time
) {
<<<<<<<
export function onPiecePlaybackStopped (_context: MethodContext, rundownId: RundownId, pieceInstanceId: PieceInstanceId, dynamicallyInserted: boolean, stoppedPlayback: Time) {
=======
export function onPiecePlaybackStopped(
rundownId: RundownId,
pieceInstanceId: PieceInstanceId,
dynamicallyInserted: boolean,
stoppedPlayback: Time
) {
>>>>>>>
export function onPiecePlaybackStopped(
_context: MethodContext,
rundownId: RundownId,
pieceInstanceId: PieceInstanceId,
dynamicallyInserted: boolean,
stoppedPlayback: Time
) {
<<<<<<<
export function onPartPlaybackStarted (_context: MethodContext, rundownId: RundownId, partInstanceId: PartInstanceId, startedPlayback: Time) {
=======
export function onPartPlaybackStarted(rundownId: RundownId, partInstanceId: PartInstanceId, startedPlayback: Time) {
>>>>>>>
export function onPartPlaybackStarted(
_context: MethodContext,
rundownId: RundownId,
partInstanceId: PartInstanceId,
startedPlayback: Time
) {
<<<<<<<
export function onPartPlaybackStopped (_context: MethodContext, rundownId: RundownId, partInstanceId: PartInstanceId, stoppedPlayback: Time) {
=======
export function onPartPlaybackStopped(rundownId: RundownId, partInstanceId: PartInstanceId, stoppedPlayback: Time) {
>>>>>>>
export function onPartPlaybackStopped(
_context: MethodContext,
rundownId: RundownId,
partInstanceId: PartInstanceId,
stoppedPlayback: Time
) {
<<<<<<<
export function pieceTakeNow (context: MethodContext, rundownPlaylistId: RundownPlaylistId, partInstanceId: PartInstanceId, pieceInstanceIdOrPieceIdToCopy: PieceInstanceId | PieceId) {
check(rundownPlaylistId, String)
=======
export function pieceTakeNow(
playlistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
pieceInstanceIdOrPieceIdToCopy: PieceInstanceId | PieceId
) {
check(playlistId, String)
>>>>>>>
export function pieceTakeNow(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
pieceInstanceIdOrPieceIdToCopy: PieceInstanceId | PieceId
) {
check(rundownPlaylistId, String)
<<<<<<<
export function segmentAdLibPieceStart (context: MethodContext, rundownPlaylistId: RundownPlaylistId, partInstanceId: PartInstanceId, adLibPieceId: PieceId, queue: boolean) {
=======
export function segmentAdLibPieceStart(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
adLibPieceId: PieceId,
queue: boolean
) {
>>>>>>>
export function segmentAdLibPieceStart(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
adLibPieceId: PieceId,
queue: boolean
) {
<<<<<<<
export function rundownBaselineAdLibPieceStart (context: MethodContext, rundownPlaylistId: RundownPlaylistId, partInstanceId: PartInstanceId, baselineAdLibPieceId: PieceId, queue: boolean) {
=======
export function rundownBaselineAdLibPieceStart(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
baselineAdLibPieceId: PieceId,
queue: boolean
) {
>>>>>>>
export function rundownBaselineAdLibPieceStart(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
baselineAdLibPieceId: PieceId,
queue: boolean
) {
<<<<<<<
export function sourceLayerOnPartStop (context: MethodContext, rundownPlaylistId: RundownPlaylistId, partInstanceId: PartInstanceId, sourceLayerIds: string[]) {
=======
export function sourceLayerOnPartStop(
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
sourceLayerIds: string[]
) {
>>>>>>>
export function sourceLayerOnPartStop(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
sourceLayerIds: string[]
) {
<<<<<<<
const dbPlaylist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (!dbPlaylist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (dbPlaylist.currentPartInstanceId !== partInstanceId) throw new Meteor.Error(403, `Pieces can be only manipulated in a current part!`)
=======
let playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown "${rundownPlaylistId}" not found!`)
if (!playlist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (playlist.currentPartInstanceId !== partInstanceId)
throw new Meteor.Error(403, `Pieces can be only manipulated in a current part!`)
>>>>>>>
const dbPlaylist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (!dbPlaylist.active) throw new Meteor.Error(403, `Pieces can be only manipulated in an active rundown!`)
if (dbPlaylist.currentPartInstanceId !== partInstanceId)
throw new Meteor.Error(403, `Pieces can be only manipulated in a current part!`)
<<<<<<<
export function rundownTogglePartArgument (
context: MethodContext,
=======
export function rundownTogglePartArgument(
>>>>>>>
export function rundownTogglePartArgument(
context: MethodContext,
<<<<<<<
export function timelineTriggerTimeUpdateCallback (
context: MethodContext,
=======
export function timelineTriggerTimeUpdateCallback(
>>>>>>>
export function timelineTriggerTimeUpdateCallback(
context: MethodContext,
<<<<<<<
logger.debug('Update PieceInstance: ', timelineObj.metaData.pieceId, (new Date(time)).toTimeString())
cache.PieceInstances.update({
_id: timelineObj.metaData.pieceId,
rundownId: { $in: activeRundownIds }
}, {
$set: {
'piece.enable.start': time
=======
logger.debug('Update PieceInstance: ', timelineObj.metaData.pieceId, new Date(time).toTimeString())
cache.PieceInstances.update(
{
_id: timelineObj.metaData.pieceId,
rundownId: { $in: activeRundownIds },
},
{
$set: {
'piece.enable.start': time,
},
>>>>>>>
logger.debug('Update PieceInstance: ', timelineObj.metaData.pieceId, new Date(time).toTimeString())
cache.PieceInstances.update(
{
_id: timelineObj.metaData.pieceId,
rundownId: { $in: activeRundownIds },
},
{
$set: {
'piece.enable.start': time,
},
<<<<<<<
export function updateStudioBaseline (context: MethodContext, studioId: StudioId) {
=======
export function updateStudioBaseline(studioId: StudioId) {
>>>>>>>
export function updateStudioBaseline(context: MethodContext, studioId: StudioId) {
<<<<<<<
const activeRundowns = getActiveRundownPlaylistsInStudio(cache,studioId)
=======
const activeRundowns = getActiveRundownPlaylistsInStudio(cache, studioId)
>>>>>>>
const activeRundowns = getActiveRundownPlaylistsInStudio(cache, studioId) |
<<<<<<<
import {
VTContent,
SourceLayerType,
ISourceLayer,
IBlueprintPieceGeneric
} from 'tv-automation-sofie-blueprints-integration'
=======
import { VTContent, SourceLayerType, ISourceLayer } from 'tv-automation-sofie-blueprints-integration'
>>>>>>>
import {
VTContent,
SourceLayerType,
ISourceLayer,
IBlueprintPieceGeneric,
} from 'tv-automation-sofie-blueprints-integration'
<<<<<<<
export function getMediaObjectMediaId (piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
=======
export function getMediaObjectMediaId(piece: InternalIBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
>>>>>>>
export function getMediaObjectMediaId(piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
<<<<<<<
export function checkPieceContentStatus (piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer | undefined, settings: IStudioSettings | undefined, t?: i18next.TranslationFunction<any, object, string>) {
=======
export function checkPieceContentStatus(
piece: InternalIBlueprintPieceGeneric,
sourceLayer: ISourceLayer | undefined,
settings: IStudioSettings | undefined,
t?: i18next.TranslationFunction<any, object, string>
) {
>>>>>>>
export function checkPieceContentStatus(
piece: IBlueprintPieceGeneric,
sourceLayer: ISourceLayer | undefined,
settings: IStudioSettings | undefined,
t?: i18next.TranslationFunction<any, object, string>
) { |
<<<<<<<
import { RundownPlaylists } from '../../../lib/collections/RundownPlaylists'
=======
import { UserActionAPI as OriginalUserActionAPI } from '../../../lib/api/userActions'
import { getHash } from '../../../lib/lib'
>>>>>>>
import { RundownPlaylists } from '../../../lib/collections/RundownPlaylists'
import { UserActionAPI as OriginalUserActionAPI } from '../../../lib/api/userActions'
import { getHash } from '../../../lib/lib'
<<<<<<<
Meteor.call(UserActionAPI.methods.activate, playlistId1)
=======
Meteor.call(UserActionAPI.methods.activate, rundownId1, false)
>>>>>>>
Meteor.call(UserActionAPI.methods.activate, playlistId1, false) |
<<<<<<<
return null
=======
return this.ready()
})
Meteor.publish('peripheralDevicesAndSubDevices', function (selector) {
if (!selector) throw new Meteor.Error(400, 'selector argument missing')
const parents = PeripheralDevices.find(selector).fetch()
return PeripheralDevices.find({
$or: [
{
parentDeviceId: { $in: parents.map(i => i._id) }
},
selector
]
})
>>>>>>>
return null
})
Meteor.publish('peripheralDevicesAndSubDevices', function (selector) {
if (!selector) throw new Meteor.Error(400, 'selector argument missing')
const parents = PeripheralDevices.find(selector).fetch()
return PeripheralDevices.find({
$or: [
{
parentDeviceId: { $in: parents.map(i => i._id) }
},
selector
]
}) |
<<<<<<<
},
top: {
scaleType: "labels",
=======
>>>>>>>
},
top: {
scaleType: "labels", |
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN,
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN,
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio2'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN,
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
studioId: protectString('myStudio'),
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN,
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN,
<<<<<<<
objectType: TimelineObjType.MANUAL,
=======
objectType: TimelineObjType.RUNDOWN,
studioId: protectString('myStudio'),
>>>>>>>
objectType: TimelineObjType.RUNDOWN, |
<<<<<<<
import { Rundowns, RundownHoldState, RundownId } from '../../lib/collections/Rundowns'
import { getCurrentTime, getHash, Omit, makePromise, check, protectString } from '../../lib/lib'
=======
import { Rundowns, RundownHoldState, RundownId, Rundown } from '../../lib/collections/Rundowns'
import { getCurrentTime, getHash, Omit, makePromise } from '../../lib/lib'
>>>>>>>
import { getCurrentTime, getHash, Omit, makePromise } from '../../lib/lib'
import { Rundowns, RundownHoldState, RundownId, Rundown } from '../../lib/collections/Rundowns'
<<<<<<<
import { BucketAdLib } from '../../lib/collections/BucketAdlibs'
import { Settings } from '../../lib/Settings'
=======
import { BucketAdLib, BucketAdLibs } from '../../lib/collections/BucketAdlibs'
import { rundownContentAllowWrite } from '../security/rundown'
>>>>>>>
import { BucketAdLib } from '../../lib/collections/BucketAdlibs'
import { rundownContentAllowWrite } from '../security/rundown'
<<<<<<<
// export function togglePartArgument(
// rundownPlaylistId: RundownPlaylistId,
// partInstanceId: PartInstanceId,
// property: string,
// value: string
// ) {
// const playlist = RundownPlaylists.findOne(rundownPlaylistId)
// if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
// if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
// return ClientAPI.responseError(`Part-arguments can't be toggled while Rundown is in Hold mode!`)
// }
// return ServerPlayoutAPI.rundownTogglePartArgument(rundownPlaylistId, partInstanceId, property, value)
// }
=======
export function togglePartArgument(
context: MethodContext,
rundownPlaylistId: RundownPlaylistId,
partInstanceId: PartInstanceId,
property: string,
value: string
) {
let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
return ClientAPI.responseError(`Part-arguments can't be toggled while Rundown is in Hold mode!`)
}
return ServerPlayoutAPI.rundownTogglePartArgument(context, rundownPlaylistId, partInstanceId, property, value)
}
>>>>>>>
// export function togglePartArgument(
// context: MethodContext,
// rundownPlaylistId: RundownPlaylistId,
// partInstanceId: PartInstanceId,
// property: string,
// value: string
// ) {
// let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
// if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
// if (playlist.holdState === RundownHoldState.ACTIVE || playlist.holdState === RundownHoldState.PENDING) {
// return ClientAPI.responseError(`Part-arguments can't be toggled while Rundown is in Hold mode!`)
// }
// return ServerPlayoutAPI.rundownTogglePartArgument(context, rundownPlaylistId, partInstanceId, property, value)
// }
<<<<<<<
return makePromise(() => noop())
// return makePromise(() => togglePartArgument(rundownPlaylistId, partInstanceId, property, value))
=======
return makePromise(() => togglePartArgument(this, rundownPlaylistId, partInstanceId, property, value))
>>>>>>>
return makePromise(() => noop(this))
// return makePromise(() => togglePartArgument(this, rundownPlaylistId, partInstanceId, property, value)) |
<<<<<<<
.classed("filled", d => this.model.getIsFilled(d.datasetLabel, d.label, d, filled))
.classed("unfilled", d => !this.model.getIsFilled(d.datasetLabel, d.label, d, filled))
.attr("cx", (d, i) => this.services.axes.getXValue(d, i))
=======
.classed("filled", filled)
.classed("unfilled", !filled)
.attr("cx", (d, i) => this.services.cartesianScales.getDomainValue(d, i))
>>>>>>>
.classed("filled", d => this.model.getIsFilled(d.datasetLabel, d.label, d, filled))
.classed("unfilled", d => !this.model.getIsFilled(d.datasetLabel, d.label, d, filled))
.attr("cx", (d, i) => this.services.cartesianScales.getDomainValue(d, i)) |
<<<<<<<
export function initialize (context: MethodContext, deviceId: PeripheralDeviceId, token: string, options: PeripheralDeviceAPI.InitOptions): PeripheralDeviceId {
triggerWriteAccess() // This is somewhat of a hack, since we want to check if it exists at all, before checking access
=======
export function initialize(
deviceId: PeripheralDeviceId,
token: string,
options: PeripheralDeviceAPI.InitOptions
): PeripheralDeviceId {
>>>>>>>
export function initialize(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
options: PeripheralDeviceAPI.InitOptions
): PeripheralDeviceId {
triggerWriteAccess() // This is somewhat of a hack, since we want to check if it exists at all, before checking access
<<<<<<<
} else {
PeripheralDevices.insert({
_id: deviceId,
organizationId: null,
created: getCurrentTime(),
status: {
statusCode: PeripheralDeviceAPI.StatusCode.UNKNOWN
},
studioId: protectString(''),
connected: true,
connectionId: options.connectionId,
lastSeen: getCurrentTime(),
lastConnected: getCurrentTime(),
token: token,
category: options.category,
type: options.type,
subType: options.subType,
name: options.name,
parentDeviceId: options.parentDeviceId,
versions: options.versions,
// settings: {},
configManifest: options.configManifest
})
=======
} catch (e) {
if ((e as Meteor.Error).error === 404) {
PeripheralDevices.insert({
_id: deviceId,
created: getCurrentTime(),
status: {
statusCode: PeripheralDeviceAPI.StatusCode.UNKNOWN,
},
studioId: protectString(''),
connected: true,
connectionId: options.connectionId,
lastSeen: getCurrentTime(),
lastConnected: getCurrentTime(),
token: token,
category: options.category,
type: options.type,
subType: options.subType,
name: options.name,
parentDeviceId: options.parentDeviceId,
versions: options.versions,
// settings: {},
configManifest: options.configManifest,
})
} else {
throw e
}
>>>>>>>
} else {
PeripheralDevices.insert({
_id: deviceId,
organizationId: null,
created: getCurrentTime(),
status: {
statusCode: PeripheralDeviceAPI.StatusCode.UNKNOWN,
},
studioId: protectString(''),
connected: true,
connectionId: options.connectionId,
lastSeen: getCurrentTime(),
lastConnected: getCurrentTime(),
token: token,
category: options.category,
type: options.type,
subType: options.subType,
name: options.name,
parentDeviceId: options.parentDeviceId,
versions: options.versions,
// settings: {},
configManifest: options.configManifest,
})
<<<<<<<
export function unInitialize (context: MethodContext, deviceId: PeripheralDeviceId, token: string): PeripheralDeviceId {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function unInitialize(deviceId: PeripheralDeviceId, token: string): PeripheralDeviceId {
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
export function unInitialize(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string
): PeripheralDeviceId {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
export function setStatus (context: MethodContext, deviceId: PeripheralDeviceId, token: string, status: PeripheralDeviceAPI.StatusObject): PeripheralDeviceAPI.StatusObject {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function setStatus(
deviceId: PeripheralDeviceId,
token: string,
status: PeripheralDeviceAPI.StatusObject
): PeripheralDeviceAPI.StatusObject {
>>>>>>>
export function setStatus(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
status: PeripheralDeviceAPI.StatusObject
): PeripheralDeviceAPI.StatusObject {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
=======
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
<<<<<<<
export function ping (context: MethodContext, deviceId: PeripheralDeviceId, token: string): void {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function ping(deviceId: PeripheralDeviceId, token: string): void {
>>>>>>>
export function ping(context: MethodContext, deviceId: PeripheralDeviceId, token: string): void {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
=======
// logger.debug('device ping', id)
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
<<<<<<<
}, 'timelineTriggerTime$0,$1') // kz 'timelineTriggerTime$1' maybe?
export function partPlaybackStarted (context: MethodContext, deviceId: PeripheralDeviceId, token: string, r: PeripheralDeviceAPI.PartPlaybackStartedResult) {
=======
},
'timelineTriggerTime$0,$1')
export function partPlaybackStarted(
deviceId: PeripheralDeviceId,
token: string,
r: PeripheralDeviceAPI.PartPlaybackStartedResult
) {
>>>>>>>
},
'timelineTriggerTime$0,$1') // kz 'timelineTriggerTime$1' maybe?
export function partPlaybackStarted(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
r: PeripheralDeviceAPI.PartPlaybackStartedResult
) {
<<<<<<<
export function partPlaybackStopped (context: MethodContext, deviceId: PeripheralDeviceId, token: string, r: PeripheralDeviceAPI.PartPlaybackStoppedResult) {
=======
export function partPlaybackStopped(
deviceId: PeripheralDeviceId,
token: string,
r: PeripheralDeviceAPI.PartPlaybackStoppedResult
) {
>>>>>>>
export function partPlaybackStopped(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
r: PeripheralDeviceAPI.PartPlaybackStoppedResult
) {
<<<<<<<
export function killProcess (context: MethodContext, deviceId: PeripheralDeviceId, token: string, really: boolean) {
=======
export function killProcess(deviceId: PeripheralDeviceId, token: string, really: boolean) {
>>>>>>>
export function killProcess(context: MethodContext, deviceId: PeripheralDeviceId, token: string, really: boolean) {
<<<<<<<
export function testMethod (context: MethodContext, deviceId: PeripheralDeviceId, token: string, returnValue: string, throwError?: boolean): string {
=======
export function testMethod(
deviceId: PeripheralDeviceId,
token: string,
returnValue: string,
throwError?: boolean
): string {
>>>>>>>
export function testMethod(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
returnValue: string,
throwError?: boolean
): string {
<<<<<<<
=======
// logger.debug('device ping', id)
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
<<<<<<<
export function requestUserAuthToken (context: MethodContext, deviceId: PeripheralDeviceId, token: string, authUrl: string) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function requestUserAuthToken(deviceId: PeripheralDeviceId, token: string, authUrl: string) {
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
export function requestUserAuthToken(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
authUrl: string
) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
export function storeAccessToken (context: MethodContext, deviceId: PeripheralDeviceId, token: string, accessToken: any) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function storeAccessToken(deviceId: PeripheralDeviceId, token: string, accessToken: any) {
let peripheralDevice = PeripheralDeviceSecurity.getPeripheralDevice(deviceId, token, this)
if (!peripheralDevice) throw new Meteor.Error(404, "peripheralDevice '" + deviceId + "' not found!")
>>>>>>>
export function storeAccessToken(
context: MethodContext,
deviceId: PeripheralDeviceId,
token: string,
accessToken: any
) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
export function removePeripheralDevice (context: MethodContext, deviceId: PeripheralDeviceId, token?: string) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
=======
export function removePeripheralDevice(deviceId: PeripheralDeviceId) {
// TODO: Replace this function with an authorized one
logger.info(`Removing PeripheralDevice ${deviceId}`)
>>>>>>>
export function removePeripheralDevice(context: MethodContext, deviceId: PeripheralDeviceId, token?: string) {
const peripheralDevice = checkAccessAndGetPeripheralDevice(deviceId, token, context)
<<<<<<<
parentDeviceId: peripheralDevice._id
=======
parentDeviceId: deviceId,
>>>>>>>
parentDeviceId: peripheralDevice._id,
<<<<<<<
deviceId: peripheralDevice._id
=======
deviceId: deviceId,
>>>>>>>
deviceId: peripheralDevice._id,
<<<<<<<
function functionReply (context: MethodContext, deviceId: PeripheralDeviceId, deviceToken: string, commandId: PeripheralDeviceCommandId, err: any, result: any): void {
checkAccessAndGetPeripheralDevice(deviceId, deviceToken, context)
=======
function functionReply(
deviceId: PeripheralDeviceId,
deviceToken: string,
commandId: PeripheralDeviceCommandId,
err: any,
result: any
): void {
>>>>>>>
function functionReply(
context: MethodContext,
deviceId: PeripheralDeviceId,
deviceToken: string,
commandId: PeripheralDeviceCommandId,
err: any,
result: any
): void {
checkAccessAndGetPeripheralDevice(deviceId, deviceToken, context)
<<<<<<<
determineDiffTime () {
triggerWriteAccessBecauseNoCheckNecessary()
=======
determineDiffTime() {
>>>>>>>
determineDiffTime() {
triggerWriteAccessBecauseNoCheckNecessary()
<<<<<<<
getTimeDiff () {
triggerWriteAccessBecauseNoCheckNecessary()
=======
getTimeDiff() {
>>>>>>>
getTimeDiff() {
triggerWriteAccessBecauseNoCheckNecessary()
<<<<<<<
getTime () {
triggerWriteAccessBecauseNoCheckNecessary()
=======
getTime() {
>>>>>>>
getTime() {
triggerWriteAccessBecauseNoCheckNecessary() |
<<<<<<<
import { ClientAPI } from '../../../lib/api/client'
=======
import { MethodContextAPI } from '../../../lib/api/methods'
import { Settings } from '../../../lib/Settings'
>>>>>>>
import { ClientAPI } from '../../../lib/api/client'
import { MethodContextAPI } from '../../../lib/api/methods'
import { Settings } from '../../../lib/Settings'
<<<<<<<
return makePromise(() => ClientAPI.responseSuccess(undefined))
// return makePromise(() =>
// ServerPlayoutAPI.rundownTogglePartArgument(playlistId, partInstanceId, property, value)
// )
=======
return makePromise(() =>
ServerPlayoutAPI.rundownTogglePartArgument(this, playlistId, partInstanceId, property, value)
)
>>>>>>>
return makePromise(() => ClientAPI.responseSuccess(undefined))
// return makePromise(() =>
// ServerPlayoutAPI.rundownTogglePartArgument(this, playlistId, partInstanceId, property, value)
// ) |
<<<<<<<
afterTake(runningOrder, takeSegmentLine, previousSegmentLine || null, timeOffset)
=======
afterTake(runningOrder, takeSegmentLine, previousSegmentLine || null)
>>>>>>>
afterTake(runningOrder, takeSegmentLine, previousSegmentLine || null, timeOffset)
<<<<<<<
let forceNowTime: number | undefined = undefined
if (timeOffset) {
forceNowTime = getCurrentTime() - timeOffset
}
=======
// or after a new segmentLine has started playing
>>>>>>>
let forceNowTime: number | undefined = undefined
if (timeOffset) {
forceNowTime = getCurrentTime() - timeOffset
}
// or after a new segmentLine has started playing |
<<<<<<<
import { Timeline } from '../../../lib/collections/Timeline'
=======
import {
Timeline,
TimelineObjGeneric,
TimelineObjType,
getTimelineId,
} from '../../../lib/collections/Timeline'
>>>>>>>
import { Timeline } from '../../../lib/collections/Timeline'
<<<<<<<
import { updateSourceLayerInfinitesAfterLine, cropInfinitesOnLayer, stopInfinitesRunningOnLayer } from './infinites'
import { rundownSyncFunction, RundownSyncFunctionPriority } from '../ingest/rundownInput'
import { ServerPlayoutAdLibAPI } from './adlib'
=======
import { updateSourceLayerInfinitesAfterPart, cropInfinitesOnLayer, stopInfinitesRunningOnLayer } from './infinites'
>>>>>>>
import { updateSourceLayerInfinitesAfterPart, cropInfinitesOnLayer, stopInfinitesRunningOnLayer } from './infinites'
import { rundownSyncFunction, RundownSyncFunctionPriority } from '../ingest/rundownInput'
import { ServerPlayoutAdLibAPI } from './adlib'
<<<<<<<
// Setup the items for the HOLD we are starting
if (m.previousPartId && m.holdState === RundownHoldState.ACTIVE) {
let previousPart = rundownData.partsMap[m.previousPartId]
if (!previousPart) throw new Meteor.Error(404, 'previousPart not found!')
=======
// Setup the parts for the HOLD we are starting
if (m.previousPartId && m.holdState === RundownHoldState.ACTIVE) {
let previousPart = rundownData.partsMap[m.previousPartId]
if (!previousPart) throw new Meteor.Error(404, 'previousPart not found!')
>>>>>>>
// Setup the parts for the HOLD we are starting
if (m.previousPartId && m.holdState === RundownHoldState.ACTIVE) {
let previousPart = rundownData.partsMap[m.previousPartId]
if (!previousPart) throw new Meteor.Error(404, 'previousPart not found!')
<<<<<<<
return ServerPlayoutAdLibAPI.pieceTakeNow(rundownId, partId, pieceId)
=======
let rundown = Rundowns.findOne(rundownId)
if (!rundown) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
if (!rundown.active) throw new Meteor.Error(403, `Part AdLib-pieces can be only placed in an active rundown!`)
let piece = Pieces.findOne({
_id: pieceId,
rundownId: rundownId
}) as Piece
if (!piece) throw new Meteor.Error(404, `Piece "${pieceId}" not found!`)
let part = Parts.findOne({
_id: partId,
rundownId: rundownId
})
if (!part) throw new Meteor.Error(404, `Part "${partId}" not found!`)
if (rundown.currentPartId !== part._id) throw new Meteor.Error(403, `Part AdLib-pieces can be only placed in a current part!`)
let showStyleBase = rundown.getShowStyleBase()
const sourceL = showStyleBase.sourceLayers.find(i => i._id === piece.sourceLayerId)
if (sourceL && sourceL.type !== SourceLayerType.GRAPHICS) throw new Meteor.Error(403, `Piece "${pieceId}" is not a GRAPHICS item!`)
let newPiece = convertAdLibToPiece(piece, part, false)
if (newPiece.content && newPiece.content.timelineObjects) {
newPiece.content.timelineObjects = prefixAllObjectIds(
_.compact(
_.map(newPiece.content.timelineObjects, (obj) => {
return extendMandadory<TimelineObjectCoreExt, TimelineObjGeneric>(obj, {
_id: '', // set later
studioId: '', // set later
objectType: TimelineObjType.RUNDOWN
})
})
),
newPiece._id
)
}
// disable the original piece if from the same Part
if (piece.partId === part._id) {
const pieces = getResolvedPieces(part)
const resPiece = pieces.find(piece => piece._id === piece._id)
if (piece.startedPlayback && piece.startedPlayback <= getCurrentTime()) {
if (resPiece && resPiece.duration !== undefined && (piece.infiniteMode || piece.startedPlayback + resPiece.duration >= getCurrentTime())) {
// logger.debug(`Piece "${piece._id}" is currently live and cannot be used as an ad-lib`)
throw new Meteor.Error(409, `Piece "${piece._id}" is currently live and cannot be used as an ad-lib`)
}
}
Pieces.update(piece._id, {$set: {
disabled: true,
hidden: true
}})
}
Pieces.insert(newPiece)
cropInfinitesOnLayer(rundown, part, newPiece)
stopInfinitesRunningOnLayer(rundown, part, newPiece.sourceLayerId)
updateTimeline(rundown.studioId)
>>>>>>>
return ServerPlayoutAdLibAPI.pieceTakeNow(rundownId, partId, pieceId)
<<<<<<<
return ServerPlayoutAdLibAPI.segmentAdLibPieceStart(rundownId, partId, adLibPieceId, queue)
}
export function rundownBaselineAdLibPieceStart (rundownId: string, partId: string, baselineAdLibPieceId: string, queue: boolean) {
=======
let rundown = Rundowns.findOne(rundownId)
if (!rundown) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
if (!rundown.active) throw new Meteor.Error(403, `Part AdLib-pieces can be only placed in an active rundown!`)
if (rundown.holdState === RundownHoldState.ACTIVE || rundown.holdState === RundownHoldState.PENDING) {
throw new Meteor.Error(403, `Part AdLib-pieces can not be used in combination with hold!`)
}
let adLibPiece = AdLibPieces.findOne({
_id: adLibPieceId,
rundownId: rundownId
})
if (!adLibPiece) throw new Meteor.Error(404, `Part Ad Lib Item "${adLibPieceId}" not found!`)
if (adLibPiece.invalid) throw new Meteor.Error(404, `Cannot take invalid Part Ad Lib Item "${adLibPieceId}"!`)
if (!queue && rundown.currentPartId !== partId) throw new Meteor.Error(403, `Part AdLib-pieces can be only placed in a currently playing part!`)
innerStartAdLibPiece(rundown, queue, partId, adLibPiece)
})
export const rundownBaselineAdLibPieceStart = syncFunction(function rundownBaselineAdLibPieceStart (rundownId: string, partId: string, baselineAdLibPieceId: string, queue: boolean) {
>>>>>>>
return ServerPlayoutAdLibAPI.segmentAdLibPieceStart(rundownId, partId, adLibPieceId, queue)
}
export function rundownBaselineAdLibPieceStart (rundownId: string, partId: string, baselineAdLibPieceId: string, queue: boolean) {
<<<<<<<
=======
logger.debug('rundownBaselineAdLibPieceStart')
let rundown = Rundowns.findOne(rundownId)
if (!rundown) throw new Meteor.Error(404, `Rundown "${rundownId}" not found!`)
if (!rundown.active) throw new Meteor.Error(403, `Rundown Baseline AdLib-pieces can be only placed in an active rundown!`)
if (rundown.holdState === RundownHoldState.ACTIVE || rundown.holdState === RundownHoldState.PENDING) {
throw new Meteor.Error(403, `Part AdLib-pieces can not be used in combination with hold!`)
}
let adLibPiece = RundownBaselineAdLibPieces.findOne({
_id: baselineAdLibPieceId,
rundownId: rundownId
})
if (!adLibPiece) throw new Meteor.Error(404, `Rundown Baseline Ad Lib Item "${baselineAdLibPieceId}" not found!`)
if (!queue && rundown.currentPartId !== partId) throw new Meteor.Error(403, `Rundown Baseline AdLib-pieces can be only placed in a currently playing part!`)
innerStartAdLibPiece(rundown, queue, partId, adLibPiece)
})
function innerStartAdLibPiece (rundown: Rundown, queue: boolean, partId: string, adLibPiece: AdLibPiece) {
let orgPartId = partId
if (queue) {
// insert a NEW, adlibbed part after this part
partId = adlibQueueInsertPart(rundown, partId, adLibPiece)
}
let part = Parts.findOne({
_id: partId,
rundownId: rundown._id
})
if (!part) throw new Meteor.Error(404, `Part "${partId}" not found!`)
let newPiece = convertAdLibToPiece(adLibPiece, part, queue)
Pieces.insert(newPiece)
if (queue) {
// keep infinite pieces
Pieces.find({ rundownId: rundown._id, partId: orgPartId }).forEach(piece => {
// console.log(piece.name + ' has life span of ' + piece.infiniteMode)
if (piece.infiniteMode && piece.infiniteMode >= PieceLifespan.Infinite) {
let newPiece = convertAdLibToPiece(piece, part!, queue)
Pieces.insert(newPiece)
}
})
setNextPart(rundown._id, partId)
} else {
cropInfinitesOnLayer(rundown, part, newPiece)
stopInfinitesRunningOnLayer(rundown, part, newPiece.sourceLayerId)
updateTimeline(rundown.studioId)
}
}
function adlibQueueInsertPart (rundown: Rundown, partId: string, adLibPiece: AdLibPiece) {
// let parts = rundown.getParts()
logger.info('adlibQueueInsertPart')
let part = Parts.findOne(partId)
if (!part) throw new Meteor.Error(404, `Part "${partId}" not found!`)
// let nextPart = fetchAfter(Parts, {
// rundownId: rundown._id
// }, part._rank)
// let newRank = getRank(part, nextPart, 0, 1)
let newPartId = Random.id()
Parts.insert({
_id: newPartId,
_rank: 99999, // something high, so it will be placed last
externalId: '',
segmentId: part.segmentId,
rundownId: rundown._id,
title: adLibPiece.name,
dynamicallyInserted: true,
afterPart: part._id,
typeVariant: 'adlib'
})
updateParts(rundown._id) // place in order
return newPartId
>>>>>>>
<<<<<<<
updateSourceLayerInfinitesAfterLine(rundown, part)
=======
updateSourceLayerInfinitesAfterPart(rundown, part)
>>>>>>>
updateSourceLayerInfinitesAfterPart(rundown, part)
<<<<<<<
=======
// If this is rundown's current part, update immediately
} else if (rundown.currentPartId === part._id) {
updateTimeline(rundown.studioId)
>>>>>>> |
<<<<<<<
import { Match } from 'meteor/check'
import { Rundowns, Rundown, RundownHoldState, RundownId } from '../../../lib/collections/Rundowns'
import { Part, Parts, DBPart, PartId } from '../../../lib/collections/Parts'
import { Piece, Pieces, PieceId } from '../../../lib/collections/Pieces'
=======
import { check, Match } from 'meteor/check'
import { Rundown, RundownHoldState, RundownId, Rundowns } from '../../../lib/collections/Rundowns'
import { Part, DBPart, PartId } from '../../../lib/collections/Parts'
import { Piece, PieceId } from '../../../lib/collections/Pieces'
>>>>>>>
import { Match } from 'meteor/check'
import { Rundown, RundownHoldState, RundownId, Rundowns } from '../../../lib/collections/Rundowns'
import { Part, DBPart, PartId } from '../../../lib/collections/Parts'
import { Piece, PieceId } from '../../../lib/collections/Pieces' |
<<<<<<<
export function getSegmentPartNotes (rundownIds: RundownId[]): (PartNote & { rank: number; })[] {
let notes: Array<PartNote & {rank: number}> = []
const segments = Segments.find({
rundownId: {
$in: rundownIds
=======
export function getSegmentPartNotes(rundownIds: RundownId[]): (PartNote & { rank: number })[] {
let notes: Array<PartNote & { rank: number }> = []
const segments = Segments.find(
{
rundownId: {
$in: rundownIds,
},
},
{
sort: { _rank: 1 },
fields: {
_id: 1,
_rank: 1,
notes: 1,
},
>>>>>>>
export function getSegmentPartNotes(rundownIds: RundownId[]): (PartNote & { rank: number })[] {
let notes: Array<PartNote & { rank: number }> = []
const segments = Segments.find(
{
rundownId: {
$in: rundownIds,
},
},
{
sort: { _rank: 1 },
fields: {
_id: 1,
_rank: 1,
notes: 1,
},
<<<<<<<
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id
}).map((piece) => { // run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find(i => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
title: 1,
segmentId: 1,
}
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if ((status !== RundownAPI.PieceStatusCode.OK) && (status !== RundownAPI.PieceStatusCode.UNKNOWN) && (status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET)) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message
=======
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id,
}).map((piece) => {
// run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find((i) => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
name: 1,
segmentId: 1,
},
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if (
status !== RundownAPI.PieceStatusCode.OK &&
status !== RundownAPI.PieceStatusCode.UNKNOWN &&
status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET
) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message,
}
}
>>>>>>>
if (showStyle && rundownStudio) {
const showStyleBase = showStyle
const studio = rundownStudio
const pieceStatus = Pieces.find({
rundownId: rundown._id,
}).map((piece) => {
// run these in parallel
const sourceLayer = showStyleBase.sourceLayers.find((i) => i._id === piece.sourceLayerId)
const part = Parts.findOne(piece.partId, {
fields: {
_rank: 1,
title: 1,
segmentId: 1,
},
})
const segment = part ? segments[unprotectString(part.segmentId)] : undefined
if (segment && sourceLayer && part) {
// we don't want this to be in a non-reactive context, so we manage this computation manually
const { status, message } = checkPieceContentStatus(piece, sourceLayer, studio.settings)
if (
status !== RundownAPI.PieceStatusCode.OK &&
status !== RundownAPI.PieceStatusCode.UNKNOWN &&
status !== RundownAPI.PieceStatusCode.SOURCE_NOT_SET
) {
return {
rundownId: part.rundownId,
segmentId: segment._id,
segmentRank: segment._rank,
partId: part._id,
partRank: part._rank,
pieceId: piece._id,
name: piece.name,
status,
message,
}
} |
<<<<<<<
import { testInFiber } from '../../../../__mocks__/helpers/jest'
import { Blueprints } from '../../../../lib/collections/Blueprints'
=======
import { RundownPlaylist, RundownPlaylists } from '../../../../lib/collections/RundownPlaylists'
import { initCacheForRundownPlaylist } from '../../../DatabaseCaches'
import { testInFiber } from '../../../../__mocks__/helpers/jest'
>>>>>>>
import { testInFiber } from '../../../../__mocks__/helpers/jest'
import { Blueprints } from '../../../../lib/collections/Blueprints'
import { RundownPlaylist, RundownPlaylists } from '../../../../lib/collections/RundownPlaylists'
import { initCacheForRundownPlaylist } from '../../../DatabaseCaches' |
<<<<<<<
triggerWriteAccessBecauseNoCheckNecessary() // TODO: discuss if is this ok?
logger.error(`Uncaught error happened in GUI\n in "${location}"\n on "${methodContext.connection ? methodContext.connection.clientAddress : 'N/A'}"\n at ${(new Date(timestamp)).toISOString()}:\n${JSON.stringify(errorObject)}`)
=======
logger.error(
`Uncaught error happened in GUI\n in "${location}"\n on "${
methodContext.connection.clientAddress
}"\n at ${new Date(timestamp).toISOString()}:\n${JSON.stringify(errorObject)}`
)
>>>>>>>
triggerWriteAccessBecauseNoCheckNecessary() // TODO: discuss if is this ok?
logger.error(
`Uncaught error happened in GUI\n in "${location}"\n on "${
methodContext.connection ? methodContext.connection.clientAddress : 'N/A'
}"\n at ${new Date(timestamp).toISOString()}:\n${JSON.stringify(errorObject)}`
)
<<<<<<<
const { userId, organizationId } = getLoggedInCredentials(methodContext)
UserActionsLog.insert(literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
organizationId: organizationId,
userId: userId,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime()
}))
=======
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
userId: methodContext.userId,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
>>>>>>>
const { userId, organizationId } = getLoggedInCredentials(methodContext)
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
organizationId: organizationId,
userId: userId,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
<<<<<<<
if (!methodContext.connection) {
// In this case, it was called internally from server-side.
// Just run and return right away:
try {
triggerWriteAccessBecauseNoCheckNecessary()
PeripheralDeviceAPI.executeFunction(deviceId, (err, result) => {
if (err) reject(err)
else resolve(result)
}, functionName, ...args)
} catch (e) {
// allow the exception to be handled by the Client code
let errMsg = e.message || e.reason || (e.toString ? e.toString() : null)
logger.error(errMsg)
reject(e)
}
return
}
const access = PeripheralDeviceContentWriteAccess.executeFunction(methodContext, deviceId)
UserActionsLog.insert(literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
organizationId: access.organizationId,
userId: access.userId,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime()
}))
=======
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
userId: methodContext.userId,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
>>>>>>>
if (!methodContext.connection) {
// In this case, it was called internally from server-side.
// Just run and return right away:
try {
triggerWriteAccessBecauseNoCheckNecessary()
PeripheralDeviceAPI.executeFunction(
deviceId,
(err, result) => {
if (err) reject(err)
else resolve(result)
},
functionName,
...args
)
} catch (e) {
// allow the exception to be handled by the Client code
let errMsg = e.message || e.reason || (e.toString ? e.toString() : null)
logger.error(errMsg)
reject(e)
}
return
}
const access = PeripheralDeviceContentWriteAccess.executeFunction(methodContext, deviceId)
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
organizationId: access.organizationId,
userId: access.userId,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
) |
<<<<<<<
import { rundownContentAllowWrite } from '../security/rundown'
=======
import { modifyPlaylistExternalId } from './ingest/lib'
>>>>>>>
import { rundownContentAllowWrite } from '../security/rundown'
import { modifyPlaylistExternalId } from './ingest/lib'
<<<<<<<
externalId: playlistInfo.playlist.externalId,
organizationId: studio.organizationId,
=======
externalId: playlistExternalId,
>>>>>>>
externalId: playlistExternalId,
organizationId: studio.organizationId,
<<<<<<<
externalId: currentRundown.externalId,
organizationId: studio.organizationId,
=======
externalId: tmpPlaylistExternalId,
>>>>>>>
externalId: tmpPlaylistExternalId,
organizationId: studio.organizationId, |
<<<<<<<
logger.error(`Uncaught error happened in GUI\n in "${location}"\n on "${methodContext.connection ? methodContext.connection.clientAddress : ''}"\n at ${(new Date(timestamp)).toISOString()}:\n${JSON.stringify(errorObject)}`)
=======
logger.error(
`Uncaught error happened in GUI\n in "${location}"\n on "${
methodContext.connection.clientAddress
}"\n at ${new Date(timestamp).toISOString()}:\n${JSON.stringify(errorObject)}`
)
>>>>>>>
logger.error(
`Uncaught error happened in GUI\n in "${location}"\n on "${
methodContext.connection ? methodContext.connection.clientAddress : ''
}"\n at ${new Date(timestamp).toISOString()}:\n${JSON.stringify(errorObject)}`
)
<<<<<<<
UserActionsLog.insert(literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection ? methodContext.connection.clientAddress : '',
userId: methodContext.userId || undefined,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime()
}))
=======
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
userId: methodContext.userId,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
>>>>>>>
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection ? methodContext.connection.clientAddress : '',
userId: methodContext.userId || undefined,
context: context,
method: methodName,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
<<<<<<<
UserActionsLog.insert(literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection ? methodContext.connection.clientAddress : '',
userId: methodContext.userId || undefined,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime()
}))
=======
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection.clientAddress,
userId: methodContext.userId,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
)
>>>>>>>
UserActionsLog.insert(
literal<UserActionsLogItem>({
_id: actionId,
clientAddress: methodContext.connection ? methodContext.connection.clientAddress : '',
userId: methodContext.userId || undefined,
context: context,
method: `${deviceId}: ${functionName}`,
args: JSON.stringify(args),
timestamp: getCurrentTime(),
})
) |
<<<<<<<
=======
const span = profiler.startSpan('afterUpdateTimeline')
>>>>>>>
const span = profiler.startSpan('afterUpdateTimeline')
<<<<<<<
return statObj
}
=======
cache.Timeline.upsert(statObj._id, statObj)
if (span) span.end()
} */
>>>>>>>
return statObj
}
cache.Timeline.upsert(statObj._id, statObj)
if (span) span.end()
} */ |
<<<<<<<
// AppProvider contains CSS that affects element level CSS (e.g. `html`, `button`)
// It should be first to ensure its CSS is first in compiled output
export {AppProvider, AppProviderProps} from './AppProvider';
export {AccountConnection, AccountConnectionProps} from './AccountConnection';
=======
export {AccountConnection} from './AccountConnection';
export type {AccountConnectionProps} from './AccountConnection';
>>>>>>>
// AppProvider contains CSS that affects element level CSS (e.g. `html`, `button`)
// It should be first to ensure its CSS is first in compiled output
// AppProvider contains CSS that affects element level CSS (e.g. `html`, `button`)
// It should be first to ensure its CSS is first in compiled output
export {AppProvider} from './AppProvider';
export type {AppProviderProps} from './AppProvider';
export {AccountConnection} from './AccountConnection';
export type {AccountConnectionProps} from './AccountConnection';
<<<<<<<
export {Autocomplete, AutocompleteProps} from './Autocomplete';
=======
export {AppProvider} from './AppProvider';
export type {AppProviderProps} from './AppProvider';
export {Autocomplete} from './Autocomplete';
export type {AutocompleteProps} from './Autocomplete';
>>>>>>>
export {Autocomplete} from './Autocomplete';
export type {AutocompleteProps} from './Autocomplete';
<<<<<<<
export {ResourceList, ResourceListProps} from './ResourceList';
=======
export {ResourceList, FilterType} from './ResourceList';
export type {
ResourceListProps,
FilterControlProps,
Filter,
AppliedFilter,
FilterSelect,
FilterTextField,
} from './ResourceList';
>>>>>>>
export {ResourceList} from './ResourceList';
export type {ResourceListProps} from './ResourceList';
<<<<<<<
export {Scrollable, ScrollableProps} from './Scrollable';
=======
export {ResourcePicker} from './ResourcePicker';
export type {ResourcePickerProps} from './ResourcePicker';
export {Scrollable} from './Scrollable';
export type {ScrollableProps} from './Scrollable';
>>>>>>>
export {Scrollable} from './Scrollable';
export type {ScrollableProps} from './Scrollable'; |
<<<<<<<
let takePart = rundownData.partsMap[playlist.nextPartId]
if (!takePart) throw new Meteor.Error(404, `takePart not found! ("${playlist.nextPartId}")`)
const takeRundown: Rundown | undefined = rundownData.rundownsMap[takePart.rundownId]
if (!takeRundown) throw new Meteor.Error(500, `takeRundown: takeRundown not found! ("${takePart.rundownId}")`)
let partAfter = fetchAfterInPlaylist(
rundownData.parts,
{
rundownId: takePart.rundownId,
invalid: { $ne: true }
},
playlist,
takeRundown,
takePart
)
=======
let takePart = rundownData.partsMap[rundown.nextPartId]
if (!takePart) throw new Meteor.Error(404, 'takePart not found!')
// let takeSegment = rundownData.segmentsMap[takePart.segmentId]
let partAfter = fetchNext(_.filter(rundownData.parts, p => (p.rundownId === rundown._id && !p.invalid)), takePart)
>>>>>>>
let takePart = rundownData.partsMap[playlist.nextPartId]
if (!takePart) throw new Meteor.Error(404, `takePart not found! ("${playlist.nextPartId}")`)
const takeRundown: Rundown | undefined = rundownData.rundownsMap[takePart.rundownId]
if (!takeRundown) throw new Meteor.Error(500, `takeRundown: takeRundown not found! ("${takePart.rundownId}")`)
let partAfter = fetchAfterInPlaylist(
rundownData.parts,
{
rundownId: takePart.rundownId,
invalid: { $ne: true }
},
playlist,
takeRundown,
takePart
)
<<<<<<<
=======
// const parts = rundown.getParts()
>>>>>>>
<<<<<<<
const segmentsWithParts = playlist.getSegments()
const parts: Part[] = []
_.each(segmentsWithParts, segment => {
let partsInSegment = segment.getParts()
=======
const segmentsWithParts: Segment[] = []
const { segments, parts } = waitForPromise(pSegmentsAndParts)
_.each(segments, segment => {
let partsInSegment = _.filter(parts, p => p.segmentId === segment._id)
>>>>>>>
const segmentsWithParts = playlist.getSegments()
const parts: Part[] = []
_.each(segmentsWithParts, segment => {
let partsInSegment = segment.getParts() |
<<<<<<<
=======
/** Whether the rundown is active or not */
active?: boolean
/** Whether the rundown is active in rehearsal or not */
rehearsal?: boolean
/** the id of the Live Part - if empty, no part in this rundown is live */
currentPartId: string | null
/** the id of the Next Part - if empty, no segment will follow Live Part */
nextPartId: string | null
/** The time offset of the next line */
nextTimeOffset?: number | null
/** if nextPartId was set manually (ie from a user action) */
nextPartManual?: boolean
/** the id of the Previous Part */
previousPartId: string | null
>>>>>>>
<<<<<<<
public unsynced?: boolean
public unsyncedTime?: Time
=======
public active?: boolean
public rehearsal?: boolean
public currentPartId: string | null
public nextPartId: string | null
public nextTimeOffset?: number | null
public nextPartManual?: boolean
public previousPartId: string | null
>>>>>>>
public unsynced?: boolean
public unsyncedTime?: Time
<<<<<<<
public playlistExternalId?: string
public playlistId?: string
public _rank: number
=======
public previousPersistentState?: TimelinePersistentState
>>>>>>>
public playlistExternalId?: string
public playlistId?: string
public _rank: number |
<<<<<<<
import { extendMandadory, getHash, protectString, unprotectString, Omit, ProtectedStringProperties, literal } from '../../../lib/lib'
=======
>>>>>>>
<<<<<<<
export function postProcessPieces(innerContext: ShowStyleContext, pieces: IBlueprintPiece[], blueprintId: BlueprintId, rundownId: RundownId, partId: PartId, allowNowForPiece?: boolean): Piece[] {
=======
export function postProcessPieces(
innerContext: RundownContext,
pieces: IBlueprintPiece[],
blueprintId: BlueprintId,
partId: PartId
): Piece[] {
>>>>>>>
export function postProcessPieces(
innerContext: ShowStyleContext,
pieces: IBlueprintPiece[],
blueprintId: BlueprintId,
rundownId: RundownId,
partId: PartId,
allowNowForPiece?: boolean
): Piece[] {
<<<<<<<
if (!piece.externalId && !piece.isTransition) throw new Meteor.Error(400, `Error in blueprint "${blueprintId}" externalId not set for piece in ${partId}! ("${innerContext.unhashId(unprotectString(piece._id))}")`)
if (!allowNowForPiece && piece.enable.start === 'now') throw new Meteor.Error(400, `Error in blueprint "${blueprintId}" piece cannot have a start of 'now' in ${partId}! ("${innerContext.unhashId(unprotectString(piece._id))}")`)
if (partsUniqueIds[unprotectString(piece._id)]) throw new Meteor.Error(400, `Error in blueprint "${blueprintId}" ids of pieces must be unique! ("${innerContext.unhashId(unprotectString(piece._id))}")`)
=======
if (!piece.externalId && !piece.isTransition)
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" externalId not set for piece in ${partId}! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
)
if (piece.enable.start === 'now')
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" piece cannot have a start of 'now' in ${partId}! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
)
if (partsUniqueIds[unprotectString(piece._id)])
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" ids of pieces must be unique! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
)
>>>>>>>
if (!piece.externalId && !piece.isTransition)
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" externalId not set for piece in ${partId}! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
)
if (!allowNowForPiece && piece.enable.start === 'now')
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" piece cannot have a start of 'now' in ${partId}! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
)
if (partsUniqueIds[unprotectString(piece._id)])
throw new Meteor.Error(
400,
`Error in blueprint "${blueprintId}" ids of pieces must be unique! ("${innerContext.unhashId(
unprotectString(piece._id)
)}")`
) |
<<<<<<<
import Agent from 'meteor/kschingiz:meteor-elastic-apm'
=======
import { BulkWriteOperation, BulkWriteOpResultObject } from 'mongodb'
>>>>>>>
import { BulkWriteOperation, BulkWriteOpResultObject } from 'mongodb'
import Agent from 'meteor/kschingiz:meteor-elastic-apm'
<<<<<<<
async fillWithDataFromDatabase(selector: MongoQuery<DBInterface>): Promise<number> {
const span = Agent.startSpan(`DBCache.fillWithDataFromDatabase.${this.name}`)
const docs = await asyncCollectionFindFetch(this._collection, selector)
this._innerfillWithDataFromArray(docs)
if (span) span.end()
return docs.length
}
fillWithDataFromArray(documents: DBInterface[]) {
return this._innerfillWithDataFromArray(documents.map((doc) => this._transform(doc)))
}
private _innerfillWithDataFromArray(documents: Class[]) {
_.each(documents, (doc) => {
const id = unprotectString(doc._id)
if (this.documents[id]) {
throw new Meteor.Error(
500,
`Unable to fill cache with data "${this._collection['name']}", _id "${doc._id}" already exists`
)
}
this.documents[id] = {
document: doc,
}
})
}
=======
>>>>>>> |
<<<<<<<
import { Segments, Segment } from '../../lib/collections/Segments'
=======
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
>>>>>>>
import { Segments, Segment } from '../../lib/collections/Segments'
import { RundownPlaylists } from '../../lib/collections/RundownPlaylists'
import { PartInstances } from '../../lib/collections/PartInstances'
import { PieceInstances, PieceInstance } from '../../lib/collections/PieceInstances'
import { selectNextPart } from './playout/lib';
<<<<<<<
export function sourceLayerOnPartStop (rundownId: string, partId: string, sourceLayerIds: string[] | string) {
check(rundownId, String)
check(partId, String)
check(sourceLayerIds, Match.OneOf(String, Array))
=======
export function sourceLayerOnPartStop (rundownPlaylistId: string, partInstanceId: string, sourceLayerId: string) {
check(rundownPlaylistId, String)
check(partInstanceId, String)
check(sourceLayerId, String)
>>>>>>>
export function sourceLayerOnPartStop (rundownPlaylistId: string, partInstanceId: string, sourceLayerIds: string[] | string) {
check(rundownPlaylistId, String)
check(partInstanceId, String)
check(sourceLayerIds, Match.OneOf(String, Array))
<<<<<<<
ServerPlayoutAPI.sourceLayerOnPartStop(rundownId, partId, sourceLayerIds)
=======
ServerPlayoutAPI.sourceLayerOnPartStop(rundownPlaylistId, partInstanceId, sourceLayerId)
>>>>>>>
ServerPlayoutAPI.sourceLayerOnPartStop(rundownPlaylistId, partInstanceId, sourceLayerIds)
<<<<<<<
methods[UserActionAPI.methods.setNextSegment] = function (rundownId: string, segmentId: string): ClientAPI.ClientResponse {
return setNextSegment.call(this, rundownId, segmentId)
}
methods[UserActionAPI.methods.prepareForBroadcast] = function (rundownId: string): ClientAPI.ClientResponse {
return prepareForBroadcast.call(this, rundownId)
=======
methods[UserActionAPI.methods.prepareForBroadcast] = function (rundownPlaylistId: string): ClientAPI.ClientResponse {
return prepareForBroadcast.call(this, rundownPlaylistId)
>>>>>>>
methods[UserActionAPI.methods.setNextSegment] = function (rundownPlaylistId: string, segmentId: string): ClientAPI.ClientResponse {
return setNextSegment.call(this, rundownPlaylistId, segmentId)
}
methods[UserActionAPI.methods.prepareForBroadcast] = function (rundownPlaylistId: string): ClientAPI.ClientResponse {
return prepareForBroadcast.call(this, rundownPlaylistId)
<<<<<<<
methods[UserActionAPI.methods.sourceLayerOnPartStop] = function (rundownId: string, partId: string, sourceLayerIds: string[] | string) {
return sourceLayerOnPartStop.call(this, rundownId, partId, sourceLayerIds)
=======
methods[UserActionAPI.methods.segmentAdLibPieceStart] = function (rundownPlaylistId: string, partInstanceId: string, salliId: string, queue: boolean) {
return segmentAdLibPieceStart.call(this, rundownPlaylistId, partInstanceId, salliId, queue)
>>>>>>>
methods[UserActionAPI.methods.segmentAdLibPieceStart] = function (rundownPlaylistId: string, partInstanceId: string, salliId: string, queue: boolean) {
return segmentAdLibPieceStart.call(this, rundownPlaylistId, partInstanceId, salliId, queue) |
<<<<<<<
ServerPlayoutAPI.onPartPlaybackStarted(playlistId0, currentPartInstanceId, now)
=======
ServerPlayoutAPI.onPartPlaybackStarted(DEFAULT_CONTEXT, rundownId0, currentPartInstanceId, now)
>>>>>>>
ServerPlayoutAPI.onPartPlaybackStarted(DEFAULT_CONTEXT, playlistId0, currentPartInstanceId, now)
<<<<<<<
playlistId0,
=======
DEFAULT_CONTEXT,
rundownId0,
>>>>>>>
DEFAULT_CONTEXT,
playlistId0,
<<<<<<<
ServerPlayoutAPI.onPartPlaybackStarted(playlistId0, nextPartInstanceBeforeTakeId!, now)
ServerPlayoutAPI.onPartPlaybackStopped(playlistId0, currentPartInstanceBeforeTakeId!, now)
=======
ServerPlayoutAPI.onPartPlaybackStarted(DEFAULT_CONTEXT, rundownId0, nextPartInstanceBeforeTakeId!, now)
ServerPlayoutAPI.onPartPlaybackStopped(
DEFAULT_CONTEXT,
rundownId0,
currentPartInstanceBeforeTakeId!,
now
)
>>>>>>>
ServerPlayoutAPI.onPartPlaybackStarted(DEFAULT_CONTEXT, playlistId0, nextPartInstanceBeforeTakeId!, now)
ServerPlayoutAPI.onPartPlaybackStopped(
DEFAULT_CONTEXT,
playlistId0,
currentPartInstanceBeforeTakeId!,
now
)
<<<<<<<
playlistId0,
=======
DEFAULT_CONTEXT,
rundownId0,
>>>>>>>
DEFAULT_CONTEXT,
playlistId0, |
<<<<<<<
expect(blueprint).toMatchObject(literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
organizationId: null,
blueprintType: BLUEPRINT_TYPE,
blueprintId: protectString('ss1'),
blueprintVersion: '0.1.0',
integrationVersion: '0.2.0',
TSRVersion: '0.3.0',
minimumCoreVersion: '0.4.0',
showStyleConfigManifest: ['show1'] as any,
studioConfigManifest: [],
code: blueprintStr
}))
})
testInFiber('success - studio', () => {
const BLUEPRINT_TYPE = BlueprintManifestType.STUDIO
const blueprintStr = packageBlueprint({
BLUEPRINT_TYPE
}, () => {
return {
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_showstyle'),
name: 'tmp_showstyle',
organizationId: null,
<<<<<<<
expect(blueprint).toMatchObject(literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString(''),
blueprintType: BLUEPRINT_TYPE,
blueprintVersion: '0.1.0',
integrationVersion: '0.2.0',
TSRVersion: '0.3.0',
minimumCoreVersion: '0.4.0',
showStyleConfigManifest: [],
studioConfigManifest: ['studio1'] as any,
code: blueprintStr
}))
})
testInFiber('success - system', () => {
const BLUEPRINT_TYPE = BlueprintManifestType.SYSTEM
const blueprintStr = packageBlueprint({
BLUEPRINT_TYPE
}, () => {
return {
blueprintId: 'sys',
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
blueprintId: protectString(''),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_studio'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString(''),
<<<<<<<
expect(blueprint).toMatchObject(literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString('sys'),
blueprintType: BLUEPRINT_TYPE,
blueprintVersion: '0.1.0',
integrationVersion: '0.2.0',
TSRVersion: '0.3.0',
minimumCoreVersion: '0.4.0',
showStyleConfigManifest: [],
studioConfigManifest: [],
code: blueprintStr
}))
})
testInFiber('update - studio', () => {
const BLUEPRINT_TYPE = BlueprintManifestType.STUDIO
const blueprintStr = packageBlueprint({
BLUEPRINT_TYPE
}, () => {
return {
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
blueprintId: protectString('sys'),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: protectString('tmp_system'),
name: 'tmp name',
organizationId: null,
blueprintId: protectString('sys'),
<<<<<<<
expect(blueprint).toMatchObject(literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString(''),
blueprintType: BLUEPRINT_TYPE,
blueprintVersion: '0.1.0',
integrationVersion: '0.2.0',
TSRVersion: '0.3.0',
minimumCoreVersion: '0.4.0',
showStyleConfigManifest: [],
studioConfigManifest: ['studio1'] as any,
code: blueprintStr
}))
})
testInFiber('update - matching blueprintId', () => {
const BLUEPRINT_TYPE = BlueprintManifestType.SHOWSTYLE
const blueprintStr = packageBlueprint({
BLUEPRINT_TYPE
}, () => {
return {
blueprintId: 'ss1',
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
blueprintId: protectString(''),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString(''),
<<<<<<<
expect(blueprint).toMatchObject(literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString('ss1'),
blueprintType: BLUEPRINT_TYPE,
blueprintVersion: '0.1.0',
integrationVersion: '0.2.0',
TSRVersion: '0.3.0',
minimumCoreVersion: '0.4.0',
showStyleConfigManifest: ['show1'] as any,
studioConfigManifest: [],
code: blueprintStr
}))
})
testInFiber('update - change blueprintId', () => {
const BLUEPRINT_TYPE = BlueprintManifestType.SHOWSTYLE
const blueprintStr = packageBlueprint({
BLUEPRINT_TYPE
}, () => {
return {
blueprintId: 'show2',
=======
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
blueprintId: protectString('ss1'),
>>>>>>>
expect(blueprint).toMatchObject(
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion'>>({
_id: existingBlueprint._id,
name: existingBlueprint.name,
organizationId: null,
blueprintId: protectString('ss1'), |
<<<<<<<
const playlist = rundown.getRundownPlaylist()
_.each(messages, (message: IBlueprintExternalMessageQueueObj) => {
=======
const playlist = rundown.getRundownPlaylist()
_.each(messages, (message) => {
>>>>>>>
const playlist = rundown.getRundownPlaylist()
_.each(messages, (message: IBlueprintExternalMessageQueueObj) => {
<<<<<<<
expires: { $gt: now },
lastTry: { $not: { $gt: now - tryInterval } },
=======
>>>>>>> |
<<<<<<<
import { ReloadRundownPlaylistResponse, ReloadRundownResponse } from '../../lib/api/userActions'
import { MethodContextAPI, MethodContext } from '../../lib/api/methods'
import { StudioContentWriteAccess, StudioReadAccess } from '../security/studio'
import { RundownPlaylistContentWriteAccess, RundownPlaylistReadAccess } from '../security/rundownPlaylist'
=======
import { ReloadRundownPlaylistResponse, TriggerReloadDataResponse } from '../../lib/api/userActions'
>>>>>>>
import { ReloadRundownPlaylistResponse, TriggerReloadDataResponse } from '../../lib/api/userActions'
import { MethodContextAPI, MethodContext } from '../../lib/api/methods'
import { StudioContentWriteAccess, StudioReadAccess } from '../security/studio'
import { RundownPlaylistContentWriteAccess, RundownPlaylistReadAccess } from '../security/rundownPlaylist'
<<<<<<<
/** Resync all rundowns in a rundownPlaylist */
export function resyncRundownPlaylist (context: MethodContext, playlistId: RundownPlaylistId): ReloadRundownPlaylistResponse {
=======
export function unsyncSegment (rundownId: RundownId, segmentId: SegmentId): void {
const cache = waitForPromise(initCacheForRundownPlaylistFromRundown(rundownId))
const result = unsyncSegmentInner(cache, rundownId, segmentId)
waitForPromise(cache.saveAllToDatabase())
return result
}
/** Remove a RundownPlaylist and all its contents */
export function removeRundownPlaylistInner(cache: CacheForRundownPlaylist, playlistId: RundownPlaylistId) {
>>>>>>>
/** Resync all rundowns in a rundownPlaylist */
export function resyncRundownPlaylist (context: MethodContext, playlistId: RundownPlaylistId): ReloadRundownPlaylistResponse {
<<<<<<<
unsyncRundown (rundownId: RundownId) {
return makePromise(() => ServerRundownAPI.unsyncRundown(this, rundownId))
=======
resyncSegment (segmentId: SegmentId) {
return makePromise(() => ServerRundownAPI.resyncSegment(segmentId))
}
unsyncRundown (rundownId: RundownId) {
return makePromise(() => ServerRundownAPI.unsyncRundown(rundownId))
>>>>>>>
resyncSegment (segmentId: SegmentId) {
return makePromise(() => ServerRundownAPI.resyncSegment(this, segmentId))
}
unsyncRundown (rundownId: RundownId) {
return makePromise(() => ServerRundownAPI.unsyncRundown(this, rundownId)) |
<<<<<<<
* 1.15.0: Release 27
* 1.16.0: Release 28
=======
* 1.15.0: Release 27 (2020-12-08)
>>>>>>>
* 1.15.0: Release 27 (2020-12-08)
* 1.16.0: Release 28 |
<<<<<<<
import {
VTContent,
SourceLayerType,
ISourceLayer,
IBlueprintPieceGeneric
} from 'tv-automation-sofie-blueprints-integration'
=======
import { VTContent, SourceLayerType, ISourceLayer } from 'tv-automation-sofie-blueprints-integration'
>>>>>>>
import {
VTContent,
SourceLayerType,
ISourceLayer,
IBlueprintPieceGeneric,
} from 'tv-automation-sofie-blueprints-integration'
<<<<<<<
export function getMediaObjectMediaId (piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
=======
export function getMediaObjectMediaId(piece: InternalIBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
>>>>>>>
export function getMediaObjectMediaId(piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer) {
<<<<<<<
export function checkPieceContentStatus (piece: IBlueprintPieceGeneric, sourceLayer: ISourceLayer | undefined, settings: IStudioSettings | undefined, t?: i18next.TranslationFunction<any, object, string>) {
=======
export function checkPieceContentStatus(
piece: InternalIBlueprintPieceGeneric,
sourceLayer: ISourceLayer | undefined,
settings: IStudioSettings | undefined,
t?: i18next.TranslationFunction<any, object, string>
) {
>>>>>>>
export function checkPieceContentStatus(
piece: IBlueprintPieceGeneric,
sourceLayer: ISourceLayer | undefined,
settings: IStudioSettings | undefined,
t?: i18next.TranslationFunction<any, object, string>
) { |
<<<<<<<
import { rundownContentAllowWrite } from '../security/rundown'
=======
import { Settings } from '../../lib/Settings'
>>>>>>>
import { rundownContentAllowWrite } from '../security/rundown'
<<<<<<<
let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (playlist.active && !playlist.rehearsal) {
=======
let playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.active && !playlist.rehearsal && !Settings.allowRundownResetOnAir) {
>>>>>>>
let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.active && !playlist.rehearsal && !Settings.allowRundownResetOnAir) {
<<<<<<<
let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (playlist.active && !playlist.rehearsal) {
=======
let playlist = RundownPlaylists.findOne(rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.active && !playlist.rehearsal && !Settings.allowRundownResetOnAir) {
>>>>>>>
let playlist = checkAccessAndGetPlaylist(context, rundownPlaylistId)
if (!playlist) throw new Meteor.Error(404, `Rundown Playlist "${rundownPlaylistId}" not found!`)
if (playlist.active && !playlist.rehearsal && !Settings.allowRundownResetOnAir) { |
<<<<<<<
if (playlist.holdState === RundownHoldState.COMPLETE) {
cache.RundownPlaylists.update(playlist._id, {
$set: {
holdState: RundownHoldState.NONE,
},
})
// If hold is active, then this take is to clear it
} else if (playlist.holdState === RundownHoldState.ACTIVE) {
completeHold(cache, playlist, currentPartInstance)
cache.saveTimelineThenAllToDatabase()
return ClientAPI.responseSuccess(undefined)
=======
if (isTooCloseToAutonext(currentPart, true)) {
return ClientAPI.responseError('Cannot take shortly before an autoTake')
>>>>>>>
if (isTooCloseToAutonext(currentPart, true)) {
return ClientAPI.responseError('Cannot take shortly before an autoTake')
<<<<<<<
})
cache.saveTimelineThenAllToDatabase()
=======
>>>>>>> |
<<<<<<<
=======
import {useAppBridge} from '../app-bridge';
>>>>>>> |
<<<<<<<
cellMenu: {
autoAdjustDrop: true,
autoAlignSide: true,
hideCloseButton: true,
hideCommandSection: false,
hideOptionSection: false,
},
=======
fadeSpeed: 0, // this should go inside columnPicker but there's a bug in that plugin and it's pulling it from grid options instead
>>>>>>>
cellMenu: {
autoAdjustDrop: true,
autoAlignSide: true,
hideCloseButton: true,
hideCommandSection: false,
hideOptionSection: false,
},
fadeSpeed: 0, // this should go inside columnPicker but there's a bug in that plugin and it's pulling it from grid options instead |
<<<<<<<
import { UnauthorizedForPricingComponent } from './auth/unauthorized-for-pricing/unauthorized-for-pricing.component';
=======
import { EventsAnalyticsComponent } from './analytics2/metriche/events-analytics/events-analytics.component';
>>>>>>>
import { UnauthorizedForPricingComponent } from './auth/unauthorized-for-pricing/unauthorized-for-pricing.component';
import { EventsAnalyticsComponent } from './analytics2/metriche/events-analytics/events-analytics.component';
<<<<<<<
SatisfactionComponent,
UnauthorizedForPricingComponent
=======
SatisfactionComponent,
EventsAnalyticsComponent
>>>>>>>
SatisfactionComponent,
UnauthorizedForPricingComponent,
EventsAnalyticsComponent |
<<<<<<<
export {Options, User, Messages} from './EASDK';
=======
export {default as Intl} from './Intl';
>>>>>>>
export {Options, User, Messages} from './EASDK';
export {default as Intl} from './Intl'; |
<<<<<<<
const response = await wasmTerminalConfig.fetchCommand(
commandName,
commandArgs,
envEntries
);
=======
// Fetch the command
if (wasmTty) {
wasmTty.printStatus(`[INFO] Fetching the command ${commandName} ...`);
}
const response = await wasmTerminalConfig.fetchCommand(commandName);
if (wasmTty) {
wasmTty.clearStatus();
}
>>>>>>>
// Fetch the command
if (wasmTty) {
wasmTty.printStatus(`[INFO] Fetching the command ${commandName} ...`);
}
const response = await wasmTerminalConfig.fetchCommand(
commandName,
commandArgs,
envEntries
);
if (wasmTty) {
wasmTty.clearStatus();
} |
<<<<<<<
import { DeckAction } from "./app/utils/editor/deck-action";
import { SelectedElementDescription, SelectedSlideDescription } from "./app/utils/editor/selected-element.utils";
import { EditAction } from "./app/utils/editor/edit-action";
=======
import { DeckAction } from "./app/types/editor/deck-action";
import { EditAction } from "./app/types/editor/edit-action";
>>>>>>>
import { DeckAction } from "./app/types/editor/deck-action";
import { SelectedElementDescription, SelectedSlideDescription } from "./app/utils/editor/selected-element.utils";
import { EditAction } from "./app/types/editor/edit-action"; |
<<<<<<<
import behaviorInsertSymbol from '../behaviors/insert_symbol/insert_symbol-plugin-symbol';
import behaviorInsertSymbolEmoji from '../behaviors/insert_symbol/insert_symbol-plugin-emoji';
import behaviorOmniInsert from '../behaviors/omni_insert/omni_insert';
=======
import behaviorInsertSymbol from '../behaviors/insert_symbol/insert_symbol';
>>>>>>>
import behaviorInsertSymbol from '../behaviors/insert_symbol/insert_symbol-plugin-symbol';
import behaviorInsertSymbolEmoji from '../behaviors/insert_symbol/insert_symbol-plugin-emoji';
<<<<<<<
behaviorInsertSymbolEmoji,
behaviorOmniInsert,
=======
>>>>>>>
behaviorInsertSymbolEmoji, |
<<<<<<<
import { SkinTone } from './emoji';
import { AceChunkEditor } from '../optional/ace/ace_editor';
=======
>>>>>>>
import { AceChunkEditor } from '../optional/ace/ace_editor'; |
<<<<<<<
import { EditorMath } from './math';
=======
import { EditorServer } from './server';
>>>>>>>
import { EditorMath } from './math';
import { EditorServer } from './server'; |
<<<<<<<
//
const { x, y, w } = egret3d.stage.absolutePosition;
const scale = egret3d.stage.screenViewport.w / w;
egret3d.InputManager.touch.updateOffsetAndScale(x, y, scale);
egret3d.InputManager.mouse.updateOffsetAndScale(x, y, scale);
// Update behaviours.
if (this._isEditorUpdate()) {
if (this._onResetBehaviours.length > 0) {
for (const component of this._onResetBehaviours) {
if (component) {
component._isReseted = true;
component.onReset();
}
}
this._onResetBehaviours.length = 0;
}
if (this._components.length > 0) {
for (const component of this._components) {
if (component && _executeInEditModeComponents.indexOf(component.constructor) >= 0) {
component.onEnable();
if (!component._isStarted && component.isActiveAndEnabled) {
component._isStarted = true;
component.onStart();
}
}
}
this._components.length = 0;
}
}
else {
if (this._components.length > 0) {
for (const component of this._components) {
if (component) {
component.onEnable();
if (!component._isStarted && component.isActiveAndEnabled) {
component._isStarted = true;
component.onStart();
}
}
}
this._components.length = 0;
}
}
=======
const { x, y, w, h } = egret3d.stage.absolutePosition;
const scaleX = egret3d.stage.screenViewport.w / w;
const scaleY = egret3d.stage.screenViewport.h / h;
egret3d.InputManager.touch.updateOffsetAndScale(x, y, scaleX, scaleY);
egret3d.InputManager.mouse.updateOffsetAndScale(x, y, scaleX, scaleY);
>>>>>>>
const { x, y, w, h } = egret3d.stage.absolutePosition;
const scaleX = egret3d.stage.screenViewport.w / w;
const scaleY = egret3d.stage.screenViewport.h / h;
egret3d.InputManager.touch.updateOffsetAndScale(x, y, scaleX, scaleY);
egret3d.InputManager.mouse.updateOffsetAndScale(x, y, scaleX, scaleY);
// Update behaviours.
if (this._isEditorUpdate()) {
if (this._onResetBehaviours.length > 0) {
for (const component of this._onResetBehaviours) {
if (component) {
component._isReseted = true;
component.onReset();
}
}
this._onResetBehaviours.length = 0;
}
if (this._components.length > 0) {
for (const component of this._components) {
if (component && _executeInEditModeComponents.indexOf(component.constructor) >= 0) {
component.onEnable();
if (!component._isStarted && component.isActiveAndEnabled) {
component._isStarted = true;
component.onStart();
}
}
}
this._components.length = 0;
}
}
else {
if (this._components.length > 0) {
for (const component of this._components) {
if (component) {
component.onEnable();
if (!component._isStarted && component.isActiveAndEnabled) {
component._isStarted = true;
component.onStart();
}
}
}
this._components.length = 0;
}
} |
<<<<<<<
const EXEC_PATH = join(__dirname, '../dist/bin')
const PROJECT = join(TEST_DIR, 'tsconfig.json')
const BIN_EXEC = `node "${EXEC_PATH}" --project "${PROJECT}"`
=======
const PROJECT = join(TEST_DIR, semver.gte(ts.version, '2.5.0') ? 'tsconfig.json5' : 'tsconfig.json')
const BIN_EXEC = `node "${join(__dirname, '../dist/bin')}" --project "${PROJECT}"`
const SCRIPT_EXEC = `node "${join(__dirname, '../dist/script')}"`
>>>>>>>
const PROJECT = join(TEST_DIR, 'tsconfig.json')
const BIN_EXEC = `node "${join(__dirname, '../dist/bin')}" --project "${PROJECT}"`
const SCRIPT_EXEC = `node "${join(__dirname, '../dist/script')}"`
<<<<<<<
it('should give ts error for invalid node_modules', function (done) {
exec(`${BIN_EXEC} --skip-ignore tests/from-node-modules`, function (err, stdout) {
if (err === null) return done('Expected an error')
expect(err.message).to.contain('Unable to compile file from external library')
return done()
})
})
=======
if (semver.gte(ts.version, '2.7.0')) {
it('should support script mode', function (done) {
exec(`${SCRIPT_EXEC} tests/scope/a/log`, function (err, stdout) {
expect(err).to.equal(null)
expect(stdout).to.equal('.ts\n')
return done()
})
})
}
>>>>>>>
it('should give ts error for invalid node_modules', function (done) {
exec(`${BIN_EXEC} --skip-ignore tests/from-node-modules`, function (err, stdout) {
if (err === null) return done('Expected an error')
expect(err.message).to.contain('Unable to compile file from external library')
return done()
})
})
if (semver.gte(ts.version, '2.7.0')) {
it('should support script mode', function (done) {
exec(`${SCRIPT_EXEC} tests/scope/a/log`, function (err, stdout) {
expect(err).to.equal(null)
expect(stdout).to.equal('.ts\n')
return done()
})
})
} |
<<<<<<<
export interface Options {
cwd?: string | null
build?: boolean | null
=======
export interface CreateOptions {
dir?: string
scope?: boolean | null
>>>>>>>
export interface CreateOptions {
dir?: string
build?: boolean | null
scope?: boolean | null
<<<<<<<
export const DEFAULTS: Options = {
cwd: process.env.TS_NODE_CWD,
files: yn(process.env.TS_NODE_FILES),
pretty: yn(process.env.TS_NODE_PRETTY),
compiler: process.env.TS_NODE_COMPILER,
compilerOptions: parse(process.env.TS_NODE_COMPILER_OPTIONS),
ignore: split(process.env.TS_NODE_IGNORE),
project: process.env.TS_NODE_PROJECT,
skipProject: yn(process.env.TS_NODE_SKIP_PROJECT),
skipIgnore: yn(process.env.TS_NODE_SKIP_IGNORE),
preferTsExts: yn(process.env.TS_NODE_PREFER_TS_EXTS),
ignoreDiagnostics: split(process.env.TS_NODE_IGNORE_DIAGNOSTICS),
transpileOnly: yn(process.env.TS_NODE_TRANSPILE_ONLY),
logError: yn(process.env.TS_NODE_LOG_ERROR),
build: yn(process.env.TS_NODE_BUILD)
=======
export const DEFAULTS: RegisterOptions = {
dir: process.env.TS_NODE_DIR,
scope: yn(process.env.TS_NODE_SCOPE),
files: yn(process.env['TS_NODE_FILES']),
pretty: yn(process.env['TS_NODE_PRETTY']),
compiler: process.env['TS_NODE_COMPILER'],
compilerOptions: parse(process.env['TS_NODE_COMPILER_OPTIONS']),
ignore: split(process.env['TS_NODE_IGNORE']),
project: process.env['TS_NODE_PROJECT'],
skipIgnore: yn(process.env['TS_NODE_SKIP_IGNORE']),
skipProject: yn(process.env['TS_NODE_SKIP_PROJECT']),
preferTsExts: yn(process.env['TS_NODE_PREFER_TS_EXTS']),
ignoreDiagnostics: split(process.env['TS_NODE_IGNORE_DIAGNOSTICS']),
typeCheck: yn(process.env['TS_NODE_TYPE_CHECK']),
transpileOnly: yn(process.env['TS_NODE_TRANSPILE_ONLY']),
logError: yn(process.env['TS_NODE_LOG_ERROR'])
>>>>>>>
export const DEFAULTS: RegisterOptions = {
dir: process.env.TS_NODE_DIR,
build: yn(process.env.TS_NODE_BUILD),
scope: yn(process.env.TS_NODE_SCOPE),
files: yn(process.env.TS_NODE_FILES),
pretty: yn(process.env.TS_NODE_PRETTY),
compiler: process.env.TS_NODE_COMPILER,
compilerOptions: parse(process.env.TS_NODE_COMPILER_OPTIONS),
ignore: split(process.env.TS_NODE_IGNORE),
project: process.env.TS_NODE_PROJECT,
skipProject: yn(process.env.TS_NODE_SKIP_PROJECT),
skipIgnore: yn(process.env.TS_NODE_SKIP_IGNORE),
preferTsExts: yn(process.env.TS_NODE_PREFER_TS_EXTS),
ignoreDiagnostics: split(process.env.TS_NODE_IGNORE_DIAGNOSTICS),
transpileOnly: yn(process.env.TS_NODE_TRANSPILE_ONLY),
logError: yn(process.env.TS_NODE_LOG_ERROR)
<<<<<<<
export function register (opts: Options = {}): Register {
const options = { ...DEFAULTS, ...opts }
=======
export function register (opts: RegisterOptions = {}): Register {
const options = Object.assign({}, DEFAULTS, opts)
>>>>>>>
export function register (opts: RegisterOptions = {}): Register {
const options = { ...DEFAULTS, ...opts }
<<<<<<<
const cwd = options.cwd || process.cwd()
const transpileOnly = options.transpileOnly === true
=======
const cwd = options.dir ? resolve(options.dir) : process.cwd()
const isScoped = options.scope ? (fileName: string) => relative(cwd, fileName).charAt(0) !== '.' : () => true
const typeCheck = options.typeCheck === true || options.transpileOnly !== true
>>>>>>>
const cwd = options.dir ? resolve(options.dir) : process.cwd()
const isScoped = options.scope ? (fileName: string) => relative(cwd, fileName).charAt(0) !== '.' : () => true
const transpileOnly = options.transpileOnly === true |
<<<<<<<
private _itemList: { [name: string]: number };
private _itemMultipliers: { [name: string]: number };
private _mineEnergy: KnockoutObservable<number>;
private _maxMineEnergy: KnockoutObservable<number>;
private _mineEnergyGain: KnockoutObservable<number>;
private _mineInventory: KnockoutObservableArray<any>;
private _diamonds: KnockoutObservable<number>;
private _maxDailyDeals: KnockoutObservable<number>;
private _maxUndergroundItems: KnockoutObservable<number>;
private _mineEnergyRegenTime: KnockoutObservable<number>;
=======
>>>>>>>
private _itemList: { [name: string]: number };
private _itemMultipliers: { [name: string]: number };
private _mineEnergy: KnockoutObservable<number>;
private _maxMineEnergy: KnockoutObservable<number>;
private _mineEnergyGain: KnockoutObservable<number>;
private _mineInventory: KnockoutObservableArray<any>;
private _diamonds: KnockoutObservable<number>;
private _maxDailyDeals: KnockoutObservable<number>;
private _maxUndergroundItems: KnockoutObservable<number>;
private _mineEnergyRegenTime: KnockoutObservable<number>;
<<<<<<<
"_mineEnergy",
"_maxMineEnergy",
"_mineEnergyGain",
"_mineInventory",
"_maxDailyDeals",
"_diamonds",
"_maxUndergroundItems",
"_mineEnergyRegenTime",
=======
"_shardUpgrades", "_shardsCollected",
"achievementsCompleted",
>>>>>>>
"_mineEnergy",
"_maxMineEnergy",
"_mineEnergyGain",
"_mineInventory",
"_maxDailyDeals",
"_diamonds",
"_maxUndergroundItems",
"_mineEnergyRegenTime", |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.