fix: auto-fix linting issues

This commit is contained in:
alexbelgium
2025-06-10 10:06:17 +00:00
committed by github-actions[bot]
parent e5adbd266f
commit f728166b14
197 changed files with 5747 additions and 5714 deletions

View File

@@ -18,8 +18,8 @@ CONFIGDIR="/config/addons_config/transmission"
####################
if [ -d /config/transmission ]; then
cp -r /config/transmission /config/addons_config/transmission
rm -r /config/transmission
cp -r /config/transmission /config/addons_config/transmission
rm -r /config/transmission
fi
###############
@@ -33,8 +33,8 @@ mkdir -p /watch || true
chown -R "$PUID:$PGID" "$CONFIGDIR"
if ! bashio::fs.file_exists "$CONFIGDIR/settings.json"; then
echo "Creating default config"
cp "/defaults/settings.json" "$CONFIGDIR/settings.json"
echo "Creating default config"
cp "/defaults/settings.json" "$CONFIGDIR/settings.json"
fi
#################
@@ -45,7 +45,7 @@ fi
##############
if bashio::config.has_value 'customUI'; then
CUSTOMUI=$(bashio::config 'customUI')
CUSTOMUI=$(bashio::config 'customUI')
fi
bashio::log.info "UI selected : $CUSTOMUI"
@@ -66,13 +66,13 @@ chown "$PUID:$PGID" "$download_dir"
# if incomplete dir > 2, to allow both null and '', set it as existing
if [ ${#incomplete_dir} -ge 2 ]; then
echo "Incomplete dir set: $incomplete_dir"
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=true")
mkdir -p "$incomplete_dir"
chown "$PUID:$PGID" "$incomplete_dir"
echo "Incomplete dir set: $incomplete_dir"
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=true")
mkdir -p "$incomplete_dir"
chown "$PUID:$PGID" "$incomplete_dir"
else
echo "Incomplete dir disabled"
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=false")
echo "Incomplete dir disabled"
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=false")
fi
# Defaults
@@ -82,11 +82,11 @@ CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-host-whitelist-enabled\"=false")
CONFIG=$(bashio::jq "${CONFIG}" ".\"bind-address-ipv4\"=\"0.0.0.0\"")
if bashio::config.has_value 'watch_dir'; then
CONFIG=$(bashio::jq "${CONFIG}" ".\"watch-dir\"=\"$(bashio::config 'watch_dir')\"")
CONFIG=$(bashio::jq "${CONFIG}" ".\"watch-dir\"=\"$(bashio::config 'watch_dir')\"")
fi
echo "${CONFIG}" >"$CONFIGDIR"/settings.json &&
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json $CONFIGDIR/settings.json
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json $CONFIGDIR/settings.json
# USER and PASS
###############
@@ -95,17 +95,17 @@ CONFIG=$(<"$CONFIGDIR"/settings.json)
USER=$(bashio::config 'user')
PASS=$(bashio::config 'pass')
if bashio::config.has_value 'user'; then
BOOLEAN=true
bashio::log.info "User & Pass set, authentification will be with user : $USER and pass : $PASS"
BOOLEAN=true
bashio::log.info "User & Pass set, authentification will be with user : $USER and pass : $PASS"
else
BOOLEAN=false
bashio::log.warning "User & Pass not set, no authentification required"
BOOLEAN=false
bashio::log.warning "User & Pass not set, no authentification required"
fi
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-authentication-required\"=${BOOLEAN}")
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-username\"=\"${USER}\"")
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-password\"=\"${PASS}\"")
echo "${CONFIG}" >"$CONFIGDIR"/settings.json &&
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json "$CONFIGDIR"/settings.json
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json "$CONFIGDIR"/settings.json
# WHITELIST
###########
@@ -113,13 +113,13 @@ jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json "$CONFIGDIR"
CONFIG=$(<"$CONFIGDIR"/settings.json)
WHITELIST=$(bashio::config 'whitelist')
if bashio::config.has_value 'whitelist'; then
BOOLEAN=true
bashio::log.info "Whitelist set, no authentification from IP $WHITELIST"
BOOLEAN=true
bashio::log.info "Whitelist set, no authentification from IP $WHITELIST"
else
BOOLEAN=false
sed -i "2 i\"rpc-whitelist-enabled\": false," "$CONFIGDIR"/settings.json
BOOLEAN=false
sed -i "2 i\"rpc-whitelist-enabled\": false," "$CONFIGDIR"/settings.json
fi
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-whitelist-enabled\"=${BOOLEAN}")
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-whitelist\"=\"$WHITELIST\"")
echo "${CONFIG}" >"$CONFIGDIR"/settings.json &&
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json "$CONFIGDIR"/settings.json
jq . -S "$CONFIGDIR"/settings.json | cat >temp.json && mv temp.json "$CONFIGDIR"/settings.json