Open Protektor-Desura opened 2 years ago
Note: These are based on Linuxserver.io images
-----------------------------90-config----------------------------------
#!/usr/bin/with-contenv bash
DOCKERVERSION=20.10.9
curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
Also /music is both the root volume for my music in both beets and lidarr. It can be whatever you want but for this to work they both need to have the same path in their respective containers so that when lidarr calls beets, its the same path structure.
-----------------------------beet_import.sh----------------------------------
#!/bin/bash
#Get Destination Folder
lidarr_first_track=$(echo "$lidarr_addedtrackpaths" | cut -d '|' -f1)
lidarr_album_path=$(dirname "$lidarr_first_track")
#Trigger Beets
docker --config "/config/.docker" exec -u abc beets /bin/bash -c "beet update" && sleep 3
docker --config "/config/.docker" exec -u abc beets /bin/bash -c "beet import -q '$lidarr_album_path'"
#Update Lidarr
FILE=/config/config.xml
until test -f $FILE; do sleep 1; done
API=`grep -oP '(?<=<ApiKey>)(.*)(?=<\/ApiKey>)' /config/config.xml`
curl -s "http://localhost:8686/music/api/v1/command?apikey=$API" -X POST -d "{'name': 'ReScanArtist', 'artistID': $lidarr_artist_id}" > /dev/null
Optional:
I have Beets convert the music and rename so I have lidarr renaming tracks with an additional underscore in the track name
{track:00}_{Track Title}
so that when it gets to beets, it doesn't accidentally remove the wrong file. I think it might be overkill since beets converts to temp folder and then copies. Then in beets config I have the naming structure to
$track - $title
@reboot setfacl -m user:MY_USER_THAT_RUNS_DOCKERS:rw /var/run/docker.sock
Convert the following dockers & scripts to Docker Mods.
https://github.com/RandomNinjaAtk/docker-ama https://github.com/RandomNinjaAtk/docker-ambd https://github.com/RandomNinjaAtk/docker-amd https://github.com/RandomNinjaAtk/docker-amvd https://github.com/RandomNinjaAtk/Tidal-Media-Downloader
I would like to request help creating a Beets docker mode to Lidarr to allow automatic tagging and automatic converting of files.