@muhammedaksam/easiarr 0.7.3 → 0.7.5

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.7.3",
3
+ "version": "0.7.5",
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",
@@ -591,7 +591,7 @@ export const APPS: Record<AppId, AppDefinition> = {
591
591
  image: "halverneus/static-file-server:latest",
592
592
  puid: 0,
593
593
  pgid: 0,
594
- volumes: (root) => [`${root}:/web:ro`],
594
+ volumes: () => ["${HOME}/.easiarr/config.json:/web/config.json:ro"],
595
595
  environment: {
596
596
  FOLDER: "/web",
597
597
  CORS: "true",
@@ -600,7 +600,7 @@ export const APPS: Record<AppId, AppDefinition> = {
600
600
  icon: "mdi-docker",
601
601
  widget: "customapi",
602
602
  widgetFields: {
603
- url: "http://easiarr-status:8080/.easiarr/config.json",
603
+ url: "http://easiarr-status:8080/config.json",
604
604
  mappings: JSON.stringify([{ field: "version", label: "Installed" }]),
605
605
  },
606
606
  },
@@ -104,21 +104,21 @@ export async function generateServicesYaml(config: EasiarrConfig): Promise<strin
104
104
  let yaml = "---\n# Auto-generated by Easiarr\n# https://github.com/muhammedaksam/easiarr\n\n"
105
105
 
106
106
  // Add Easiarr info section with two widgets - one for installed, one for latest
107
- yaml += `Easiarr:\n`
107
+ yaml += `- Easiarr:\n`
108
108
  // Installed version from local easiarr-status container
109
- yaml += ` - Installed:\n`
109
+ yaml += ` - Installed:\n`
110
110
  yaml += ` href: https://github.com/muhammedaksam/easiarr\n`
111
111
  yaml += ` icon: mdi-docker\n`
112
112
  yaml += ` description: Your current version\n`
113
113
  yaml += ` widget:\n`
114
114
  yaml += ` type: customapi\n`
115
- yaml += ` url: http://easiarr-status:8080/.easiarr/config.json\n`
115
+ yaml += ` url: http://easiarr-status:8080/config.json\n`
116
116
  yaml += ` refreshInterval: 3600000\n` // 1 hour
117
117
  yaml += ` mappings:\n`
118
118
  yaml += ` - field: version\n`
119
119
  yaml += ` label: Version\n`
120
120
  // Latest version from GitHub API
121
- yaml += ` - Latest:\n`
121
+ yaml += ` - Latest:\n`
122
122
  yaml += ` href: https://github.com/muhammedaksam/easiarr/releases\n`
123
123
  yaml += ` icon: mdi-github\n`
124
124
  yaml += ` description: Check for updates\n`
@@ -140,10 +140,10 @@ export async function generateServicesYaml(config: EasiarrConfig): Promise<strin
140
140
  if (!services || services.length === 0) continue
141
141
 
142
142
  const categoryName = APP_CATEGORIES[category]
143
- yaml += `${categoryName}:\n`
143
+ yaml += `- ${categoryName}:\n`
144
144
 
145
145
  for (const { name, service } of services) {
146
- yaml += ` - ${name}:\n`
146
+ yaml += ` - ${name}:\n`
147
147
  yaml += ` href: ${service.href}\n`
148
148
 
149
149
  if (service.icon) {
@@ -170,7 +170,22 @@ export async function generateServicesYaml(config: EasiarrConfig): Promise<strin
170
170
  // Add any other widget fields
171
171
  for (const [key, value] of Object.entries(service.widget)) {
172
172
  if (key !== "type" && key !== "url" && key !== "key") {
173
- yaml += ` ${key}: ${value}\n`
173
+ // Handle mappings array specially
174
+ if (key === "mappings") {
175
+ const mappings = typeof value === "string" ? JSON.parse(value) : value
176
+ if (Array.isArray(mappings)) {
177
+ yaml += ` mappings:\n`
178
+ for (const mapping of mappings) {
179
+ yaml += ` - field: ${mapping.field}\n`
180
+ yaml += ` label: ${mapping.label}\n`
181
+ if (mapping.format) {
182
+ yaml += ` format: ${mapping.format}\n`
183
+ }
184
+ }
185
+ }
186
+ } else {
187
+ yaml += ` ${key}: ${value}\n`
188
+ }
174
189
  }
175
190
  }
176
191
  }