my-beets/Makefile

54 lines
1.2 KiB
Makefile
Raw Normal View History

2019-06-29 00:40:54 +00:00
DOCKER_TAG := beets-dev-${USER}
SOURCE_DIR := ~/Music/Incoming
TARGET_DIR := ~/Music/Library
BEET_CMD := BEETSDIR=. ./beets_env/bin/beet -d $(TARGET_DIR)
2018-04-24 16:46:45 +00:00
default: beets_env
# Creates virtualenv with beets
2018-04-24 16:46:45 +00:00
beets_env:
python3 -m venv beets_env
./beets_env/bin/pip install -U pip
./beets_env/bin/pip install -r ./requirements.txt
# Re-runs an import on the existing library
2018-04-24 16:46:45 +00:00
reimport: beets_env
$(BEET_CMD) import $(TARGET_DIR)
2018-04-24 16:46:45 +00:00
# Incrementally imports and copies from from source into target directory
2018-05-18 21:35:50 +00:00
import: beets_env
$(BEET_CMD) import -i -c $(SOURCE_DIR)
2018-05-18 21:35:50 +00:00
2019-06-29 01:03:23 +00:00
# List all duplicates
duplicates: beets_env
$(BEET_CMD) duplicates
# Launch beets web interface
2018-04-24 16:46:45 +00:00
web: beets_env
$(BEET_CMD) web
# Cleans environment and beets config
clean:
rm -fr ./beets_env ./import.log ./library.db ./state.pickle
2019-06-29 00:40:54 +00:00
docker-build:
docker build . -t $(DOCKER_TAG)
docker-import: docker-build
docker run --rm -it \
-v $(shell pwd):/beets \
2019-06-29 01:03:23 +00:00
-v $(SOURCE_DIR):/import \
-v $(TARGET_DIR):/library \
$(DOCKER_TAG) \
-d /library \
import -i -c /import
docker-duplicates: docker-build
docker run --rm -it \
-v $(shell pwd):/beets \
-v $(SOURCE_DIR):/import \
-v $(TARGET_DIR):/library \
2019-06-29 00:40:54 +00:00
$(DOCKER_TAG) \
2019-06-29 01:03:23 +00:00
-d /library \
duplicates