Skip to content

Commit 63d6542

Browse files
authored
Refactor Navidrome (#6300)
1 parent 08e451f commit 63d6542

3 files changed

Lines changed: 47 additions & 60 deletions

File tree

ct/navidrome.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,19 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30-
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
31-
if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt; fi
32-
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
30+
31+
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
32+
if [[ "${RELEASE}" != "$(cat ~/.navidrome 2>/dev/null)" ]] || [[ ! -f ~/.navidrome ]]; then
3333
msg_info "Stopping Services"
3434
systemctl stop navidrome
3535
msg_ok "Services Stopped"
3636

37-
msg_info "Updating ${APP} to ${RELEASE}"
38-
TMP_DEB=$(mktemp --suffix=.deb)
39-
curl -fsSL -o "${TMP_DEB}" "https://github.com/navidrome/navidrome/releases/download/${RELEASE}/navidrome_${RELEASE#v}_linux_amd64.deb"
40-
$STD apt-get install -y "${TMP_DEB}"
41-
echo "${RELEASE}" >/opt/"${APP}_version.txt"
42-
msg_ok "Updated Navidrome"
37+
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
4338

4439
msg_info "Starting Services"
4540
systemctl start navidrome
4641
msg_ok "Started Services"
4742

48-
msg_info "Cleaning Up"
49-
rm -f "${TMP_DEB}"
50-
msg_ok "Cleaned"
5143
msg_ok "Updated Successfully"
5244
else
5345
msg_ok "No update required. ${APP} is already at ${RELEASE}"
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
{
2-
"name": "Navidrome",
3-
"slug": "navidrome",
4-
"categories": [
5-
13
6-
],
7-
"date_created": "2024-05-02",
8-
"type": "ct",
9-
"updateable": true,
10-
"privileged": false,
11-
"interface_port": 4533,
12-
"documentation": null,
13-
"website": "https://www.navidrome.org/",
14-
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/navidrome.webp",
15-
"config_path": "/etc/navidrome/navidrome.toml",
16-
"description": "Navidrome is a music server solution that makes your music collection accessible from anywhere. It provides a modern web-based user interface and compatibility with a range of third-party mobile apps for both iOS and Android devices. With Navidrome, users can access their music collection from anywhere, whether at home or on the go. The software supports a variety of music formats, making it easy for users to play their favorite songs and albums. Navidrome provides a simple and user-friendly interface for managing and organizing music collections, making it a valuable tool for music lovers who want to access their music from anywhere. The software is designed to be easy to set up and use, making it a popular choice for those who want to host their own music server and enjoy their music collection from anywhere.",
17-
"install_methods": [
18-
{
19-
"type": "default",
20-
"script": "ct/navidrome.sh",
21-
"resources": {
22-
"cpu": 2,
23-
"ram": 1024,
24-
"hdd": 4,
25-
"os": "debian",
26-
"version": "12"
27-
}
28-
}
29-
],
30-
"default_credentials": {
31-
"username": null,
32-
"password": null
33-
},
34-
"notes": [
35-
{
36-
"text": "To change Navidrome music folder path, `nano /etc/navidrome/navidrome.toml`",
37-
"type": "info"
38-
}
39-
]
2+
"name": "Navidrome",
3+
"slug": "navidrome",
4+
"categories": [
5+
13
6+
],
7+
"date_created": "2024-05-02",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 4533,
12+
"documentation": "https://www.navidrome.org/docs/",
13+
"website": "https://www.navidrome.org/",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/navidrome.webp",
15+
"config_path": "/etc/navidrome/navidrome.toml",
16+
"description": "Navidrome is a music server solution that makes your music collection accessible from anywhere. It provides a modern web-based user interface and compatibility with a range of third-party mobile apps for both iOS and Android devices. With Navidrome, users can access their music collection from anywhere, whether at home or on the go. The software supports a variety of music formats, making it easy for users to play their favorite songs and albums. Navidrome provides a simple and user-friendly interface for managing and organizing music collections, making it a valuable tool for music lovers who want to access their music from anywhere. The software is designed to be easy to set up and use, making it a popular choice for those who want to host their own music server and enjoy their music collection from anywhere.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/navidrome.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 1024,
24+
"hdd": 4,
25+
"os": "debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "To change Navidrome music folder path, `nano /etc/navidrome/navidrome.toml`",
37+
"type": "info"
38+
}
39+
]
4040
}

install/navidrome-install.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies (Patience)"
17-
$STD apt-get install -y \
18-
ffmpeg
17+
$STD apt-get install -y ffmpeg
1918
msg_ok "Installed Dependencies"
2019

21-
msg_info "Installing Navidrome"
22-
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
23-
TMP_DEB=$(mktemp --suffix=.deb)
24-
curl -fsSL -o "${TMP_DEB}" "https://github.com/navidrome/navidrome/releases/download/${RELEASE}/navidrome_${RELEASE#v}_linux_amd64.deb"
25-
$STD apt-get install -y "${TMP_DEB}"
20+
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
21+
22+
msg_info "Starting Navidrome"
2623
systemctl enable -q --now navidrome
27-
echo "${RELEASE}" >/opt/Navidrome_version.txt
28-
msg_ok "Installed Navidrome"
24+
msg_ok "Started Navidrome"
2925

3026
read -p "${TAB3}Do you want to install filebrowser addon? (y/n) " -n 1 -r
3127
if [[ $REPLY =~ ^[Yy]$ ]]; then
@@ -36,7 +32,6 @@ motd_ssh
3632
customize
3733

3834
msg_info "Cleaning up"
39-
rm -f "${TMP_DEB}"
4035
$STD apt-get -y autoremove
4136
$STD apt-get -y autoclean
4237
msg_ok "Cleaned"

0 commit comments

Comments
 (0)