Skip to content

Commit ac2e735

Browse files
committed
Fix review comments
1 parent 1b12300 commit ac2e735

File tree

9 files changed

+61
-96
lines changed

9 files changed

+61
-96
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/BuildImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
BASEIMAGE: "beets" #replace
1616
MODNAME: "httpshell" #replace
1717
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
18-
MULTI_ARCH: "true" #set to false if not needed
18+
MULTI_ARCH: "false" #set to false if not needed
1919

2020
jobs:
2121
set-vars:

README.md

Lines changed: 60 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,62 @@ The mod runs a Python 3 HTTP server (no extra dependencies) that maps URL paths
88
99
## Installation
1010

11-
Add the mod to your beets container using the `DOCKER_MODS` environment variable.
12-
13-
### docker run
14-
15-
```bash
16-
docker run \
17-
--name=beets \
18-
-e DOCKER_MODS=ghcr.io/linuxserver/mods:beets-httpshell \
19-
-e PUID=1000 \
20-
-e PGID=1000 \
21-
-e TZ=Europe/London \
22-
-p 8337:8337 \
23-
-p 5555:5555 \
24-
-v /path/to/config:/config \
25-
-v /path/to/music:/music \
26-
-v /path/to/downloads:/downloads \
27-
--restart unless-stopped \
28-
lscr.io/linuxserver/beets:latest
29-
```
30-
31-
### docker compose
32-
33-
```yaml
34-
---
35-
services:
36-
beets:
37-
image: lscr.io/linuxserver/beets:latest
38-
container_name: beets
39-
environment:
40-
DOCKER_MODS: ghcr.io/linuxserver/mods:beets-httpshell
41-
PUID: 1000
42-
PGID: 1000
43-
TZ: Europe/London
44-
HTTPSHELL_PORT: 5555
45-
volumes:
46-
- /path/to/config:/config
47-
- /path/to/music:/music
48-
- /path/to/downloads:/downloads
49-
ports:
50-
- 8337:8337
51-
- 5555:5555
52-
restart: unless-stopped
53-
```
54-
55-
## Environment Variables
11+
1. Configure your selected Docker container with the port, volume, and environment settings from the *original container documentation* here **[linuxserver/beets](https://hub.docker.com/r/linuxserver/beets "Beets Docker container")**
12+
2. Add the **DOCKER_MODS** environment variable to your `compose.yml` file or `docker run` command, as follows:
13+
- `DOCKER_MODS=linuxserver/mods:beets-httpshell`
14+
3. Map the HTTP API port so it is accessible from outside the container. The default port is `5555` (configurable via `HTTPSHELL_PORT`). Add `5555:5555` to your port mappings:
15+
16+
<details>
17+
<summary>Example Docker Compose YAML Configuration</summary>
18+
19+
```yaml
20+
---
21+
services:
22+
beets:
23+
image: lscr.io/linuxserver/beets:latest
24+
container_name: beets
25+
environment:
26+
- PUID=1000
27+
- PGID=1000
28+
- TZ=Europe/London
29+
- DOCKER_MODS=linuxserver/mods:beets-httpshell
30+
- HTTPSHELL_PORT=5555
31+
volumes:
32+
- /path/to/config:/config
33+
- /path/to/music:/music
34+
- /path/to/downloads:/downloads
35+
ports:
36+
- 8337:8337
37+
- 5555:5555
38+
restart: unless-stopped
39+
```
40+
</details>
41+
42+
<details>
43+
<summary>Example Docker Run Command</summary>
44+
45+
```bash
46+
docker run -d \
47+
--name=beets \
48+
-e PUID=1000 \
49+
-e PGID=1000 \
50+
-e TZ=Europe/London \
51+
-e DOCKER_MODS=linuxserver/mods:beets-httpshell \
52+
-e HTTPSHELL_PORT=5555 \
53+
-p 8337:8337 \
54+
-p 5555:5555 \
55+
-v /path/to/config:/config \
56+
-v /path/to/music:/music \
57+
-v /path/to/downloads:/downloads \
58+
--restart unless-stopped \
59+
lscr.io/linuxserver/beets:latest
60+
```
61+
62+
</details>
63+
64+
4. Start the container.
65+
66+
### Environment Variables
5667

5768
| Variable | Default | Description |
5869
|---|---|---|
@@ -86,22 +97,6 @@ The URL path is the beet subcommand. The optional `?mode=` query parameter contr
8697
}
8798
```
8899

89-
### Health check
90-
91-
```
92-
GET /health
93-
```
94-
95-
Returns `200 OK` with server status:
96-
97-
```json
98-
{
99-
"status": "ok",
100-
"default_mode": "parallel",
101-
"queue_size": 0
102-
}
103-
```
104-
105100
### Examples
106101

107102
```bash
@@ -139,8 +134,6 @@ curl -X POST http://localhost:5555/move \
139134
-H "Content-Type: application/json" \
140135
-d '["artist:Radiohead", "-d", "/music/favorites"]'
141136

