play_state_sync: fix jq combine fallback + detect_hosts; load_config: fix word-split on paths with spaces

play_state_sync.sh:
- Add detect_hosts() call so TRANSCODE_SERVERS alias is populated
- Switch MEDIA_SERVERS → TRANSCODE_SERVERS (correct array name from host*.conf)
- Fix malformed jq fallback in combine step (was {"} now handled with if/else)
- Skip placeholder API keys in _add_server

load_config.sh:
- Replace 'for x in $(ls glob)' with 'while read < <(printf glob | sort)'
  so paths with spaces (e.g. dev workspace) don't get word-split
This commit is contained in:
Gmer4Lfe
2026-05-30 00:13:26 -04:00
parent 26693fd11f
commit 23062acdac
2 changed files with 28 additions and 22 deletions
+8 -8
View File
@@ -70,14 +70,14 @@
# At least one host conf must be present or the ecosystem has no identity to work with.
_host_confs_loaded=0
for _conf in $(ls "$LOAD_CONFIG_DIR/Configurations"/host*.conf 2>/dev/null | sort); do
if [[ -f "$_conf" ]]; then
source "$_conf"
(( _host_confs_loaded++ ))
[[ "${ENABLE_LOGGING:-false}" == "true" ]] && \
echo "[LOG] Loaded host config: $(basename "$_conf")" >&2
fi
done
# Use a sorted array glob — avoids word-splitting on paths with spaces
while IFS= read -r _conf; do
[[ -f "$_conf" ]] || continue
source "$_conf"
(( _host_confs_loaded++ ))
[[ "${ENABLE_LOGGING:-false}" == "true" ]] && \
echo "[LOG] Loaded host config: $(basename "$_conf")" >&2
done < <(printf '%s\n' "$LOAD_CONFIG_DIR/Configurations"/host*.conf 2>/dev/null | sort)
if [[ "$_host_confs_loaded" -eq 0 ]]; then
echo "[FATAL] No host*.conf files found in $LOAD_CONFIG_DIR" >&2