transcode manager now handles multiple media servers

This commit is contained in:
2026-04-20 18:17:13 -04:00
parent e83473ab8e
commit 1a16ca02a9
5 changed files with 255 additions and 69 deletions
+36 -2
View File
@@ -21,12 +21,45 @@
# v1.5 — Full icon set expanded — each operation and state has its own distinct icon
# All function output updated to use correct icon per context
# Icons grouped and commented by category for clarity
# v1.6 — ICON_CONTAINERS added — 📦 anchors all container sections for visual consistency
# ICON_NOT_RUNNING changed to ⭕ — distinct from ICON_STOPPED 🔴
# Section dividers updated from --- to ━━━ for cleaner log readability
# Summary passed/failed lines use ICON_SUCCESS and ICON_ERROR consistently
# v1.7 — ICON_MOVER added for mover operations
# ICON_CONTAINERS replaces ICON_DOCKER for docker/container operations
# validate_int added — reusable integer validation for any script
# v1.8 — ICON_PHP added for PHP-FPM operations
# v1.9 — ICON_REBOOT added for server reboot operations
# v2.0 — ICON_PLUGIN added for User Scripts plugin operations
# v2.1 — ICON_ZFS and ICON_MEM added for ZFS and memory diagnostics
# Diagnostics icon group added to icon block
# v2.2 — ICON_WATCHDOG added for Docker watchdog monitoring operations
# v2.3 — ICON_NOTIFY added for notification operations
# notify() added — shared notification function supporting unRAID native and Discord
# NOTIFY_UNRAID and DISCORD_WEBHOOK configured in Master.conf
# v2.4 — ICON_CLEAN, ICON_TRASH added for media cleaner operations
# ICON_PERMS, ICON_UNLOCKED added for media permissions operations
# ICON_REBOOT_SMART added for smart conditional reboot
# v2.5 — ICON_RAM added for ramdisk operations
# ICON_LINK added for symlink state and management
# Transcode scripts group added to ecosystem
# v2.6 — ICON_FAILOVER added for failover operations
# check_local_array added — verifies local /mnt/user is mounted and healthy
# check_remote_array added — verifies remote /mnt/user is mounted and healthy
# check_remote_docker added — verifies remote Docker daemon is responding
# ping_remote added — non-fatal ping returning status for failover use
# ping_internet added — non-fatal external ping for failover use
# v2.7 — ICON_WEBGUI added for WebGUI watchdog operations
# ICON_DOCKER_NET added for Docker network connect operations
# v2.8 — ICON_CERT added for SSL certificate monitoring operations
# v2.9 — ICON_MONITOR added for monitoring section headers
# v3.0 — Script locking system added — prevents concurrent execution conflicts
# acquire_lock() — create PID lock file, register EXIT trap
# release_lock() — remove lock file on exit
# acquire_rsync_lock() — per-profile lock + global concurrent limit
# release_rsync_lock() — decrement global counter, remove profile lock
# check_api() — pre-flight API reachability check
# ICON_LOCK added — 🔏 script instance lock acquired/released
# ICON_SMART added for drive SMART health operations
# ICON_BANDWIDTH added for bandwidth tracking operations
# ICON_DIGEST added for health digest operations
@@ -89,6 +122,7 @@ ICON_CLEAN="🧹" # media cleaner operations
ICON_TRASH="🗑️" # files being deleted
ICON_PERMS="🔐" # permissions operation / section header
ICON_UNLOCKED="🔓" # permissions successfully applied to a share
ICON_LOCK="🔏" # script instance lock — acquired/released
# Transcode Operations
ICON_RAM="💨" # ramdisk operations — fast ephemeral storage
@@ -660,7 +694,7 @@ acquire_lock() {
# Register EXIT trap to always release lock
trap "_release_on_exit '$lockfile'" EXIT
log "Lock acquired: $script_name (PID $$)"
log "$ICON_LOCK Lock acquired: $script_name (PID $$)"
}
# -----------------------------------------------------------------------------------------------
@@ -719,7 +753,7 @@ acquire_rsync_lock() {
# Register EXIT trap
trap "_release_rsync_on_exit '$profile_lock'" EXIT
log "rsync lock acquired: profile '$profile' (PID $$, active: $(( current_count + 1 ))/$RSYNC_MAX_CONCURRENT)"
log "$ICON_LOCK rsync lock acquired: profile '$profile' (PID $$, active: $(( current_count + 1 ))/$RSYNC_MAX_CONCURRENT)"
}
# Internal — release rsync lock on exit