Skip to content

Commit

Permalink
chore: make private property camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarpl committed Nov 1, 2023
1 parent df8747a commit 58e1264
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
#playlistHasChanged = false
#timelineHasChanged = false

#PendingPartInstanceTimingEvents = new Set<PartInstanceId>()
#PendingNotifyCurrentlyPlayingPartEvent = new Map<RundownId, string | null>()
#pendingPartInstanceTimingEvents = new Set<PartInstanceId>()
#pendingNotifyCurrentlyPlayingPartEvent = new Map<RundownId, string | null>()

get hackDeletedPartInstanceIds(): PartInstanceId[] {
const result: PartInstanceId[] = []
Expand Down Expand Up @@ -437,14 +437,14 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
}

queuePartInstanceTimingEvent(partInstanceId: PartInstanceId): void {
this.#PendingPartInstanceTimingEvents.add(partInstanceId)
this.#pendingPartInstanceTimingEvents.add(partInstanceId)
}

queueNotifyCurrentlyPlayingPartEvent(rundownId: RundownId, partInstance: PlayoutPartInstanceModel | null): void {
if (partInstance && partInstance.partInstance.part.shouldNotifyCurrentPlayingPart) {
this.#PendingNotifyCurrentlyPlayingPartEvent.set(rundownId, partInstance.partInstance.part.externalId)
this.#pendingNotifyCurrentlyPlayingPartEvent.set(rundownId, partInstance.partInstance.part.externalId)
} else if (!partInstance) {
this.#PendingNotifyCurrentlyPlayingPartEvent.set(rundownId, null)
this.#pendingNotifyCurrentlyPlayingPartEvent.set(rundownId, null)
}
}

Expand Down Expand Up @@ -571,13 +571,13 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
}
this.#deferredAfterSaveFunctions.length = 0 // clear the array

for (const partInstanceId of this.#PendingPartInstanceTimingEvents) {
for (const partInstanceId of this.#pendingPartInstanceTimingEvents) {
// Run in the background, we don't want to hold onto the lock to do this
queuePartInstanceTimingEvent(this.context, this.playlistId, partInstanceId)
}
this.#PendingPartInstanceTimingEvents.clear()
this.#pendingPartInstanceTimingEvents.clear()

for (const [rundownId, partExternalId] of this.#PendingNotifyCurrentlyPlayingPartEvent) {
for (const [rundownId, partExternalId] of this.#pendingNotifyCurrentlyPlayingPartEvent) {
// This is low-prio, defer so that it's executed well after publications has been updated,
// so that the playout gateway has had the chance to learn about the timeline changes
this.context
Expand All @@ -590,7 +590,7 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
logger.warn(`Failed to queue NotifyCurrentlyPlayingPart job: ${e}`)
})
}
this.#PendingNotifyCurrentlyPlayingPartEvent.clear()
this.#pendingNotifyCurrentlyPlayingPartEvent.clear()

if (span) span.end()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class PlayoutPieceInstanceModelImpl implements PlayoutPieceInstanceModel
this.PieceInstanceImpl[key] = newValue
}

this.#HasChanges = true
this.#hasChanges = true
}

/**
Expand All @@ -52,19 +52,19 @@ export class PlayoutPieceInstanceModelImpl implements PlayoutPieceInstanceModel
}
}

#HasChanges = false
#hasChanges = false
/**
* Whether this PieceInstance has unsaved changes
*/
get HasChanges(): boolean {
return this.#HasChanges
return this.#hasChanges
}

/**
* Clear the `HasChanges` flag
*/
clearChangedFlag(): void {
this.#HasChanges = false
this.#hasChanges = false
}

get pieceInstance(): ReadonlyDeep<PieceInstance> {
Expand All @@ -73,7 +73,7 @@ export class PlayoutPieceInstanceModelImpl implements PlayoutPieceInstanceModel

constructor(pieceInstances: PieceInstance, hasChanges: boolean) {
this.PieceInstanceImpl = pieceInstances
this.#HasChanges = hasChanges
this.#hasChanges = hasChanges
}

/**
Expand All @@ -86,7 +86,7 @@ export class PlayoutPieceInstanceModelImpl implements PlayoutPieceInstanceModel
...clone<PieceInstance>(pieceInstance),
}

this.#HasChanges = true
this.#hasChanges = true
}

prepareForHold(): PieceInstanceInfiniteId {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part'
import { PlayoutSegmentModel } from '../PlayoutSegmentModel'

export class PlayoutSegmentModelImpl implements PlayoutSegmentModel {
readonly #Segment: DBSegment
readonly #segment: DBSegment
readonly parts: ReadonlyDeep<DBPart[]>

get segment(): ReadonlyDeep<DBSegment> {
return this.#Segment
return this.#segment
}

constructor(segment: DBSegment, parts: DBPart[]) {
parts.sort((a, b) => a._rank - b._rank)

this.#Segment = segment
this.#segment = segment
this.parts = parts
}

Expand All @@ -33,9 +33,9 @@ export class PlayoutSegmentModelImpl implements PlayoutSegmentModel {
* @param rank New rank for the segment
*/
setScratchpadRank(rank: number): void {
if (this.#Segment.orphaned !== SegmentOrphanedReason.SCRATCHPAD)
if (this.#segment.orphaned !== SegmentOrphanedReason.SCRATCHPAD)
throw new Error('setScratchpadRank can only be used on a SCRATCHPAD segment')

this.#Segment._rank = rank
this.#segment._rank = rank
}
}

0 comments on commit 58e1264

Please sign in to comment.