Fix Jellyfin legacy symlink handling

This commit is contained in:
Alexandre
2025-12-13 20:13:04 +01:00
parent 795b30c78e
commit c89cf5bf63
3 changed files with 16 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
## 10.11.4-1 (07-12-2025)
- Avoid deleting the configured data directory when it matches the legacy path while rebuilding symlinks.
## breaking_versions: 10.11.4 (06-12-2025) ## breaking_versions: 10.11.4 (06-12-2025)
- Minor bugs fixed - Minor bugs fixed

View File

@@ -125,5 +125,5 @@ schema:
slug: jellyfin slug: jellyfin
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons url: https://github.com/alexbelgium/hassio-addons
version: "10.11.4" version: "10.11.4-1"
video: true video: true

View File

@@ -10,9 +10,21 @@ create_link() {
local target_dir="$1" local target_dir="$1"
local link_path="$2" local link_path="$2"
local target_real
local link_real
target_real=$(realpath -m "$target_dir")
link_real=$(realpath -m "$link_path")
mkdir -p "$target_dir" mkdir -p "$target_dir"
mkdir -p "$(dirname "$link_path")" mkdir -p "$(dirname "$link_path")"
# If the link path is the same as the target, just ensure ownership and exit
if [ "$target_real" = "$link_real" ]; then
chown -R "$PUID:$PGID" "$target_dir"
return
fi
if [ -L "$link_path" ]; then if [ -L "$link_path" ]; then
rm "$link_path" rm "$link_path"
elif [ -d "$link_path" ]; then elif [ -d "$link_path" ]; then