Fixed ISectionRunJSON duration
This commit is contained in:
parent
5d25ce7381
commit
36458e50ec
@ -106,11 +106,15 @@ export interface ISectionRunJSON {
|
|||||||
const sectionRunProps = ["id", "section", "duration", "startTime", "pauseTime"];
|
const sectionRunProps = ["id", "section", "duration", "startTime", "pauseTime"];
|
||||||
|
|
||||||
export function sectionRunToJSON(sectionRun: s.SectionRun): ISectionRunJSON {
|
export function sectionRunToJSON(sectionRun: s.SectionRun): ISectionRunJSON {
|
||||||
return pick(sectionRun, sectionRunProps);
|
return {
|
||||||
|
...pick(sectionRun, sectionRunProps),
|
||||||
|
duration: sectionRun.duration.toSeconds(),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sectionRunFromJSON(sectionRun: s.SectionRun, json: ISectionRunJSON) {
|
export function sectionRunFromJSON(sectionRun: s.SectionRun, json: ISectionRunJSON) {
|
||||||
assign(sectionRun, pick(json, sectionRunProps));
|
assign(sectionRun, pick(json, sectionRunProps));
|
||||||
|
sectionRun.duration = s.Duration.fromSeconds(json.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ISectionRunnerJSON {
|
interface ISectionRunnerJSON {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user