@muhammedaksam/easiarr 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muhammedaksam/easiarr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "TUI tool for generating docker-compose files for the *arr media ecosystem with 41 apps, TRaSH Guides best practices, VPN routing, and Traefik reverse proxy support",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
package/src/api/arr-api.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface RootFolder {
|
|
|
17
17
|
// Options for adding root folder (some apps like Lidarr need extra fields)
|
|
18
18
|
export interface AddRootFolderOptions {
|
|
19
19
|
path: string
|
|
20
|
+
name?: string // Required for Lidarr
|
|
20
21
|
defaultMetadataProfileId?: number
|
|
21
22
|
defaultQualityProfileId?: number
|
|
22
23
|
}
|
package/src/api/prowlarr-api.ts
CHANGED
|
@@ -260,11 +260,21 @@ export class ProwlarrClient {
|
|
|
260
260
|
appApiKey: string,
|
|
261
261
|
syncLevel: "disabled" | "addOnly" | "fullSync" = "fullSync"
|
|
262
262
|
): Promise<Application> {
|
|
263
|
+
// Default sync categories for each app type
|
|
264
|
+
// Radarr: Movies (2000, 2010, etc), Sonarr: TV (5000, 5010, etc)
|
|
265
|
+
// Lidarr: Audio (3000), Readarr: Books (7000, 8010)
|
|
266
|
+
const syncCategoriesMap: Record<ArrAppType, number[]> = {
|
|
267
|
+
Radarr: [2000, 2010, 2020, 2030, 2040, 2045, 2050, 2060, 2070, 2080],
|
|
268
|
+
Sonarr: [5000, 5010, 5020, 5030, 5040, 5045, 5050, 5060, 5070, 5080],
|
|
269
|
+
Lidarr: [3000, 3010, 3020, 3030, 3040],
|
|
270
|
+
Readarr: [7000, 7010, 7020, 7030, 8000, 8010, 8020],
|
|
271
|
+
}
|
|
272
|
+
|
|
263
273
|
const fields: { name: string; value: unknown }[] = [
|
|
264
274
|
{ name: "prowlarrUrl", value: prowlarrUrl },
|
|
265
275
|
{ name: "baseUrl", value: appUrl },
|
|
266
276
|
{ name: "apiKey", value: appApiKey },
|
|
267
|
-
{ name: "syncCategories", value: [] },
|
|
277
|
+
{ name: "syncCategories", value: syncCategoriesMap[appType] || [] },
|
|
268
278
|
]
|
|
269
279
|
|
|
270
280
|
return this.request<Application>("/applications", {
|
|
@@ -313,12 +313,13 @@ export class AppConfigurator extends BoxRenderable {
|
|
|
313
313
|
throw new Error("Already configured")
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
// Add root folder - Lidarr requires profile IDs
|
|
316
|
+
// Add root folder - Lidarr requires profile IDs and name
|
|
317
317
|
if (appId === "lidarr") {
|
|
318
318
|
const metadataProfiles = await client.getMetadataProfiles()
|
|
319
319
|
const qualityProfiles = await client.getQualityProfiles()
|
|
320
320
|
await client.addRootFolder({
|
|
321
321
|
path: appDef.rootFolder.path,
|
|
322
|
+
name: "Music", // Required by Lidarr
|
|
322
323
|
defaultMetadataProfileId: metadataProfiles[0]?.id || 1,
|
|
323
324
|
defaultQualityProfileId: qualityProfiles[0]?.id || 1,
|
|
324
325
|
})
|
|
@@ -560,6 +561,12 @@ export class AppConfigurator extends BoxRenderable {
|
|
|
560
561
|
const client = new ArrApiClient("localhost", port, apiKey, appDef.rootFolder.apiVersion)
|
|
561
562
|
|
|
562
563
|
try {
|
|
564
|
+
// Check if download client already exists
|
|
565
|
+
const existingClients = await client.getDownloadClients()
|
|
566
|
+
const clientName = type === "qbittorrent" ? "qBittorrent" : "SABnzbd"
|
|
567
|
+
const alreadyExists = existingClients.some((c) => c.name === clientName)
|
|
568
|
+
if (alreadyExists) continue
|
|
569
|
+
|
|
563
570
|
if (type === "qbittorrent") {
|
|
564
571
|
const config = createQBittorrentConfig(this.qbHost, this.qbPort, this.qbUser, this.qbPass, appConfig.id)
|
|
565
572
|
await client.addDownloadClient(config)
|