From 818bfd29c7d8ad3fb8a7c7f59e9287cacef91b27 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 17 Dec 2022 21:22:28 +0100 Subject: [PATCH] Update and rename 80-database_clean.sh to 99-database_clean.sh --- .../rootfs/etc/cont-init.d/80-database_clean.sh | 13 ------------- .../rootfs/etc/cont-init.d/99-database_clean.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 jellyfin/rootfs/etc/cont-init.d/80-database_clean.sh create mode 100644 jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh 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