🏗️ WIP for automatic downloads endpoint

This commit is contained in:
2024-05-09 13:45:18 -04:00
parent 17ed663823
commit 6fb1374ce9
4 changed files with 200 additions and 112 deletions

View File

@@ -54,28 +54,31 @@ export default class ProwlarrService extends Service {
rest: "GET /search",
handler: async (
ctx: Context<{
host: string;
port: string;
apiKey: string;
query: string;
type: string;
indexerIds: [number];
categories: [number];
limit: number;
offset: number;
prowlarrQuery: {
host: string;
port: string;
apiKey: string;
query: string;
type: string;
indexerIds: [number];
categories: [number];
limit: number;
offset: number;
};
}>,
) => {
console.log(JSON.stringify(ctx.params, null, 2));
const {
indexerIds,
categories,
host,
port,
apiKey,
query,
type,
limit,
offset,
prowlarrQuery: {
indexerIds,
categories,
host,
port,
apiKey,
query,
type,
limit,
offset,
},
} = ctx.params;
const indexer = indexerIds[0] ? indexerIds.length === 1 : indexerIds;
const category = categories[0] ? categories.length === 1 : categories;