pSpitzner / beets-flask

An opinionated docker container for a web-interface around the music organizer beets
MIT License
30 stars 2 forks source link

Beets Flask

version number docker-hub status License: MIT

Opinionated web-interface around the music organizer beets

Features

https://github.com/user-attachments/assets/dd526b9d-9351-4f7c-9034-1071e4ff66e6

Quickstart

We provide a docker image with the full beeets-flask setup. You can run it with docker-compose or docker. We recommend using the stable tag, alternatively you may use latest for the most recent build.

Setup container

Using docker

docker run -d -p 5001:5001 \
    -e USER_ID=1000 \
    -e GROUP_ID=1000 \
    -v /wherever/config/:/config \
    -v /music_path/inbox/:/music_path/inbox/ \
    -v /music_path/clean/:/music_path/clean/ \
    --name beets-flask \
    pspitzner/beets-flask:stable

Using docker compose

services:
    beets-flask:
        image: pspitzner/beets-flask:stable
        restart: unless-stopped
        ports:
            - "5001:5001"
        environment:
            # 502 is default on macos, 1000 on linux
            USER_ID: 1000
            GROUP_ID: 1000
        volumes:
            - /wherever/config/:/config
            # for music folders, match paths inside and out of container!
            - /music_path/inbox/:/music_path/inbox/
            - /music_path/clean/:/music_path/clean/

This will create a container with the following folder structure:

├── music_path
│   ├── inbox
│   └── clean
└── config
    ├── beets
    │   ├── config.yaml
    │   └── library.db
    └── beets-flask
        ├── config.yaml
        └── beets-flask-sqlite.db

Edit configs

On first container launch, config files are automatically generated in the specified config folder. As the minimum, you need to update the information about your music folders. Configurations are read from config/beets/config.yaml and config/beets-flask/config.yaml (the latter takes precedence).

# config/beets/config.yaml
directory: /music_path/clean/

Restart the container to apply changes:

docker restart beets-flask

See all config options (and how to use your existing library) below.

Motivation

Autotagging music with beets is great. Beets identifies metadata correctly most of the time, and if you are not a control-freak, there is hardly any reason to check the found metadata.

However, if you do want a bit more control, things could be more convenient.

This is the main idea with beets-flask: For all folders in your inbox, we generate a preview of what beets would do and show you those previews. Then it's easy to go through them and import the correct ones, while falling back to terminal for those that were not to your liking.

Configuration

To use your existing beets library

# docker-compose.yml
volumes:
    - ~/.config/beets/:/config/beets/
    - ~/.config/beets-flask/:/config/beets-flask/
    - /music_path/clean/:/music_path/clean/

To start from scratch or with a copy of your existing library

# docker-compose.yml
volumes:
    - /music_path/config/:/config/
    - /music_path/inbox/:/music_path/inbox/
    - /music_path/imported/:/music_path/imported/

Roadmap

For the current state, there is a KanBan board.

Currently planned:

Developer quick start

We appriciate any help! If you want to contribute, here is how to get started:

docker exec -it beets-flask-dev bash
cd /repo/frontend

pnpm install
pnpm run dev

The frontend is served at http://localhost:5173

If you are having issues installing dependencies with pnpm, try:

rm -rf /repo/frontend/node_modules
rm -rf /repo/frontend/dist
rm -rf /repo/.pnpm-store
pnpm store prune

# and/or reset the lockfile
rm -rf /frontend/pnpm-lock.json

See also Resources.md for some background information and design choices.