142-
# Health check
143-
curl http://localhost:5555/health
144137
```
145138

146139
## Execution Modes
@@ -187,9 +180,9 @@ Request 2 ──▶ 202 (queued, position 2)
187180
}
188181
```
189182

190-
## Lidarr Integration
183+
## Lidarr Integration Example
191184

192-
Use beets-httpshell as a Lidarr custom script to automatically import downloads. In Lidarr, go to **Settings → Connect → +** and add a **Custom Script** with the path to the script below.
185+
Use remote beets HTTP server in Lidarr's external content management script to automatically import downloads. In Lidarr, go to **Settings → Media Management → Importing → +** and add a **Import Script Path** with the path to the script below.
193186

194187
Create the script at a path accessible to Lidarr (e.g., `/config/scripts/beets-import.sh`):
195188

@@ -203,7 +196,7 @@ fi
203196

204197
curl -X POST --fail-with-body \
205198
-H "Content-Type: application/json" \
206-
-d "[\"$lidarr_sourcepath\"]" \
199+
-d "[\"=q\",\"$lidarr_sourcepath\"]" \
207200
'http://beets:5555/import?mode=block'
208201

209202
if [ $? -ne 0 ]; then
@@ -212,7 +205,7 @@ if [ $? -ne 0 ]; then
212205
fi
213206
```
214207

215-
> **Note:** The script uses `?mode=block` so Lidarr waits for the import to complete before proceeding. Without it, the default `parallel` mode would also work but allows concurrent imports. Adjust the hostname (`beets`) and port (`5555`) to match your setup.
208+
> **Note:** The script uses `?mode=block` so Lidarr waits for the import to complete before proceeding. Without it, the default `parallel` mode would also work but allows concurrent imports and import changes may not be detected by Lidarr sync. Adjust the hostname (`beets`) and port (`5555`) to match your setup.
216209
217210
## Mod Structure
218211

@@ -221,11 +214,7 @@ root/
221214
├── usr/local/bin/
222215
│ └── beets-httpshell.py # HTTP server script
223216
└── etc/s6-overlay/s6-rc.d/
224-
├── init-mod-beets-httpshell/ # oneshot init (startup banner, env validation)
225217
├── svc-mod-beets-httpshell/ # longrun service (HTTP server)
226-
├── init-mods-end/dependencies.d/
227-
│ └── init-mod-beets-httpshell
228218
└── user/contents.d/
229-
├── init-mod-beets-httpshell
230219
└── svc-mod-beets-httpshell
231220
```

root/etc/s6-overlay/s6-rc.d/init-mod-beets-httpshell/dependencies.d/init-mods

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/init-mod-beets-httpshell/run

Lines changed: 0 additions & 5 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-beets-httpshell/type

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-beets-httpshell/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-beets-httpshell

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-beets-httpshell

Whitespace-only changes.

0 commit comments

Comments
 (0)