fixed in the way transcode is set up, all scripts in that folder adjusted

This commit is contained in:
2026-04-19 12:36:44 -04:00
parent 69a82ce1b9
commit bb709b2762
3 changed files with 54 additions and 2 deletions
+32
View File
@@ -176,6 +176,38 @@ else
fi fi
fi fi
# -----------------------------------------------------------------------------------------------
# ━━━ $ICON_GEAR Transcoding-temp Directory ━━━
# Creates the transcoding-temp folder on the ramdisk proactively.
# If this folder doesn't exist on the ramdisk Emby creates it wherever it finds
# a writable path first — which may be the SSD fallback — locking all sessions
# onto SSD even when the symlink points at the ramdisk.
# Creating it here guarantees Emby always finds it on the ramdisk at session start.
# -----------------------------------------------------------------------------------------------
echo ""
echo "━━━ $ICON_GEAR Transcoding Temp Directory ━━━"
TRANSCODE_TEMP_DIR="${RAMDISK_PATH}/transcoding-temp"
if [[ "$DRY_RUN" == true ]]; then
warn "DRY RUN — would create $TRANSCODE_TEMP_DIR"
else
if [[ -d "$TRANSCODE_TEMP_DIR" ]]; then
info "transcoding-temp already exists on ramdisk"
else
mkdir -p "$TRANSCODE_TEMP_DIR" && \
success "Created transcoding-temp on ramdisk: $TRANSCODE_TEMP_DIR" || \
{ error "Failed to create transcoding-temp on ramdisk"; SETUP_SUCCESS=false; }
fi
# Apply correct permissions so Emby (abc/nobody:users) can write to it
if [[ -d "$TRANSCODE_TEMP_DIR" ]]; then
chmod "$TRANSCODE_CHMOD" "$TRANSCODE_TEMP_DIR"
chown "$TRANSCODE_OWNER" "$TRANSCODE_TEMP_DIR"
success "Permissions set on transcoding-temp"
fi
fi
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
# ━━━ $ICON_GEAR Permissions ━━━ # ━━━ $ICON_GEAR Permissions ━━━
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
+5 -2
View File
@@ -131,9 +131,12 @@ cleanup_location() {
done < <(find "$location" -type f -mmin +"$max_age" 2>/dev/null) done < <(find "$location" -type f -mmin +"$max_age" 2>/dev/null)
# Remove empty directories left behind # Remove empty directories left behind — but NEVER remove transcoding-temp itself
# transcoding-temp must always exist on the ramdisk so Emby finds it there first
# If deleted Emby falls back to the SSD version and all new sessions land on SSD
if [[ "$DRY_RUN" == false ]]; then if [[ "$DRY_RUN" == false ]]; then
find "$location" -mindepth 1 -type d -empty -delete 2>/dev/null find "$location" -mindepth 1 -type d -empty \
! -name "transcoding-temp" -delete 2>/dev/null
fi fi
# Format bytes freed for display # Format bytes freed for display
+17
View File
@@ -252,6 +252,23 @@ else
RAMDISK_SIZE_ACTUAL=$(df "$RAMDISK_PATH" --output=size -h | tail -1 | tr -d ' ') RAMDISK_SIZE_ACTUAL=$(df "$RAMDISK_PATH" --output=size -h | tail -1 | tr -d ' ')
success "$ICON_RAM Ramdisk mounted — size: $RAMDISK_SIZE_ACTUAL" success "$ICON_RAM Ramdisk mounted — size: $RAMDISK_SIZE_ACTUAL"
fix_permissions "$RAMDISK_PATH" fix_permissions "$RAMDISK_PATH"
# Guarantee transcoding-temp exists on ramdisk
# If missing Emby creates it wherever it finds a writable path first —
# which may be the SSD fallback — locking all new sessions onto SSD
# even when the symlink correctly points at the ramdisk.
TRANSCODE_TEMP_RAM="${RAMDISK_PATH}/transcoding-temp"
TRANSCODE_TEMP_SSD="${TRANSCODE_SSD}/transcoding-temp"
if [[ ! -d "$TRANSCODE_TEMP_RAM" ]]; then
warn "transcoding-temp missing from ramdisk — creating now"
mkdir -p "$TRANSCODE_TEMP_RAM"
chmod "$TRANSCODE_CHMOD" "$TRANSCODE_TEMP_RAM"
chown "$TRANSCODE_OWNER" "$TRANSCODE_TEMP_RAM"
success "transcoding-temp created on ramdisk — new sessions will use ramdisk"
else
log "transcoding-temp exists on ramdisk — ok"
fi
fi fi
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------