diff --git a/.assets/lidarr-custom-script.png b/.assets/lidarr-custom-script.png index 029932a..5b4a416 100644 Binary files a/.assets/lidarr-custom-script.png and b/.assets/lidarr-custom-script.png differ diff --git a/README.md b/README.md index 2f051a5..7b190ca 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ This allows an easy deployment, with the advantage of having a direct control ov ### Docker Run -```shell +```sh docker run \ --name lidarr \ -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 - Deemix as an indexer - 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`. @@ -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. -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") ## 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-flac2mp3](https://github.com/TheCaptain989/lidarr-flac2mp3) for the format conversion script diff --git a/root/etc/services.d/setup/run b/root/etc/services.d/setup/run index 75746cd..63d3d10 100644 --- a/root/etc/services.d/setup/run +++ b/root/etc/services.d/setup/run @@ -21,26 +21,6 @@ apiCall() { 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 " ---------------------------------------------------------------------- LIDARR SETUP @@ -92,3 +72,33 @@ if [ "$AUTOCONFIG" = "true" ]; then fi echo "[autoconfig] Configuration is up to date" 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