Fix FileBrowser Quantum database migration path to use correct addon_configs directory

The migration code was checking `/homeassistant/addons_config/filebrowser_quantum/`
but the actual HA addon config path is `/homeassistant/addon_configs/db21ed7f_filebrowser_quantum/`.

Changes:
- Add migration check for the correct addon_configs path with slug prefix
- Handle the standard `addon_configs` directory for symlink operations
- Keep legacy `addons_config` path support for backward compatibility

Fixes: Configuration doesn't survive over restarts
This commit is contained in:
copilot-swe-agent[bot]
2026-06-03 05:19:00 +00:00
committed by GitHub
parent 830c6cebec
commit b48899b5bf

View File

@@ -7,11 +7,16 @@ set -e
####################
if [ -f /homeassistant/addons_config/filebrowser_quantum/filebrowser_quantum.db ]; then
echo "Moving database to new location /config"
echo "Moving database from legacy addons_config location to /config"
cp -rnf /homeassistant/addons_config/filebrowser_quantum/* /config/
rm -r /homeassistant/addons_config/filebrowser_quantum
fi
if [ ! -f /config/filebrowser_quantum.db ] && [ -f /homeassistant/addon_configs/db21ed7f_filebrowser_quantum/filebrowser_quantum.db ]; then
echo "Moving database from addon_configs location to /config"
cp -rnf /homeassistant/addon_configs/db21ed7f_filebrowser_quantum/* /config/
fi
######################
# Link addon folders #
######################
@@ -21,12 +26,18 @@ find /config -maxdepth 1 -type l -delete
if [ -d /homeassistant/addons_config ]; then
find /homeassistant/addons_config -maxdepth 1 -type l -delete
fi
if [ -d /homeassistant/addon_configs ]; then
find /homeassistant/addon_configs -maxdepth 1 -type l -delete
fi
# Remove erroneous folders
if [ -d /homeassistant ]; then
if [ -d /config/addons_config ]; then
rm -r /config/addons_config
fi
if [ -d /config/addon_configs ]; then
rm -r /config/addon_configs
fi
if [ -d /config/addons_autoscripts ]; then
rm -r /config/addons_autoscripts
fi
@@ -36,6 +47,9 @@ fi
if [ -d /homeassistant/addons_config ]; then
ln -s /homeassistant/addons_config /config
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} /config/addons_config/ \;
elif [ -d /homeassistant/addon_configs ]; then
ln -s /homeassistant/addon_configs /config
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} /config/addon_configs/ \;
fi
if [ -d /homeassistant/addons_autoscripts ]; then
ln -s /homeassistant/addons_autoscripts /config