mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-13 10:59:56 +02:00
Update and rename 80-database_clean.sh to 99-database_clean.sh
This commit is contained in:
@@ -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
|
||||
13
jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh
Normal file
13
jellyfin/rootfs/etc/cont-init.d/99-database_clean.sh
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user