autoconfigure flac2custom

This commit is contained in:
Youe Graillot 2022-07-16 12:31:16 +02:00
parent aa641d221d
commit a9442bcce3
3 changed files with 36 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -33,7 +33,7 @@ This allows an easy deployment, with the advantage of having a direct control ov
### Docker Run ### Docker Run
```shell ```sh
docker run \ docker run \
--name lidarr \ --name lidarr \
-p 8686:8686 \ -p 8686:8686 \
@ -75,6 +75,7 @@ The only manual manipulation you'll have to do is filling your Deezer credential
- Delay profile allowing Deemix to be used by automatic search - Delay profile allowing Deemix to be used by automatic search
- Deemix as an indexer - Deemix as an indexer
- Deemix as a download client - Deemix as a download client
- Flac2Custom script connection if `FLAC2CUSTOM_ARGS` is set
In case you don't want the automagical part (which is really the only value of this image), just set `AUTOCONFIG` environment variable to `false`. In case you don't want the automagical part (which is really the only value of this image), just set `AUTOCONFIG` environment variable to `false`.
@ -82,13 +83,15 @@ In case you don't want the automagical part (which is really the only value of t
The image uses a modded version of lidarr-flac2mp3 allowing conversion from any format. The image uses a modded version of lidarr-flac2mp3 allowing conversion from any format.
To enable conversion on Lidarr import, create a new Connection to a Custom Script. You can also provide your own custom conversion script here, see [lidarr-flac2mp3](https://github.com/youegraillot/lidarr-flac2mp3) for mode information. To enable conversion on Lidarr import, create a new Connection to a Custom Script. You can also provide your own custom conversion script, see [lidarr-flac2mp3](https://github.com/youegraillot/lidarr-flac2mp3) for more information.
If `AUTOCONFIG` is set to `true` (default) and you have set `FLAC2CUSTOM_ARGS`, this step done for you :
!["Lidarr custom script settings"](https://github.com/youegraillot/lidarr-on-steroids/raw/main/.assets/lidarr-custom-script.png "Lidarr custom script settings") !["Lidarr custom script settings"](https://github.com/youegraillot/lidarr-on-steroids/raw/main/.assets/lidarr-custom-script.png "Lidarr custom script settings")
## Acknowledgment ## Acknowledgment
This project is just a compilation of various tools made possible by those projects : This project is just a compilation of various tools made possible by these projects :
- [Lidarr](https://github.com/Lidarr/Lidarr) and especially [ta264](https://github.com/ta264) for the plugin integration - [Lidarr](https://github.com/Lidarr/Lidarr) and especially [ta264](https://github.com/ta264) for the plugin integration
- [lidarr-flac2mp3](https://github.com/TheCaptain989/lidarr-flac2mp3) for the format conversion script - [lidarr-flac2mp3](https://github.com/TheCaptain989/lidarr-flac2mp3) for the format conversion script

View File

@ -21,26 +21,6 @@ apiCall() {
return 0 return 0
} }
echo "
----------------------------------------------------------------------
Flac2MP3 SETUP
----------------------------------------------------------------------
PUID=$PUID
PGID=$PGID
FLAC2CUSTOM_ARGS=$FLAC2CUSTOM_ARGS
----------------------------------------------------------------------
"
if [ "$(stat -c '%g' /usr/local/bin/flac2mp3.sh)" != "$PGUID" ]; then
echo "Changing ownership on scripts."
chown "$PUID:$PGID" /usr/local/bin/flac2*.sh
fi
if [ ! -x /usr/local/bin/flac2mp3.sh ]; then
echo "Making scripts executable."
chmod +x /usr/local/bin/flac2*.sh
fi
echo " echo "
---------------------------------------------------------------------- ----------------------------------------------------------------------
LIDARR SETUP LIDARR SETUP
@ -92,3 +72,33 @@ if [ "$AUTOCONFIG" = "true" ]; then
fi fi
echo "[autoconfig] Configuration is up to date" echo "[autoconfig] Configuration is up to date"
fi fi
echo "
----------------------------------------------------------------------
Flac2MP3 SETUP
----------------------------------------------------------------------
PUID=$PUID
PGID=$PGID
FLAC2CUSTOM_ARGS=$FLAC2CUSTOM_ARGS
----------------------------------------------------------------------
"
if [ "$(stat -c '%g' /usr/local/bin/flac2mp3.sh)" != "$PGUID" ]; then
echo "Changing ownership on scripts."
chown "$PUID:$PGID" /usr/local/bin/flac2*.sh
fi
if [ ! -x /usr/local/bin/flac2mp3.sh ]; then
echo "Making scripts executable."
chmod +x /usr/local/bin/flac2*.sh
fi
if [ "$AUTOCONFIG" = "true" ]; then
if [ -n "$FLAC2CUSTOM_ARGS" ]; then
echo "[autoconfig] FLAC2CUSTOM_ARGS is set"
if ! isPresent "flac2" "notification"; then
echo "[autoconfig] Configuring flac2custom.sh custom script"
apiCall "POST" "notification" '{"onGrab":false,"onReleaseImport":true,"onUpgrade":true,"onRename":false,"onHealthIssue":false,"onDownloadFailure":false,"onImportFailure":false,"onTrackRetag":false,"onApplicationUpdate":false,"supportsOnGrab":true,"supportsOnReleaseImport":true,"supportsOnUpgrade":true,"supportsOnRename":true,"supportsOnHealthIssue":true,"includeHealthWarnings":false,"supportsOnDownloadFailure":false,"supportsOnImportFailure":false,"supportsOnTrackRetag":true,"supportsOnApplicationUpdate":true,"name":"Flac2Custom","fields":[{"name":"path","value":"/usr/local/bin/flac2custom.sh"},{"name":"arguments"}],"implementationName":"Custom Script","implementation":"CustomScript","configContract":"CustomScriptSettings","infoLink":"https://wiki.servarr.com/lidarr/supported#customscript","message":{"message":"Testing will execute the script with the EventType set to Test, ensure your script handles this correctly","type":"warning"},"tags":[]}'
fi
fi
fi