1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00

Merge pull request #167 from YunoHost-Apps/testing

This commit is contained in:
Salamandar 2024-08-09 16:45:43 +02:00 committed by GitHub
commit 88c4478b14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,22 +90,24 @@ mkdir -p /var/lib/jellyfin/plugins-backup
if [ -d /var/lib/jellyfin/plugins ]; then
for directory in /var/lib/jellyfin/plugins/*; do
if [[ "$(basename "$directory")" = "configurations" ]]; then
# Kepe plugin config
name="$(basename "$directory")"
if [[ "$name" = "configurations" ]]; then
# Keep plugin config
continue
fi
if [ ! -f "$directory"/meta.json ]; then
ynh_print_warn --message="Jellyfin plugin '$name' looks legacy (missing meta.json). Moving to /var/lib/jellyfin/plugins-backup."
mv "$directory" /var/lib/jellyfin/plugins-backup/
fi
# Jellyfin doesn't refuse to start with old plugins. It just does weird
# things such as https://github.com/jellyfin/jellyfin-plugin-ldapauth/issues/161
# As a precaution, move older ABI plugins to another folder so things don't break
abi="$(jq -r '.targetAbi' "$directory"/meta.json)"
if [[ "$abi" != "$plugin_abi" ]]; then
name="$(basename "$directory")"
ynh_print_warn --message="Jellyfin plugin '$name' has different ABI version $abi than expected $plugin_abi. Moving to /var/lib/jellyfin/plugins-backup."
abi="$(jq -r '.targetAbi' "$directory/meta.json")"
if dpkg --compare-versions "$abi" lt "$plugin_abi"; then
ynh_print_warn --message="Jellyfin plugin '$name' ABI $abi is lower than expected $plugin_abi. Moving to /var/lib/jellyfin/plugins-backup."
mv "$directory" /var/lib/jellyfin/plugins-backup/
fi
done