Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(schedule): support days without any shows #381

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions models/schedule_tabulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,20 @@ func buildList(schedule []*ScheduleItem, dates []time.Time) []WeekScheduleList {
days[dayIndex].Shows = append(days[dayIndex].Shows, *item)
}
}
for day := range days {
// Where does the come from, nobody knows; here's a fix to get rid of it though -ash (2024)
// TODO: actually fix this
// it comes from makescheduleslice see the s.fill line. needed otherwise the first show on monday will start at 6am on table view
// or not, theres jukeboxes coming from elsewhere aswell
if days[day].Shows[len(days[day].Shows)-1].IsSustainer(){
days[day].Shows = days[day].Shows[:len(days[day].Shows) - 1]
}
if days[day].Shows[0].IsSustainer(){
days[day].Shows = days[day].Shows[1:]
}
}
for day := range days {
// Where does the come from, nobody knows; here's a fix to get rid of it though -ash (2024)
// TODO: actually fix this
// it comes from makescheduleslice see the s.fill line. needed otherwise the first show on monday will start at 6am on table view
// or not, theres jukeboxes coming from elsewhere aswell
if len(days[day].Shows) > 0 {
if days[day].Shows[len(days[day].Shows)-1].IsSustainer(){
days[day].Shows = days[day].Shows[:len(days[day].Shows) - 1]
}
if days[day].Shows[0].IsSustainer(){
days[day].Shows = days[day].Shows[1:]
}
}
}
return days
}

Expand Down