2018-05-18 21:52:00 +00:00
|
|
|
SOURCE_DIR := ~/Music/Music_Raw
|
|
|
|
TARGET_DIR := ~/Music/Music
|
|
|
|
BEET_CMD := BEETSDIR=. ./beets_env/bin/beet -d $(TARGET_DIR)
|
2018-04-24 16:46:45 +00:00
|
|
|
|
|
|
|
default: beets_env
|
|
|
|
|
2018-05-18 21:52:00 +00:00
|
|
|
# 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
|
|
|
|
|
2018-05-18 21:52:00 +00:00
|
|
|
# Re-runs an import on the existing library
|
2018-04-24 16:46:45 +00:00
|
|
|
reimport: beets_env
|
2018-05-18 21:52:00 +00:00
|
|
|
$(BEET_CMD) import $(TARGET_DIR)
|
2018-04-24 16:46:45 +00:00
|
|
|
|
2018-05-18 21:52:00 +00:00
|
|
|
# Incrementally imports and copies from from source into target directory
|
2018-05-18 21:35:50 +00:00
|
|
|
import: beets_env
|
2018-05-18 21:52:00 +00:00
|
|
|
$(BEET_CMD) import -i -c $(SOURCE_DIR)
|
2018-05-18 21:35:50 +00:00
|
|
|
|
2018-05-18 21:52:00 +00:00
|
|
|
# Launch beets web interface
|
2018-04-24 16:46:45 +00:00
|
|
|
web: beets_env
|
|
|
|
$(BEET_CMD) web
|
2018-05-18 21:52:00 +00:00
|
|
|
|
|
|
|
# Cleans environment and beets config
|
|
|
|
clean:
|
|
|
|
rm -fr ./beets_env ./import.log ./library.db ./state.pickle
|