Added an AutoDownloadService

This commit is contained in:
2024-04-23 22:46:49 -05:00
parent 91199bcf0c
commit 17ed663823
4 changed files with 178 additions and 8 deletions

View File

@@ -65,6 +65,7 @@ export default class ProwlarrService extends Service {
offset: number;
}>,
) => {
console.log(JSON.stringify(ctx.params, null, 2));
const {
indexerIds,
categories,
@@ -76,15 +77,16 @@ export default class ProwlarrService extends Service {
limit,
offset,
} = ctx.params;
const indexer = indexerIds[0] ? indexerIds.length === 1 : indexerIds;
const category = categories[0] ? categories.length === 1 : categories;
const result = await axios({
url: `http://${host}:${port}/api/v1/search`,
method: "GET",
params: {
query,
type,
indexerIds,
categories,
indexer,
category,
limit,
offset,
},