fix(pagination): Increase Sonarr/Radarr page sizes to fetch all items
All checks were successful
All checks were successful
Sonarr Activity tab has 12 pages but we only fetched ~2 items. Added pageSize=1000 to queue API and changed history default from 10 to 100. This ensures all downloads are available for matching to SAB/qBittorrent.
This commit is contained in:
@@ -38,9 +38,10 @@ class PollingRadarrRetriever extends ArrRetriever {
|
||||
*/
|
||||
async getQueue() {
|
||||
try {
|
||||
// Fetch with large page size to get all items (Radarr has pagination)
|
||||
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
||||
headers: { 'X-Api-Key': this.apiKey },
|
||||
params: { includeMovie: true }
|
||||
params: { includeMovie: true, pageSize: 1000 }
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
@@ -61,7 +62,7 @@ class PollingRadarrRetriever extends ArrRetriever {
|
||||
*/
|
||||
async getHistory(options = {}) {
|
||||
const {
|
||||
pageSize = 10,
|
||||
pageSize = 100,
|
||||
sortKey,
|
||||
sortDir,
|
||||
includeMovie = true,
|
||||
|
||||
@@ -38,9 +38,10 @@ class PollingSonarrRetriever extends ArrRetriever {
|
||||
*/
|
||||
async getQueue() {
|
||||
try {
|
||||
// Fetch with large page size to get all items (Sonarr has pagination)
|
||||
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
||||
headers: { 'X-Api-Key': this.apiKey },
|
||||
params: { includeSeries: true, includeEpisode: true }
|
||||
params: { includeSeries: true, includeEpisode: true, pageSize: 1000 }
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
@@ -62,7 +63,7 @@ class PollingSonarrRetriever extends ArrRetriever {
|
||||
*/
|
||||
async getHistory(options = {}) {
|
||||
const {
|
||||
pageSize = 10,
|
||||
pageSize = 100,
|
||||
sortKey,
|
||||
sortDir,
|
||||
includeSeries = true,
|
||||
|
||||
Reference in New Issue
Block a user