Refactor Navidrome (#6300)

This commit is contained in:
Slaviša Arežina 2025-07-28 14:56:54 +02:00 committed by GitHub
parent 08e451f8de
commit 63d65420a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 47 additions and 60 deletions

View File

@ -27,27 +27,19 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt; fi
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat ~/.navidrome 2>/dev/null)" ]] || [[ ! -f ~/.navidrome ]]; then
msg_info "Stopping Services"
systemctl stop navidrome
msg_ok "Services Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
TMP_DEB=$(mktemp --suffix=.deb)
curl -fsSL -o "${TMP_DEB}" "https://github.com/navidrome/navidrome/releases/download/${RELEASE}/navidrome_${RELEASE#v}_linux_amd64.deb"
$STD apt-get install -y "${TMP_DEB}"
echo "${RELEASE}" >/opt/"${APP}_version.txt"
msg_ok "Updated Navidrome"
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
msg_info "Starting Services"
systemctl start navidrome
msg_ok "Started Services"
msg_info "Cleaning Up"
rm -f "${TMP_DEB}"
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"

View File

@ -9,7 +9,7 @@
"updateable": true,
"privileged": false,
"interface_port": 4533,
"documentation": null,
"documentation": "https://www.navidrome.org/docs/",
"website": "https://www.navidrome.org/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/navidrome.webp",
"config_path": "/etc/navidrome/navidrome.toml",

View File

@ -14,18 +14,14 @@ network_check
update_os
msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \
ffmpeg
$STD apt-get install -y ffmpeg
msg_ok "Installed Dependencies"
msg_info "Installing Navidrome"
RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
TMP_DEB=$(mktemp --suffix=.deb)
curl -fsSL -o "${TMP_DEB}" "https://github.com/navidrome/navidrome/releases/download/${RELEASE}/navidrome_${RELEASE#v}_linux_amd64.deb"
$STD apt-get install -y "${TMP_DEB}"
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
msg_info "Starting Navidrome"
systemctl enable -q --now navidrome
echo "${RELEASE}" >/opt/Navidrome_version.txt
msg_ok "Installed Navidrome"
msg_ok "Started Navidrome"
read -p "${TAB3}Do you want to install filebrowser addon? (y/n) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
@ -36,7 +32,6 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -f "${TMP_DEB}"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"