diff --git a/jellyfin/rootfs/etc/cont-init.d/80-database_clean.sh b/jellyfin/rootfs/etc/cont-init.d/80-database_clean.sh deleted file mode 100644 index 53025bbf3..000000000 --- a/jellyfin/rootfs/etc/cont-init.d/80-database_clean.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash - -LOCATION=$(bashio::config 'data_location') -if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then LOCATION=/config/addons_config/${HOSTNAME#*-}; fi - -#Set variable -db="$LOCATION"/data/data/library.db - -#Modify base -if [ -f $db ]; then - sqlite3 -quote ${db} "UPDATE 'TypedBaseItems' SET data = replace( data, '/config/jellyfin/', "$LOCATION" ), path = replace( path, '/config/jellyfin/', "$LOCATION" ) WHERE type='MediaBrowser.Controller.Entities.CollectionFolder';" -fi diff --git a/jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh b/jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh new file mode 100644 index 000000000..af27f819f --- /dev/null +++ b/jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh @@ -0,0 +1,13 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash + +#LOCATION=$(bashio::config 'data_location') +#if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then LOCATION=/config/addons_config/${HOSTNAME#*-}; fi + +#Set variable +db=/config/jellyfin/data/data/library.db + +#Modify base +if [ -f $db ]; then + sqlite3 -quote ${db} "UPDATE 'TypedBaseItems' SET data = replace( data, '/config/jellyfin/', '%%LOCATION%%' ), path = replace( path, '/config/jellyfin/', '%%LOCATION%%' ) WHERE type='MediaBrowser.Controller.Entities.CollectionFolder';" +fi