Refactor: Photoprism (#6335)

This commit is contained in:
CanbiZ 2025-07-29 12:24:21 +02:00 committed by GitHub
parent e54ed7dc35
commit 202eb3fb2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 85 additions and 30 deletions

View file

@ -27,22 +27,35 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Stopping PhotoPrism"
sudo systemctl stop photoprism
msg_ok "Stopped PhotoPrism"
msg_info "Updating PhotoPrism"
$STD apt-get install -y libvips42
curl -fsSL https://dl.photoprism.app/pkg/linux/amd64.tar.gz | tar -xzf - -C /opt/photoprism --strip-components=1
msg_ok "Updated PhotoPrism"
RELEASE=$(curl -fsSL https://api.github.com/repos/photoprism/photoprism/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat ~/.photoprism 2>/dev/null)" ]] || [[ ! -f ~/.photoprism ]]; then
msg_info "Stopping PhotoPrism"
systemctl stop photoprism
msg_ok "Stopped PhotoPrism"
msg_info "Starting PhotoPrism"
sudo systemctl start photoprism
msg_ok "Started PhotoPrism"
msg_ok "Update Successful"
fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz"
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(lsb_release -cs)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
if [[ "${LIBHEIF_URL}" != "$(cat ~/.photoprism_libheif 2>/dev/null)" ]] || [[ ! -f ~/.photoprism_libheif ]]; then
msg_info "Updating PhotoPrism LibHeif"
$STD apt-get install -y libvips42
curl -fsSL "https://dl.photoprism.app/dist/libheif/$LIBHEIF_URL" -o /tmp/libheif.tar.gz
tar -xzf /tmp/libheif.tar.gz -C /usr/local
ldconfig
echo "${LIBHEIF_URL}" >~/.photoprism_libheif
msg_ok "Updated PhotoPrism LibHeif"
fi
msg_info "Starting PhotoPrism"
systemctl start photoprism
msg_ok "Started PhotoPrism"
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
}
start
build_container
description