fix(pagination): Increase Sonarr/Radarr page sizes to fetch all items
Build and Push Docker Image / build (push) Successful in 20s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 53s
CI / Security audit (push) Successful in 1m12s
CI / Tests & coverage (push) Successful in 1m27s
Build and Push Docker Image / build (push) Successful in 20s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 53s
CI / Security audit (push) Successful in 1m12s
CI / Tests & coverage (push) Successful in 1m27s
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() {
|
async getQueue() {
|
||||||
try {
|
try {
|
||||||
|
// Fetch with large page size to get all items (Radarr has pagination)
|
||||||
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
||||||
headers: { 'X-Api-Key': this.apiKey },
|
headers: { 'X-Api-Key': this.apiKey },
|
||||||
params: { includeMovie: true }
|
params: { includeMovie: true, pageSize: 1000 }
|
||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -61,7 +62,7 @@ class PollingRadarrRetriever extends ArrRetriever {
|
|||||||
*/
|
*/
|
||||||
async getHistory(options = {}) {
|
async getHistory(options = {}) {
|
||||||
const {
|
const {
|
||||||
pageSize = 10,
|
pageSize = 100,
|
||||||
sortKey,
|
sortKey,
|
||||||
sortDir,
|
sortDir,
|
||||||
includeMovie = true,
|
includeMovie = true,
|
||||||
|
|||||||
@@ -38,9 +38,10 @@ class PollingSonarrRetriever extends ArrRetriever {
|
|||||||
*/
|
*/
|
||||||
async getQueue() {
|
async getQueue() {
|
||||||
try {
|
try {
|
||||||
|
// Fetch with large page size to get all items (Sonarr has pagination)
|
||||||
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
const response = await axios.get(`${this.url}/api/v3/queue`, {
|
||||||
headers: { 'X-Api-Key': this.apiKey },
|
headers: { 'X-Api-Key': this.apiKey },
|
||||||
params: { includeSeries: true, includeEpisode: true }
|
params: { includeSeries: true, includeEpisode: true, pageSize: 1000 }
|
||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -62,7 +63,7 @@ class PollingSonarrRetriever extends ArrRetriever {
|
|||||||
*/
|
*/
|
||||||
async getHistory(options = {}) {
|
async getHistory(options = {}) {
|
||||||
const {
|
const {
|
||||||
pageSize = 10,
|
pageSize = 100,
|
||||||
sortKey,
|
sortKey,
|
||||||
sortDir,
|
sortDir,
|
||||||
includeSeries = true,
|
includeSeries = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user