Skip to content

Commit

Permalink
Lidarr and Readarr: adjust module options to match changes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 23, 2024
1 parent 5d4321b commit 7ed198d
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 22 deletions.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 29 additions & 6 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,9 @@
"condition": "module_bazarr status"
},
{
"id": "DOW021",
"description": "Install Lidarr",
"id": "LID001",
"description": "Lidarr music collection manager install",
"about": "This operation will install Lidarr music collection manager for Usenet and BitTorrent users",
"command": [
"module_lidarr install"
],
Expand All @@ -683,8 +684,9 @@
"condition": "! module_lidarr status"
},
{
"id": "DOW022",
"description": "Remove Lidarr",
"id": "LID002",
"description": "Lidarr remove",
"about": "This operation will remove Lidarr",
"command": [
"module_lidarr remove"
],
Expand All @@ -693,7 +695,18 @@
"condition": "module_lidarr status"
},
{
"id": "DOW023",
"id": "LID003",
"description": "Lidarr purge",
"about": "This operation will purge Lidarr data folder",
"command": [
"module_lidarr purge"
],
"status": "Stable",
"author": "@armbian",
"condition": "module_lidarr status"
},
{
"id": "RDR001",
"description": "Install Readarr",
"command": [
"module_readarr install"
Expand All @@ -703,7 +716,7 @@
"condition": "! module_readarr status"
},
{
"id": "DOW024",
"id": "RDR002",
"description": "Remove Readarr",
"command": [
"module_readarr remove"
Expand All @@ -712,6 +725,16 @@
"author": "@armbian",
"condition": "module_readarr status"
},
{
"id": "RDR003",
"description": "Remove Readarr",
"command": [
"module_readarr purge"
],
"status": "Stable",
"author": "@armbian",
"condition": "module_readarr status"
},
{
"id": "DOW025",
"description": "Install Prowlarr",
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/runtime/config.runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ update_sub_submenu_data "Software" "Downloaders" "MDS002" "http://$LOCALIPADD:${
update_sub_submenu_data "Software" "Downloaders" "SON002" "http://$LOCALIPADD:${module_options["module_sonarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "RAD002" "http://$LOCALIPADD:${module_options["module_radarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "BAZ002" "http://$LOCALIPADD:${module_options["module_bazarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "DOW022" "http://$LOCALIPADD:${module_options["module_lidarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "DOW024" "http://$LOCALIPADD:${module_options["module_readarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "LID002" "http://$LOCALIPADD:${module_options["module_lidarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "RDR002" "http://$LOCALIPADD:${module_options["module_readarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "DOW026" "http://$LOCALIPADD:${module_options["module_prowlarr,port"]}"
update_sub_submenu_data "Software" "Downloaders" "DOW041" "http://$LOCALIPADD:${module_options["module_jellyseerr,port"]}"

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module_options+=(
["module_lidarr,author"]="@armbian"
["module_lidarr,maintainer"]="@igorpecovnik"
["module_lidarr,feature"]="module_lidarr"
["module_lidarr,example"]="install remove purge status help"
["module_lidarr,desc"]="Install lidarr container"
["module_lidarr,example"]="install remove status help"
["module_lidarr,port"]="8686"
["module_lidarr,status"]="Active"
["module_lidarr,arch"]="x86-64,arm64"
["module_lidarr,doc_link"]="https://wiki.servarr.com/lidarr"
["module_lidarr,group"]="Downloaders"
["module_lidarr,port"]="8686"
["module_lidarr,arch"]="x86-64 arm64"
)
#
# Module lidarr
Expand All @@ -26,10 +29,11 @@ function module_lidarr () {

case "$1" in
"${commands[0]}")
pkg_installed docker-ce || install_docker
pkg_installed docker-ce || module_docker install
[[ -d "$LIDARR_BASE" ]] || mkdir -p "$LIDARR_BASE" || { echo "Couldn't create storage directory: $LIDARR_BASE"; exit 1; }
docker run -d \
--name=lidarr \
--net=lsio \
-e PUID=1000 \
-e PGID=1000 \
-e TZ="$(cat /etc/timezone)" \
Expand All @@ -54,26 +58,30 @@ function module_lidarr () {
"${commands[1]}")
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null
[[ "${image}" ]] && docker image rm "$image" >/dev/null
[[ -n "${LIDARR_BASE}" && "${LIDARR_BASE}" != "/" ]] && rm -rf "${LIDARR_BASE}"
;;
"${commands[2]}")
${module_options["module_lidarr,feature"]} ${commands[1]}
[[ -n "${LIDARR_BASE}" && "${LIDARR_BASE}" != "/" ]] && rm -rf "${LIDARR_BASE}"
;;
"${commands[3]}")
if [[ "${container}" && "${image}" ]]; then
return 0
else
return 1
fi
;;
"${commands[3]}")
"${commands[4]}")
echo -e "\nUsage: ${module_options["module_lidarr,feature"]} <command>"
echo -e "Commands: ${module_options["module_lidarr,example"]}"
echo "Available commands:"
echo -e "\tinstall\t- Install $title."
echo -e "\tstatus\t- Installation status $title."
echo -e "\tremove\t- Remove $title."
echo -e "\tremove\t- Purge $title."
echo
;;
*)
${module_options["module_lidarr,feature"]} ${commands[3]}
${module_options["module_lidarr,feature"]} ${commands[4]}
;;
esac
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module_options+=(
["module_readarr,author"]="@armbian"
["module_readarr,maintainer"]="@igorpecovnik"
["module_readarr,feature"]="module_readarr"
["module_readarr,example"]="install remove purge status help"
["module_readarr,desc"]="Install readarr container"
["module_readarr,example"]="install remove status help"
["module_readarr,port"]="8787"
["module_readarr,status"]="Active"
["module_readarr,arch"]="x86-64,arm64"
["module_readarr,doc_link"]="https://wiki.servarr.com/readarr"
["module_readarr,group"]="Downloaders"
["module_readarr,port"]="8787"
["module_readarr,arch"]="x86-64 arm64"
)
#
# Module readarr
Expand All @@ -26,10 +29,11 @@ function module_readarr () {

case "$1" in
"${commands[0]}")
pkg_installed docker-ce || install_docker
pkg_installed docker-ce || module_docker install
[[ -d "$READARR_BASE" ]] || mkdir -p "$READARR_BASE" || { echo "Couldn't create storage directory: $READARR_BASE"; exit 1; }
docker run -d \
--name=readarr \
--net=lsio \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
Expand All @@ -54,26 +58,30 @@ function module_readarr () {
"${commands[1]}")
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null
[[ "${image}" ]] && docker image rm "$image" >/dev/null
[[ -n "${READARR_BASE}" && "${READARR_BASE}" != "/" ]] && rm -rf "${READARR_BASE}"
;;
"${commands[2]}")
${module_options["module_readarr,feature"]} ${commands[1]}
[[ -n "${READARR_BASE}" && "${READARR_BASE}" != "/" ]] && rm -rf "${READARR_BASE}"
;;
"${commands[3]}")
if [[ "${container}" && "${image}" ]]; then
return 0
else
return 1
fi
;;
"${commands[3]}")
"${commands[4]}")
echo -e "\nUsage: ${module_options["module_readarr,feature"]} <command>"
echo -e "Commands: ${module_options["module_readarr,example"]}"
echo "Available commands:"
echo -e "\tinstall\t- Install $title."
echo -e "\tstatus\t- Installation status $title."
echo -e "\tremove\t- Remove $title."
echo -e "\tpurge\t- Purge $title."
echo
;;
*)
${module_options["module_readarr,feature"]} ${commands[3]}
${module_options["module_readarr,feature"]} ${commands[4]}
;;
esac
}

0 comments on commit 7ed198d

Please sign in to comment.