emby stable

This commit is contained in:
Alexandre
2025-04-22 11:13:09 +02:00
parent 46f009fe8d
commit 3ea2070bd7
19 changed files with 1216 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
data_location="${data_location:-/share/emby}"
config_location="/config/emby"
log() {
bashio::log.info "$1"
}
log "Updating folder structure and permission : data stored in $data_location"
declare -A directories=(
["/emby"]=""
["/share/storage/tv"]=""
["/share/storage/movies"]=""
["$data_location"]=""
["$config_location"]=""
)
for dir in "${!directories[@]}"; do
log "Creating directory: $dir"
mkdir -p "$dir"
chown -R "$PUID:$PGID" "$dir"
done
if [ -d /homeassistant/emby ]; then
log "Migrate previous config location"
cp -rf /homeassistant/emby/* "$config_location"/
mv /homeassistant/emby /homeassistant/emby_migrated
chown -R "$PUID:$PGID" "$config_location"
fi
if [ -f /homeassistant/addons_autoscripts/emby-nas.sh ]; then
cp -rf /homeassistant/addons_autoscripts/emby-nas.sh "$config_location"/
mv /homeassistant/addons_autoscripts/emby-nas.sh /homeassistant/addons_autoscripts/emby-nas_migrated.sh
fi
declare -A links=(
["/emby/cache"]="$data_location/cache"
["/emby/config"]="$config_location"
["/emby/data"]="$data_location/data"
["/emby/logs"]="$data_location/logs"
["/emby/metadata"]="$data_location/metadata"
["/emby/plugins"]="$data_location/plugins"
["/emby/root"]="$data_location/root"
)
for link in "${!links[@]}"; do
if [ ! -d "$link" ]; then
log "Creating link for $link"
mkdir -p "${links[$link]}"
chown -R "$PUID:$PGID" "${links[$link]}"
ln -s "${links[$link]}" "$link"
fi
done

View File

@@ -0,0 +1,21 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
#################
# NGINX SETTING #
#################
declare ingress_interface
declare ingress_port
echo "Adapting for ingress"
ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
# Allow uppercase url
echo "Allowing case sensitive url"
grep -rl toLowerCase /app/emby/system/dashboard-ui/app.js | xargs sed -i 's/toLowerCase()/toString()/g'
grep -rl toLowerCase /app/emby/system/dashboard-ui/network | xargs sed -i 's/toLowerCase()/toString()/g'

View File

@@ -0,0 +1,13 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
###############
# SILENT MODE #
###############
if bashio::config.true 'silent'; then
APPEND=' >/dev/null'
sed -i '$s|$|'"$APPEND"'|' /etc/s6-overlay/s6-rc.d/svc-emby/run
bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.'
fi