@@ -65,10 +65,7 @@ meteorPublish(PeripheralDevicePubSub.rundownsForDevice, async function (deviceId
6565 throw new Meteor . Error ( 403 , 'Publication can only be used by authorized PeripheralDevices' )
6666
6767 // No studio, then no rundowns
68- if ( ! resolvedCred . device . studioId ) {
69- this . ready ( )
70- return null
71- }
68+ if ( ! resolvedCred . device . studioId ) return null
7269
7370 selector . studioId = resolvedCred . device . studioId
7471
@@ -90,10 +87,7 @@ meteorPublish(
9087 check ( playlistIds , Array )
9188
9289 // If values were provided, they must have values
93- if ( playlistIds . length === 0 ) {
94- this . ready ( )
95- return null
96- }
90+ if ( playlistIds . length === 0 ) return null
9791
9892 const { cred, selector } = await AutoFillSelector . organizationId < DBRundown > (
9993 this . userId ,
@@ -127,10 +121,7 @@ meteorPublish(
127121 async function ( showStyleBaseIds : ShowStyleBaseId [ ] , token : string | undefined ) {
128122 check ( showStyleBaseIds , Array )
129123
130- if ( showStyleBaseIds . length === 0 ) {
131- this . ready ( )
132- return null
133- }
124+ if ( showStyleBaseIds . length === 0 ) return null
134125
135126 const { cred, selector } = await AutoFillSelector . organizationId < DBRundown > (
136127 this . userId ,
@@ -165,10 +156,7 @@ meteorPublish(
165156 async function ( rundownIds : RundownId [ ] , filter : { omitHidden ?: boolean } | undefined , token : string | undefined ) {
166157 check ( rundownIds , Array )
167158
168- if ( rundownIds . length === 0 ) {
169- this . ready ( )
170- return null
171- }
159+ if ( rundownIds . length === 0 ) return null
172160
173161 const selector : MongoQuery < DBSegment > = {
174162 rundownId : { $in : rundownIds } ,
@@ -195,14 +183,8 @@ meteorPublish(
195183 check ( rundownIds , Array )
196184 check ( segmentIds , Match . Maybe ( Array ) )
197185
198- if ( rundownIds . length === 0 ) {
199- this . ready ( )
200- return null
201- }
202- if ( segmentIds && segmentIds . length === 0 ) {
203- this . ready ( )
204- return null
205- }
186+ if ( rundownIds . length === 0 ) return null
187+ if ( segmentIds && segmentIds . length === 0 ) return null
206188
207189 const modifier : FindOptions < DBPart > = {
208190 fields : {
@@ -237,10 +219,7 @@ meteorPublish(
237219 check ( rundownIds , Array )
238220 check ( playlistActivationId , Match . Maybe ( String ) )
239221
240- if ( rundownIds . length === 0 || ! playlistActivationId ) {
241- this . ready ( )
242- return null
243- }
222+ if ( rundownIds . length === 0 || ! playlistActivationId ) return null
244223
245224 const modifier : FindOptions < DBPartInstance > = {
246225 fields : {
@@ -273,10 +252,7 @@ meteorPublish(
273252 ) {
274253 check ( rundownIds , Array )
275254
276- if ( rundownIds . length === 0 ) {
277- this . ready ( )
278- return null
279- }
255+ if ( rundownIds . length === 0 ) return null
280256
281257 const selector : MongoQuery < DBPartInstance > = {
282258 rundownId : { $in : rundownIds } ,
@@ -314,10 +290,7 @@ meteorPublish(
314290 check ( partIds , Match . Maybe ( Array ) )
315291
316292 // If values were provided, they must have values
317- if ( partIds && partIds . length === 0 ) {
318- this . ready ( )
319- return null
320- }
293+ if ( partIds && partIds . length === 0 ) return null
321294
322295 const selector : MongoQuery < Piece > = {
323296 startRundownId : { $in : rundownIds } ,
@@ -388,10 +361,7 @@ const adlibPiecesSubFields: MongoFieldSpecifierZeroes<AdLibPiece> = {
388361meteorPublish ( CorelibPubSub . adLibPieces , async function ( rundownIds : RundownId [ ] , token : string | undefined ) {
389362 check ( rundownIds , Array )
390363
391- if ( rundownIds . length === 0 ) {
392- this . ready ( )
393- return null
394- }
364+ if ( rundownIds . length === 0 ) return null
395365
396366 const selector : MongoQuery < AdLibPiece > = {
397367 rundownId : { $in : rundownIds } ,
@@ -447,14 +417,8 @@ meteorPublish(
447417 check ( partInstanceIds , Match . Maybe ( Array ) )
448418
449419 // If values were provided, they must have values
450- if ( rundownIds . length === 0 ) {
451- this . ready ( )
452- return null
453- }
454- if ( partInstanceIds && partInstanceIds . length === 0 ) {
455- this . ready ( )
456- return null
457- }
420+ if ( rundownIds . length === 0 ) return null
421+ if ( partInstanceIds && partInstanceIds . length === 0 ) return null
458422
459423 const selector : MongoQuery < PieceInstance > = {
460424 rundownId : { $in : rundownIds } ,
@@ -521,10 +485,7 @@ meteorPublish(
521485 ) {
522486 check ( rundownIds , Array )
523487
524- if ( rundownIds . length === 0 ) {
525- this . ready ( )
526- return null
527- }
488+ if ( rundownIds . length === 0 ) return null
528489
529490 const selector : MongoQuery < PieceInstance > = {
530491 rundownId : { $in : rundownIds } ,
@@ -561,10 +522,7 @@ meteorPublish(
561522 if ( ! peripheralDevice ) throw new Meteor . Error ( `PeripheralDevice "${ deviceId } " not found` )
562523
563524 const studioId = peripheralDevice . studioId
564- if ( ! studioId ) {
565- this . ready ( )
566- return null
567- }
525+ if ( ! studioId ) return null
568526
569527 return ExpectedPlayoutItems . findWithCursor ( { studioId } )
570528 }
@@ -593,10 +551,7 @@ meteorPublish(
593551 async function ( rundownIds : RundownId [ ] , token : string | undefined ) {
594552 check ( rundownIds , Array )
595553
596- if ( rundownIds . length === 0 ) {
597- this . ready ( )
598- return null
599- }
554+ if ( rundownIds . length === 0 ) return null
600555
601556 const selector : MongoQuery < RundownBaselineAdLibItem > = {
602557 rundownId : { $in : rundownIds } ,
@@ -624,10 +579,7 @@ const adlibActionSubFields: MongoFieldSpecifierZeroes<AdLibAction> = {
624579meteorPublish ( CorelibPubSub . adLibActions , async function ( rundownIds : RundownId [ ] , token : string | undefined ) {
625580 check ( rundownIds , Array )
626581
627- if ( rundownIds . length === 0 ) {
628- this . ready ( )
629- return null
630- }
582+ if ( rundownIds . length === 0 ) return null
631583
632584 const selector : MongoQuery < AdLibAction > = {
633585 rundownId : { $in : rundownIds } ,
@@ -666,10 +618,7 @@ meteorPublish(
666618 async function ( rundownIds : RundownId [ ] , token : string | undefined ) {
667619 check ( rundownIds , Array )
668620
669- if ( rundownIds . length === 0 ) {
670- this . ready ( )
671- return null
672- }
621+ if ( rundownIds . length === 0 ) return null
673622
674623 const selector : MongoQuery < RundownBaselineAdLibAction > = {
675624 rundownId : { $in : rundownIds } ,
0 commit comments