Skip to content

Commit

Permalink
fix: scene list limited to 2 pages (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Sep 7, 2023
1 parent 450ee00 commit 3c7e365
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/models/model_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ type RequestSceneList struct {
DlState optional.String `json:"dlState"`
Limit optional.Int `json:"limit"`
Offset optional.Int `json:"offset"`
Counts optional.Bool `json:"counts"`
IsAvailable optional.Bool `json:"isAvailable"`
IsAccessible optional.Bool `json:"isAccessible"`
IsWatched optional.Bool `json:"isWatched"`
Expand Down Expand Up @@ -626,7 +625,8 @@ func QueryScenes(r RequestSceneList, enablePreload bool) ResponseSceneList {
preCountTx.Where("is_available = ?", false).Where("is_hidden = ?", false).Count(&out.CountNotDownloaded)
preCountTx.Where("is_hidden = ?", true).Count(&out.CountHidden)

finalTx.Count(&out.Results)
// r.Offset must _not_ apply to the count, as the count query always returns a single value
finalTx.Offset(0).Count(&out.Results)

if enablePreload {
finalTx = finalTx.
Expand Down

0 comments on commit 3c7e365

Please sign in to comment.