diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index 44292044c2..5c1017d6ea 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -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); }