Skip to content
Snippets Groups Projects
Commit d4287710 authored by Christian Pointner's avatar Christian Pointner
Browse files

playlists: deny negative durations

parent 991b5f08
Branches
Tags
No related merge requests found
...@@ -43,6 +43,9 @@ func (p *Playlist) BeforeSave(tx *gorm.DB) error { ...@@ -43,6 +43,9 @@ func (p *Playlist) BeforeSave(tx *gorm.DB) error {
hasEntryWithoutDuration := false hasEntryWithoutDuration := false
for idx := range p.Entries { for idx := range p.Entries {
p.Entries[idx].LineNum = uint(idx) 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 != nil {
if p.Entries[idx].File.ShowName == "" { if p.Entries[idx].File.ShowName == "" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment