fix review

This commit is contained in:
Wendy Liga 2025-12-27 20:49:54 +07:00
parent c189a9b8d6
commit 5698870c63
No known key found for this signature in database
3 changed files with 38 additions and 43 deletions

View File

@ -24,18 +24,18 @@ function update_script() {
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/fladder ]]; then if [[ ! -f ~/.fladder ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
# Get latest version from GitHub # Get latest version from GitHub
RELEASE=$(curl -fsSL https://api.github.com/repos/DonutWare/Fladder/releases/latest | \ RELEASE=$(get_latest_github_release "DonutWare/Fladder")
grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ -z "$RELEASE" ]]; then if [[ -z "$RELEASE" ]]; then
msg_error "Failed to fetch latest release version from GitHub" msg_error "Failed to fetch latest release version from GitHub"
exit 1 exit 1
fi fi
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Service" msg_info "Stopping Service"
systemctl stop nginx systemctl stop nginx
msg_ok "Stopped Service" msg_ok "Stopped Service"
@ -44,9 +44,6 @@ function update_script() {
if [[ -f /opt/fladder/assets/config/config.json ]]; then if [[ -f /opt/fladder/assets/config/config.json ]]; then
cp /opt/fladder/assets/config/config.json /tmp/fladder_config.json.bak cp /opt/fladder/assets/config/config.json /tmp/fladder_config.json.bak
msg_ok "Configuration backed up" msg_ok "Configuration backed up"
elif [[ -f /opt/fladder/data/flutter_assets/config/config.json ]]; then
cp /opt/fladder/data/flutter_assets/config/config.json /tmp/fladder_config.json.bak
msg_ok "Configuration backed up"
fi fi
msg_info "Updating ${APP} to ${RELEASE}" msg_info "Updating ${APP} to ${RELEASE}"
@ -55,7 +52,7 @@ function update_script() {
rm -rf /opt/fladder rm -rf /opt/fladder
unzip -q "Fladder-Web-${RELEASE#v}.zip" -d fladder unzip -q "Fladder-Web-${RELEASE#v}.zip" -d fladder
rm -f "Fladder-Web-${RELEASE#v}.zip" rm -f "Fladder-Web-${RELEASE#v}.zip"
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" > ~/.fladder
msg_ok "Updated ${APP} to ${RELEASE}" msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Restoring configuration" msg_info "Restoring configuration"
@ -70,9 +67,6 @@ function update_script() {
systemctl start nginx systemctl start nginx
msg_ok "Started Service" msg_ok "Started Service"
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }

View File

@ -11,7 +11,7 @@
"interface_port": 80, "interface_port": 80,
"documentation": "https://github.com/DonutWare/Fladder/blob/develop/INSTALL.md#ubuntudebian", "documentation": "https://github.com/DonutWare/Fladder/blob/develop/INSTALL.md#ubuntudebian",
"website": "https://github.com/DonutWare/Fladder", "website": "https://github.com/DonutWare/Fladder",
"logo": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/fladder.webp", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/fladder.webp",
"config_path": "/opt/fladder/assets/config/config.json", "config_path": "/opt/fladder/assets/config/config.json",
"description": "Fladder is a simple Jellyfin frontend built on top of Flutter. It provides a modern interface to stream and sync content locally, manage libraries, support multiple profiles, and offers direct, transcode and offline playback with media segments skipping.", "description": "Fladder is a simple Jellyfin frontend built on top of Flutter. It provides a modern interface to stream and sync content locally, manage libraries, support multiple profiles, and offers direct, transcode and offline playback with media segments skipping.",
"install_methods": [ "install_methods": [

View File

@ -14,22 +14,23 @@ network_check
update_os update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt install -y \
wget \ wget \
unzip \ unzip \
nginx nginx
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing ${APPLICATION}" msg_info "Installing ${APPLICATION}"
# Get latest version from GitHub # Get latest version from GitHub
RELEASE=$(curl -fsSL https://api.github.com/repos/DonutWare/Fladder/releases/latest | \ RELEASE=$(get_latest_github_release "DonutWare/Fladder")
grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
cd /opt cd /opt
$STD wget -q "https://github.com/DonutWare/Fladder/releases/download/${RELEASE}/Fladder-Web-${RELEASE#v}.zip" $STD wget -q "https://github.com/DonutWare/Fladder/releases/download/${RELEASE}/Fladder-Web-${RELEASE#v}.zip"
$STD unzip -o "Fladder-Web-${RELEASE#v}.zip" -d fladder $STD unzip -o "Fladder-Web-${RELEASE#v}.zip" -d fladder
rm -f "Fladder-Web-${RELEASE#v}.zip" rm -f "Fladder-Web-${RELEASE#v}.zip"
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt echo "${RELEASE}" > ~/.fladder
msg_ok "Installed ${APPLICATION}" msg_ok "Installed ${APPLICATION}"
msg_info "Configuring Nginx" msg_info "Configuring Nginx"