Skip to content

Commit

Permalink
fix: fix pagination total on file search
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Jan 7, 2024
1 parent e4e3cba commit 6cc8189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shoko.Server/API/v3/Controllers/FileController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public ActionResult<ListResult<File>> Search([FromRoute] string query,
// Search.
var searched = RepoFactory.VideoLocal.GetAll()
.Search(query, tuple => tuple.Places.Select(place => place?.FilePath).Where(path => path != null), fuzzy)
.Select(result => result.Result).Skip((page-1)*pageSize).Take(pageSize).ToList();
.Select(result => result.Result)
.ToList();
return ModelHelper.FilterFiles(searched, User, pageSize, page, include, exclude, include_only, sortOrder,
includeDataFrom);
}
Expand Down

0 comments on commit 6cc8189

Please sign in to comment.