Commit d4287710 authored by Christian Pointner's avatar Christian Pointner
Browse files

playlists: deny negative durations

parent 991b5f08
Pipeline #726 failed with stages
in 7 minutes and 20 seconds
......@@ -43,6 +43,9 @@ func (p *Playlist) BeforeSave(tx *gorm.DB) error {
hasEntryWithoutDuration := false
for idx := range p.Entries {
p.Entries[idx].LineNum = uint(idx)
if p.Entries[idx].Duration != nil && *(p.Entries[idx].Duration) < 0 {
return ErrInvalidPlaylistEntry{idx, "negative durations are not allowed"}
}
if p.Entries[idx].File != nil {
if p.Entries[idx].File.ShowName == "" {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment