Skip to content

Commit 4a4e67a

Browse files
authored
Refactor: audiobookshelf (#7538)
Increase default disk size from 4GB to 5GB and mark audiobookshelf as updateable in JSON. Update install script to explicitly install ffmpeg and set FFMPEG/FFPROBE paths in /etc/default/audiobookshelf. Revise update logic to use /etc/default/audiobookshelf as installation check and perform apt updates/upgrades.
1 parent b00feea commit 4a4e67a

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

ct/audiobookshelf.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ APP="audiobookshelf"
99
var_tags="${var_tags:-podcast;audiobook}"
1010
var_cpu="${var_cpu:-2}"
1111
var_ram="${var_ram:-2048}"
12-
var_disk="${var_disk:-4}"
12+
var_disk="${var_disk:-5}"
1313
var_os="${var_os:-debian}"
1414
var_version="${var_version:-12}"
1515
var_unprivileged="${var_unprivileged:-1}"
@@ -20,15 +20,19 @@ color
2020
catch_errors
2121

2222
function update_script() {
23-
header_info
24-
check_container_storage
25-
check_container_resources
26-
if [[ ! -f /etc/apt/trusted.gpg.d/audiobookshelf-ppa.asc ]]; then
27-
msg_error "No ${APP} Installation Found!"
28-
exit
29-
fi
30-
echo "This application receives updates through the APT package manager."
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/default/audiobookshelf ]]; then
27+
msg_error "No ${APP} Installation Found!"
3128
exit
29+
fi
30+
31+
msg_info "Updating $APP LXC"
32+
$STD apt-get update
33+
$STD apt-get -y upgrade
34+
msg_ok "Updated $APP LXC"
35+
exit
3236
}
3337

3438
start
@@ -38,4 +42,4 @@ description
3842
msg_ok "Completed Successfully!\n"
3943
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
4044
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
41-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:13378${CL}"
45+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:13378${CL}"

frontend/public/json/audiobookshelf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"date_created": "2024-05-02",
88
"type": "ct",
9-
"updateable": false,
9+
"updateable": true,
1010
"privileged": false,
1111
"interface_port": 13378,
1212
"documentation": "https://www.audiobookshelf.org/guides/",
@@ -21,7 +21,7 @@
2121
"resources": {
2222
"cpu": 2,
2323
"ram": 2048,
24-
"hdd": 4,
24+
"hdd": 5,
2525
"os": "debian",
2626
"version": "12"
2727
}

install/audiobookshelf-install.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ setting_up_container
1313
network_check
1414
update_os
1515

16-
msg_info "Installing audiobookshelf"
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y ffmpeg
18+
msg_ok "Installed Dependencies"
19+
20+
msg_info "Setup audiobookshelf"
1721
curl -fsSL https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg >/etc/apt/trusted.gpg.d/audiobookshelf-ppa.asc
1822
echo "deb [signed-by=/etc/apt/trusted.gpg.d/audiobookshelf-ppa.asc] https://advplyr.github.io/audiobookshelf-ppa ./" >/etc/apt/sources.list.d/audiobookshelf.list
19-
$STD apt-get update
20-
$STD apt install audiobookshelf
21-
msg_ok "Installed audiobookshelf"
23+
$STD apt update
24+
$STD apt install -y audiobookshelf
25+
echo "FFMPEG_PATH=/usr/bin/ffmpeg" >>/etc/default/audiobookshelf
26+
echo "FFPROBE_PATH=/usr/bin/ffprobe" >>/etc/default/audiobookshelf
27+
msg_ok "Setup audiobookshelf"
2228

2329
motd_ssh
2430
customize

0 commit comments

Comments
 (0)