Skip to content

Commit

Permalink
fix: write markdown and simple version of script to sofie
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 28, 2024
1 parent c1abf03 commit e230a42
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ExpectedPackageHandler } from './dataHandlers/ExpectedPackageHandler.js
import * as fs from 'fs'
import * as path from 'path'
import { ExpectedPackageId } from './CoreDataTypes/Ids.js'
import { stringifyError } from '@sofie-prompter-editor/shared-lib'
import { removeMarkdownish, stringifyError } from '@sofie-prompter-editor/shared-lib'
import { PackageInfoHandler } from './dataHandlers/PackageInfoHandler.js'
import { PROMPTER_PACKAGE_INFO_TYPE } from './CoreDataTypes/PackageInfo.js'

Expand Down Expand Up @@ -411,7 +411,8 @@ export class SofieCoreConnection extends EventEmitter<SofieCoreConnectionEvents>

const payload: ScriptPackageInfoPayload = {
originalScript: storedPart.scriptContents,
modifiedScript: script,
modifiedScriptMarkdown: script,
modifiedScriptSimple: removeMarkdownish(script),
modified: Date.now(),
}

Expand All @@ -432,6 +433,7 @@ export class SofieCoreConnection extends EventEmitter<SofieCoreConnectionEvents>
// PackageInfo type, as known in the nrk-blueprints
export interface ScriptPackageInfoPayload {
originalScript: string
modifiedScript: string
modifiedScriptMarkdown: string
modifiedScriptSimple: string
modified: number
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ExpectedPackageTransformer {
// This means that Core has an edited script stored and that it is recent. Use that:
const payload = corePackageInfo.payload as ScriptPackageInfoPayload

result.editedScriptContents = payload.modifiedScript
result.editedScriptContents = payload.modifiedScriptMarkdown
} else {
// can't use the info
// ignore any packageinfo, as the original script has changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UILine } from 'src/model/UILine'
import classes from './CurrentRundown.module.scss'
import { LineTypeIcon } from './LineTypeIcon'
import { TimeSpan } from '../TimeSpan/TimeSpan'
import { removeMarkdownish } from 'src/lib/markdownishUtils'
import { removeMarkdownish } from '@sofie-prompter-editor/shared-lib'

const Line = observer(
({
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/client/src/model/UILine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Part, PartDisplayType, PartId } from '@sofie-prompter-editor/shared-mod
import { RundownStore } from '../stores/RundownStore'
import { action, makeAutoObservable } from 'mobx'
import { UISegment } from './UISegment'
import { convertPlainTextScriptToMarkdown } from 'src/lib/markdownishUtils'
import { convertPlainTextScriptToMarkdown } from '@sofie-prompter-editor/shared-lib'

export type UILineId = PartId

Expand Down
1 change: 1 addition & 0 deletions packages/shared/lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './constants.js'
export * from './errors.js'
export * from './objects.js'
export * from './type.js'
export * from './markdownishUtils.js'
File renamed without changes.

0 comments on commit e230a42

Please sign in to comment.