Fix indexerIds serialization in ProwlarrService

Update axios paramsSerializer and request logic to send indexerIds as repeated query parameters (indexerIds=1&indexerIds=2) instead of a comma-separated string. This ensures compatibility with Prowlarr's expected API format.
This commit is contained in:
kikootwo
2025-12-22 15:22:48 -05:00
parent 1cefa437b7
commit bba4af7398
+5 -1
View File
@@ -69,6 +69,9 @@ export class ProwlarrService {
'X-Api-Key': this.apiKey, 'X-Api-Key': this.apiKey,
}, },
timeout: 30000, // 30 seconds timeout: 30000, // 30 seconds
paramsSerializer: {
indexes: null, // Use repeat format: indexerIds=1&indexerIds=2 (not indexerIds[0]=1)
},
}); });
} }
@@ -89,8 +92,9 @@ export class ProwlarrService {
}; };
// Filter by specific indexers if provided // Filter by specific indexers if provided
// Pass array directly - axios will serialize as indexerIds=1&indexerIds=2&indexerIds=3
if (filters?.indexerIds && filters.indexerIds.length > 0) { if (filters?.indexerIds && filters.indexerIds.length > 0) {
params.indexerIds = filters.indexerIds.join(','); params.indexerIds = filters.indexerIds;
} }
const response = await this.client.get('/search', { params }); const response = await this.client.get('/search', { params });