Skip to content

Commit

Permalink
[fix] songs not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
inosms committed Jan 8, 2024
1 parent 846078c commit ad14233
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export class Schedule {
private constructor(minutesPerSlot: number[], songsPerSlot: number[]) {
this.minutesPerSlot = minutesPerSlot;
this.songsPerSlot = songsPerSlot;

// if the last slot goes until 24:00, remove it as we want to implicitly calculate it
// with the maximum number of songs per slot
const totalMinutes = this.minutesPerSlot.reduce((a, b) => a + b, 0);
if (totalMinutes === 24 * 60) {
this.minutesPerSlot.pop();
this.songsPerSlot.pop();
}
}

// Create a schedule from a string containing a schedule.
Expand Down

0 comments on commit ad14233

Please sign in to comment.