|
|
@ -42,8 +42,8 @@ export class AnalyticService { |
|
|
|
): Promise<SegmentId[]> { |
|
|
|
): Promise<SegmentId[]> { |
|
|
|
|
|
|
|
|
|
|
|
const getJSONs = (segs: SegmentsSet<Segment>) => segs.getSegments().map(segment => ({ |
|
|
|
const getJSONs = (segs: SegmentsSet<Segment>) => segs.getSegments().map(segment => ({ |
|
|
|
"start": segment.from, |
|
|
|
"from": segment.from, |
|
|
|
"finish": segment.to |
|
|
|
"to": segment.to |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
var payload = { |
|
|
|
var payload = { |
|
|
@ -75,8 +75,8 @@ export class AnalyticService { |
|
|
|
if(data.segments === undefined) { |
|
|
|
if(data.segments === undefined) { |
|
|
|
throw new Error('Server didn`t return segments array'); |
|
|
|
throw new Error('Server didn`t return segments array'); |
|
|
|
} |
|
|
|
} |
|
|
|
var segments = data.segments as { id: SegmentId, start: number, finish: number, labeled: boolean }[]; |
|
|
|
var segments = data.segments as { id: SegmentId, from: number, to: number, labeled: boolean }[]; |
|
|
|
return segments.map(s => new AnalyticSegment(s.labeled, s.id, s.start, s.finish)); |
|
|
|
return segments.map(s => new AnalyticSegment(s.labeled, s.id, s.from, s.to)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async * getStatusGenerator(id: AnalyticUnitId, duration: number) { |
|
|
|
async * getStatusGenerator(id: AnalyticUnitId, duration: number) { |
|
|
|