Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
tank
Commits
d4287710
Commit
d4287710
authored
Jun 14, 2020
by
Christian Pointner
Browse files
playlists: deny negative durations
parent
991b5f08
Pipeline
#726
failed with stages
in 7 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
store/playlists.go
View file @
d4287710
...
...
@@ -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
==
""
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment