Skip to content

Commit

Permalink
default
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxx committed May 12, 2023
1 parent 2124322 commit 221e2b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/auto_scheduler/mrss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class MRSSAutoScheduler {
let scheduleEventsToAdd: ScheduleEvent[] = [];
let nextStartTime = findLastEndTime(ongoingAndFutureScheduleEvents, now);
for (let i = 0; i < numberOfScheduleEvents; i++) {
let asset = assets[Math.floor(Math.random() * assets.length)];
let asset = assets[i];
if (asset) {
const totalScheduleEventDuration = asset.duration;
const nextEndTime = nextStartTime + totalScheduleEventDuration * 1000;
Expand Down
10 changes: 8 additions & 2 deletions src/models/mrssFeedModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface MRSSAsset {
title: string;
url: string;
duration: number;
start_time: number;
end_time: number;
}

interface MRSSCache {
Expand Down Expand Up @@ -164,14 +166,18 @@ export class MRSSFeed {
if (cachedAsset) {
cachedAsset.title = feedEntry.title;
cachedAsset.url = feedEntry.link;
cachedAsset.duration = -1;
cachedAsset.duration = feedEntry.duration ? feedEntry.duration : -1 ;
cachedAsset.start_time= feedEntry.start_time;
cachedAsset.end_time = feedEntry.endTime;
} else {
debug("Adding new entry to cache");
this.cache.assets.push({
id: feedEntry.id,
title: feedEntry.title,
url: feedEntry.link,
duration: -1,
duration: feedEntry.duration ? feedEntry.duration : -1,
start_time: feedEntry.start_time,
end_time: feedEntry.end_time,
});
}
}
Expand Down

0 comments on commit 221e2b9

Please sign in to comment.