Skip to content

Commit

Permalink
improoved ResetEncodingState
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 23, 2024
1 parent 3711232 commit dc10253
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/Encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func ResetEncodingState() {
Where(&models.Quality{
Encoding: true,
}, "Encoding").
Updates(map[string]interface{}{"encoding": false}); res.Error != nil {
Or("progress > ?", 0).
Updates(map[string]interface{}{"encoding": false, "progress": 0}); res.Error != nil {
log.Println("Failed to reset encoding status on Quality", res.Error)
}

Expand All @@ -69,7 +70,8 @@ func ResetEncodingState() {
Where(&models.Audio{
Encoding: true,
}, "Encoding").
Updates(map[string]interface{}{"encoding": false}); res.Error != nil {
Or("progress > ?", 0).
Updates(map[string]interface{}{"encoding": false, "progress": 0}); res.Error != nil {
log.Println("Failed to reset encoding status on Audio", res.Error)
}

Expand All @@ -78,7 +80,8 @@ func ResetEncodingState() {
Where(&models.Subtitle{
Encoding: true,
}, "Encoding").
Updates(map[string]interface{}{"encoding": false}); res.Error != nil {
Or("progress > ?", 0).
Updates(map[string]interface{}{"encoding": false, "progress": 0}); res.Error != nil {
log.Println("Failed to reset encoding status on Subtitle", res.Error)
}
}
Expand Down

0 comments on commit dc10253

Please sign in to comment.