Skip to content

Commit 5dd43a6

Browse files
committed
added basic options for users to add plugins #50
1 parent a3ca997 commit 5dd43a6

File tree

5 files changed

+96
-2
lines changed

5 files changed

+96
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Option to install beets plugins by placing either `requirements.txt` or `startup.sh` in /`config`. cf. [Readthedocs](https://beets-flask.readthedocs.io/en/latest/plugins.html)
13+
- [Documentation](https://beets-flask.readthedocs.io/en/latest/?badge=latest) on readthedocs.
1214
- Option to import Asis via right-click, or as inbox type. Good for Bootlegs that do not
1315
have online meta data and you curate manually. Currently also applies `--group-albums`.
1416

17+
### Fixed
18+
19+
- Path escaping for right-click import via cli (#51)
20+
1521
## [0.1.0] - 24-11-13
1622

1723
### Fixed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,15 @@ COPY --from=deps /repo /repo
102102
COPY --from=build /repo/frontend/dist /repo/frontend/dist
103103
COPY entrypoint.sh .
104104
COPY entrypoint_fix_permissions.sh .
105+
COPY entrypoint_user_scripts.sh .
105106
RUN chown -R beetle:beetle /repo
106107

107108
USER root
108-
ENTRYPOINT ["/bin/sh", "-c", "./entrypoint_fix_permissions.sh && su beetle -c ./entrypoint.sh"]
109+
110+
ENTRYPOINT [ \
111+
"/bin/sh", "-c", \
112+
"/repo/entrypoint_fix_permissions.sh && \
113+
/repo/entrypoint_user_scripts.sh && \
114+
su beetle -c /repo/entrypoint.sh" \
115+
]
116+

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ hide-toc: true
2121
This documentation is very much a work in progress. If you have any questions or suggestions, please feel free to open an issue or a pull request.
2222
```
2323

24-
```{toctree}
24+
```{toctree}
2525
---
2626
maxdepth: 1
2727
---
2828
2929
contribution
3030
developer
31+
plugins
3132
```
3233

docs/plugins.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Installing beets plugins
2+
3+
```{warning}
4+
We have not tested a lot of plugins with beets-flask gui.
5+
Plugin support is experimental.
6+
```
7+
8+
Installing beets plugins varies depending on the particular plugin.
9+
[See the official docs](https://docs.beets.io/en/latest/plugins/index.html).
10+
11+
We might automate this in the future, but for now you can place either a `requirements.txt` or `startup.sh` in the `/config` folder.
12+
After starting, the container will run the startup script if it exists, and afterwards install the requirements from the `requirements.txt` file using pip.
13+
14+
15+
## Example startup.sh: keyfinder
16+
For example, we can install the [keyfinder plugin](https://docs.beets.io/en/latest/plugins/keyfinder.html) via `startup.sh`, as it requires quite a few build steps.
17+
18+
Place the following in a `startup.sh` file in the `/config` folder.
19+
20+
```sh
21+
#!/bin/sh
22+
23+
apk update
24+
apk add \
25+
build-base \
26+
ffmpeg-dev \
27+
libkeyfinder-dev \
28+
29+
git clone https://github.com/evanpurkhiser/keyfinder-cli.git
30+
cd keyfinder-cli/
31+
make
32+
make install
33+
```
34+
Note that the container is based on alpine, so you have to use apk.
35+
Make executable
36+
```sh
37+
chmod +x ./startup.sh
38+
```
39+
40+
41+
Edit beets `config.yaml` to include the plugin.
42+
```yaml
43+
plugins:
44+
[
45+
keyfinder,
46+
]
47+
48+
keyfinder:
49+
auto: yes
50+
bin: /usr/local/bin/keyfinder-cli
51+
overwrite: no
52+
```
53+
54+
Note, in case you want to use another key format, you have to create an alias of the executable and specify that in the `config.yaml`.
55+
Also, your container start-up time might increase considerably.
56+
57+
58+
## Example requirements.txt: discogs
59+
60+
Place the following in a `requirements.txt` file in the `/config` folder.
61+
62+
```txt
63+
beets[discogs]
64+
```
65+
66+
and follow the instructions in the [official docs](https://docs.beets.io/en/latest/plugins/discogs.html).

entrypoint_user_scripts.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# check for user startup scripts
4+
if [ -f /config/startup.sh ]; then
5+
echo "Running user startup script"
6+
/config/startup.sh
7+
fi
8+
9+
# check for requirements.txt
10+
if [ -f /config/requirements.txt ]; then
11+
echo "Installing pip requirements"
12+
pip install -r /config/requirements.txt
13+
fi

0 commit comments

Comments
 (0)