Switch to file-based debug logging in /tmp

This commit is contained in:
mani
2026-01-08 13:19:20 +01:00
parent 16e62d50f6
commit 28ef056686

View File

@@ -387,14 +387,20 @@ public static class StreamingHelpers
// Check if this is a progressive download (no segments) vs HLS streaming
var streamingRequest = state.BaseRequest as StreamingRequestDto;
// Debug: Log to console (should appear in docker logs)
Console.WriteLine($"=== TRANSCODE PATH DEBUG ===");
Console.WriteLine($"SegmentContainer: {streamingRequest?.SegmentContainer ?? "NULL"}");
Console.WriteLine($"TranscodingType: {state.TranscodingType}");
Console.WriteLine($"OutputContainer: {state.OutputContainer}");
Console.WriteLine($"Is SegmentContainer null? {streamingRequest?.SegmentContainer is null}");
Console.WriteLine($"Is TranscodingType Progressive? {state.TranscodingType == TranscodingJobType.Progressive}");
Console.WriteLine($"Condition result: {streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive}");
// Debug: Write to /tmp (always writable)
try
{
var debugLog = $@"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] === TRANSCODE PATH DEBUG ===
SegmentContainer: {streamingRequest?.SegmentContainer ?? "NULL"}
TranscodingType: {state.TranscodingType}
OutputContainer: {state.OutputContainer}
Is SegmentContainer null? {streamingRequest?.SegmentContainer is null}
Is TranscodingType Progressive? {state.TranscodingType == TranscodingJobType.Progressive}
Condition result: {streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive}
";
File.AppendAllText("/tmp/jellyfin-debug.log", debugLog);
}
catch { }
// Progressive download: full file download with no HLS segmentation
if (streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive)
@@ -403,13 +409,13 @@ public static class StreamingHelpers
var diskTranscodePath = Path.Combine(folder, "downloads");
Directory.CreateDirectory(diskTranscodePath);
folder = diskTranscodePath;
Console.WriteLine($"==> Using downloads folder: {diskTranscodePath}");
try { File.AppendAllText("/tmp/jellyfin-debug.log", $"==> Using downloads folder: {diskTranscodePath}\n"); } catch { }
}
else
{
Console.WriteLine($"==> Using standard folder: {folder}");
try { File.AppendAllText("/tmp/jellyfin-debug.log", $"==> Using standard folder: {folder}\n"); } catch { }
}
Console.WriteLine($"=== END DEBUG ===");
try { File.AppendAllText("/tmp/jellyfin-debug.log", "=== END DEBUG ===\n\n"); } catch { }
return Path.Combine(folder, filename + ext);
}