Try multiple log paths for debug output

- Tries /config/log/, /tmp/, /cache/ for streaming-debug.log
- Ensures we can write debug output somewhere
- Fixes syntax error (extra brace)
This commit is contained in:
mani
2026-01-08 03:16:08 +01:00
parent 9807e960f1
commit 8f90a2cf88

View File

@@ -387,9 +387,12 @@ public static class StreamingHelpers
// Check if this is a progressive download (no segments) vs HLS streaming
var streamingRequest = state.BaseRequest as StreamingRequestDto;
// Debug: write to file
// Debug: write to file (try multiple locations)
var debugInfo = $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] SegmentContainer={(streamingRequest?.SegmentContainer ?? "NULL")}, TranscodingType={state.TranscodingType}, Container={state.OutputContainer}\n";
try { System.IO.File.AppendAllText("/config/log/streaming-debug.log", debugInfo); } catch { }
foreach (var logPath in new[] { "/config/log/streaming-debug.log", "/tmp/streaming-debug.log", "/cache/streaming-debug.log" })
{
try { System.IO.File.AppendAllText(logPath, debugInfo); break; } catch { }
}
// Progressive download: full file download with no HLS segmentation
if (streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive)
@@ -398,11 +401,17 @@ public static class StreamingHelpers
var diskTranscodePath = Path.Combine(folder, "downloads");
Directory.CreateDirectory(diskTranscodePath);
folder = diskTranscodePath;
try { System.IO.File.AppendAllText("/config/log/streaming-debug.log", $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using downloads folder: {diskTranscodePath}\n"); } catch { }
foreach (var logPath in new[] { "/config/log/streaming-debug.log", "/tmp/streaming-debug.log", "/cache/streaming-debug.log" })
{
try { System.IO.File.AppendAllText(logPath, $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using downloads folder: {diskTranscodePath}\n"); break; } catch { }
}
}
else
{
try { System.IO.File.AppendAllText("/config/log/streaming-debug.log", $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using standard folder: {folder}\n"); } catch { }
foreach (var logPath in new[] { "/config/log/streaming-debug.log", "/tmp/streaming-debug.log", "/cache/streaming-debug.log" })
{
try { System.IO.File.AppendAllText(logPath, $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using standard folder: {folder}\n"); break; } catch { }
}
}
return Path.Combine(folder, filename + ext);