Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
d4287710
Commit
d4287710
authored
4 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
playlists: deny negative durations
parent
991b5f08
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/playlists.go
+3
-0
3 additions, 0 deletions
store/playlists.go
with
3 additions
and
0 deletions
store/playlists.go
+
3
−
0
View file @
d4287710
...
@@ -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
==
""
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment