@muhammedaksam/easiarr 1.1.3 → 1.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muhammedaksam/easiarr",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
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",
@@ -278,7 +278,7 @@ export class ArrApiClient {
278
278
  })
279
279
  }
280
280
 
281
- async configureTRaSHNaming(appType: "radarr" | "sonarr"): Promise<void> {
281
+ async configureTRaSHNaming(appType: "radarr" | "sonarr" | "lidarr"): Promise<void> {
282
282
  try {
283
283
  // 1. Get current configuration to preserve ID and other fields
284
284
  const currentConfig = await this.getNamingConfig<NamingConfig & { id?: number }>()
@@ -26,11 +26,22 @@ export interface SonarrNamingConfig {
26
26
  numberStyle: string
27
27
  }
28
28
 
29
- export type NamingConfig = RadarrNamingConfig | SonarrNamingConfig
29
+ export interface LidarrNamingConfig {
30
+ renameTracks: boolean
31
+ replaceIllegalCharacters: boolean
32
+ colonReplacementFormat: "dash" | "spaceDash" | "spaceDashSpace" | "smart" | "delete" | number
33
+ standardTrackFormat: string
34
+ multiDiscTrackFormat: string
35
+ artistFolderFormat: string
36
+ albumFolderFormat: string
37
+ }
38
+
39
+ export type NamingConfig = RadarrNamingConfig | SonarrNamingConfig | LidarrNamingConfig
30
40
 
31
41
  // TRaSH Guides Recommended Naming Schemes
32
42
  // Source: https://trash-guides.info/Radarr/Radarr-recommended-naming-scheme/
33
43
  // Source: https://trash-guides.info/Sonarr/Sonarr-recommended-naming-scheme/
44
+ // Lidarr: https://wiki.servarr.com/lidarr/settings#media-management
34
45
 
35
46
  export const TRASH_NAMING_CONFIG = {
36
47
  radarr: {
@@ -64,4 +75,19 @@ export const TRASH_NAMING_CONFIG = {
64
75
  separator: " - ",
65
76
  numberStyle: "S{season:00}E{episode:00}",
66
77
  } as SonarrNamingConfig,
78
+
79
+ lidarr: {
80
+ renameTracks: true,
81
+ replaceIllegalCharacters: true,
82
+ colonReplacementFormat: 4, // 4 = Smart Replace (Dash or Space Dash depending on name)
83
+ // Standard track format: Artist - Album (Year) - Track# - Title
84
+ standardTrackFormat: "{Artist CleanName} - {Album CleanTitle} ({Release Year}) - {track:00} - {Track CleanTitle}",
85
+ // Multi-disc format includes disc number
86
+ multiDiscTrackFormat:
87
+ "{Artist CleanName} - {Album CleanTitle} ({Release Year}) - {medium:00}-{track:00} - {Track CleanTitle}",
88
+ // Artist folder: Artist Name
89
+ artistFolderFormat: "{Artist CleanName}",
90
+ // Album folder: Album Title (Year) [Quality]
91
+ albumFolderFormat: "{Album CleanTitle} ({Release Year})",
92
+ } as LidarrNamingConfig,
67
93
  }
@@ -268,7 +268,7 @@ export class FullAutoSetup extends BoxRenderable {
268
268
 
269
269
  try {
270
270
  const arrApps = this.config.apps.filter((a) => {
271
- return a.enabled && (a.id === "radarr" || a.id === "sonarr")
271
+ return a.enabled && (a.id === "radarr" || a.id === "sonarr" || a.id === "lidarr")
272
272
  })
273
273
 
274
274
  for (const app of arrApps) {
@@ -282,7 +282,7 @@ export class FullAutoSetup extends BoxRenderable {
282
282
  const client = new ArrApiClient("localhost", port, apiKey, def.rootFolder?.apiVersion || "v3")
283
283
 
284
284
  try {
285
- await client.configureTRaSHNaming(app.id as "radarr" | "sonarr")
285
+ await client.configureTRaSHNaming(app.id as "radarr" | "sonarr" | "lidarr")
286
286
  debugLog("FullAutoSetup", `Configured naming for ${app.id}`)
287
287
  } catch (e) {
288
288
  debugLog("FullAutoSetup", `Failed to configure naming for ${app.id}: ${e}`)
@@ -302,7 +302,7 @@ export class FullAutoSetup extends BoxRenderable {
302
302
 
303
303
  try {
304
304
  const arrApps = this.config.apps.filter((a) => {
305
- return a.enabled && (a.id === "radarr" || a.id === "sonarr")
305
+ return a.enabled && (a.id === "radarr" || a.id === "sonarr" || a.id === "lidarr")
306
306
  })
307
307
 
308
308
  for (const app of arrApps) {
@@ -313,10 +313,11 @@ export class FullAutoSetup extends BoxRenderable {
313
313
  if (!def) continue
314
314
 
315
315
  const port = app.port || def.defaultPort
316
- const client = new QualityProfileClient("localhost", port, apiKey)
316
+ const apiVersion = def.rootFolder?.apiVersion || "v3"
317
+ const client = new QualityProfileClient("localhost", port, apiKey, apiVersion)
317
318
 
318
319
  try {
319
- await client.updateTrashQualityDefinitions(app.id as "radarr" | "sonarr")
320
+ await client.updateTrashQualityDefinitions(app.id as "radarr" | "sonarr" | "lidarr")
320
321
  debugLog("FullAutoSetup", `Configured quality settings for ${app.id}`)
321
322
  } catch (e) {
322
323
  debugLog("FullAutoSetup", `Failed to configure quality settings for ${app.id}: ${e}`)