@muhammedaksam/easiarr 0.8.2 → 0.8.4

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.
@@ -11,6 +11,7 @@ import { ProwlarrClient, type ArrAppType } from "../../api/prowlarr-api"
11
11
  import { QBittorrentClient, type QBittorrentCategory } from "../../api/qbittorrent-api"
12
12
  import { PortainerApiClient } from "../../api/portainer-api"
13
13
  import { JellyfinClient } from "../../api/jellyfin-api"
14
+ import { JellyseerrClient } from "../../api/jellyseerr-api"
14
15
  import { getApp } from "../../apps/registry"
15
16
  // import type { AppId } from "../../config/schema"
16
17
  import { getCategoriesForApps } from "../../utils/categories"
@@ -83,6 +84,7 @@ export class FullAutoSetup extends BoxRenderable {
83
84
  { name: "qBittorrent", status: "pending" },
84
85
  { name: "Portainer", status: "pending" },
85
86
  { name: "Jellyfin", status: "pending" },
87
+ { name: "Jellyseerr", status: "pending" },
86
88
  ]
87
89
  }
88
90
 
@@ -134,6 +136,9 @@ export class FullAutoSetup extends BoxRenderable {
134
136
  // Step 7: Jellyfin
135
137
  await this.setupJellyfin()
136
138
 
139
+ // Step 8: Jellyseerr
140
+ await this.setupJellyseerr()
141
+
137
142
  this.isRunning = false
138
143
  this.isDone = true
139
144
  this.refreshContent()
@@ -452,6 +457,105 @@ export class FullAutoSetup extends BoxRenderable {
452
457
  this.refreshContent()
453
458
  }
454
459
 
460
+ private async setupJellyseerr(): Promise<void> {
461
+ this.updateStep("Jellyseerr", "running")
462
+ this.refreshContent()
463
+
464
+ const jellyseerrConfig = this.config.apps.find((a) => a.id === "jellyseerr" && a.enabled)
465
+ if (!jellyseerrConfig) {
466
+ this.updateStep("Jellyseerr", "skipped", "Not enabled")
467
+ this.refreshContent()
468
+ return
469
+ }
470
+
471
+ // Check if a media server is enabled
472
+ const jellyfinConfig = this.config.apps.find((a) => a.id === "jellyfin" && a.enabled)
473
+ const plexConfig = this.config.apps.find((a) => a.id === "plex" && a.enabled)
474
+
475
+ if (!jellyfinConfig && !plexConfig) {
476
+ this.updateStep("Jellyseerr", "skipped", "No media server enabled")
477
+ this.refreshContent()
478
+ return
479
+ }
480
+
481
+ try {
482
+ const port = jellyseerrConfig.port || 5055
483
+ const client = new JellyseerrClient("localhost", port)
484
+
485
+ // Check if reachable
486
+ const healthy = await client.isHealthy()
487
+ if (!healthy) {
488
+ this.updateStep("Jellyseerr", "skipped", "Not reachable yet")
489
+ this.refreshContent()
490
+ return
491
+ }
492
+
493
+ // Check if already initialized
494
+ const isInit = await client.isInitialized()
495
+ if (isInit) {
496
+ this.updateStep("Jellyseerr", "skipped", "Already configured")
497
+ this.refreshContent()
498
+ return
499
+ }
500
+
501
+ // Configure with Jellyfin (primary support)
502
+ if (jellyfinConfig) {
503
+ const jellyfinDef = getApp("jellyfin")
504
+ // Use internal port for container-to-container communication
505
+ const internalPort = jellyfinDef?.internalPort || jellyfinDef?.defaultPort || 8096
506
+ const jellyfinHost = "jellyfin"
507
+
508
+ await client.runJellyfinSetup(
509
+ jellyfinHost,
510
+ internalPort,
511
+ this.globalUsername,
512
+ this.globalPassword,
513
+ `${this.globalUsername}@local`
514
+ )
515
+
516
+ // Configure Radarr if enabled
517
+ const radarrConfig = this.config.apps.find((a) => a.id === "radarr" && a.enabled)
518
+ if (radarrConfig) {
519
+ const radarrApiKey = this.env["API_KEY_RADARR"]
520
+ if (radarrApiKey) {
521
+ const radarrDef = getApp("radarr")
522
+ const radarrPort = radarrConfig.port || radarrDef?.defaultPort || 7878
523
+ await client.configureRadarr(
524
+ "radarr",
525
+ radarrPort,
526
+ radarrApiKey,
527
+ radarrDef?.rootFolder?.path || "/data/media/movies"
528
+ )
529
+ }
530
+ }
531
+
532
+ // Configure Sonarr if enabled
533
+ const sonarrConfig = this.config.apps.find((a) => a.id === "sonarr" && a.enabled)
534
+ if (sonarrConfig) {
535
+ const sonarrApiKey = this.env["API_KEY_SONARR"]
536
+ if (sonarrApiKey) {
537
+ const sonarrDef = getApp("sonarr")
538
+ const sonarrPort = sonarrConfig.port || sonarrDef?.defaultPort || 8989
539
+ await client.configureSonarr(
540
+ "sonarr",
541
+ sonarrPort,
542
+ sonarrApiKey,
543
+ sonarrDef?.rootFolder?.path || "/data/media/tv"
544
+ )
545
+ }
546
+ }
547
+
548
+ this.updateStep("Jellyseerr", "success", "Configured with Jellyfin")
549
+ } else {
550
+ // Plex requires token-based auth - mark as needing manual setup
551
+ this.updateStep("Jellyseerr", "skipped", "Plex requires manual setup")
552
+ }
553
+ } catch (e) {
554
+ this.updateStep("Jellyseerr", "error", `${e}`)
555
+ }
556
+ this.refreshContent()
557
+ }
558
+
455
559
  private updateStep(name: string, status: SetupStep["status"], message?: string): void {
456
560
  const step = this.steps.find((s) => s.name === name)
457
561
  if (step) {