Skip to content

Commit

Permalink
Dashboard, fix consolidating video segments
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Apr 1, 2024
1 parent 8010a33 commit d261928
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website_code/scripts/xapi_dashboard_data.js
Expand Up @@ -91,7 +91,7 @@ DashboardState.prototype.getStatementsxAPI = function(q, one, callback) {
}
}
else if (statement.actor.mbox_sha1sum != undefined) {
if ($this.info.users.findIndex(u => u.sha1 === statement.actor.mbox.mbox_sha1sum) === -1) {
if ($this.info.users.findIndex(u => u.sha1 === statement.actor.mbox_sha1sum) === -1) {
// Skip this user
continue;
}
Expand Down Expand Up @@ -1351,8 +1351,10 @@ DashboardState.prototype.consolidateSegments = function (pausedSegments) {
while (i < segments.length) {
var segment = $.extend(true, {}, segments[i]);
i++;
while (i < segments.length && parseFloat(segment.end) >= parseFloat(segments[i].start)) {
segment.end = segments[i].end;
while (i < segments.length && segments[i].start >= segment.start && segments[i].start <= segment.end) {
if (segment.end <= segments[i].end) {
segment.end = segments[i].end;
}
i++;
}
csegments.push(segment);
Expand Down

0 comments on commit d261928

Please sign in to comment.