Skip to content

Commit

Permalink
Bugfix: Support for the 'pageNumber' parameter in OPDS smart-filter A…
Browse files Browse the repository at this point in the history
…PI (#2630)
  • Loading branch information
charles7668 authored Jan 20, 2024
1 parent 436b92e commit 2a539da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions API/Controllers/OPDSController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
Expand Down Expand Up @@ -301,7 +301,7 @@ private async Task<Tuple<string, string>> GetPrefix()
/// <returns></returns>
[HttpGet("{apiKey}/smart-filter/{filterId}")]
[Produces("application/xml")]
public async Task<IActionResult> GetSmartFilter(string apiKey, int filterId)
public async Task<IActionResult> GetSmartFilter(string apiKey, int filterId, [FromQuery] int pageNumber = 0)
{
var userId = await GetUser(apiKey);
if (!(await _unitOfWork.SettingsRepository.GetSettingsDtoAsync()).EnableOpds)
Expand All @@ -315,7 +315,7 @@ public async Task<IActionResult> GetSmartFilter(string apiKey, int filterId)
SetFeedId(feed, "smartFilter-" + filter.Id);

var decodedFilter = SmartFilterHelper.Decode(filter.Filter);
var series = await _unitOfWork.SeriesRepository.GetSeriesDtoForLibraryIdV2Async(userId, UserParams.Default,
var series = await _unitOfWork.SeriesRepository.GetSeriesDtoForLibraryIdV2Async(userId, GetUserParams(pageNumber),
decodedFilter);
var seriesMetadatas = await _unitOfWork.SeriesRepository.GetSeriesMetadataForIds(series.Select(s => s.Id));

Expand Down
9 changes: 9 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3719,6 +3719,15 @@
"type": "integer",
"format": "int32"
}
},
{
"name": "pageNumber",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
}
],
"responses": {
Expand Down

0 comments on commit 2a539da

Please sign in to comment.