From c8217ca1922d7d3eb7cd2e17190ecc74833dd6f3 Mon Sep 17 00:00:00 2001 From: mani Date: Thu, 8 Jan 2026 13:37:00 +0100 Subject: [PATCH] Use Console.Error for debug output (appears in docker logs) --- Jellyfin.Api/Helpers/StreamingHelpers.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index 2d1fa16230..d8bfe8cd94 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -391,13 +391,14 @@ public static class StreamingHelpers // Check if this is a progressive download (no segments) vs HLS streaming var streamingRequest = state.BaseRequest as StreamingRequestDto; - // Always write to file for debugging (logger might be null or not passed) - try - { - var debugMsg = $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] GetOutputFilePath called - SegmentContainer={streamingRequest?.SegmentContainer ?? "NULL"}, TranscodingType={state.TranscodingType}, OutputContainer={state.OutputContainer}, IsSegmentContainerNull={streamingRequest?.SegmentContainer is null}, IsProgressive={state.TranscodingType == TranscodingJobType.Progressive}, ConditionResult={streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive}\n"; - File.AppendAllText("/tmp/jellyfin-transcode-debug.log", debugMsg); - } - catch { } + // Debug output to stderr (appears in docker logs) + Console.Error.WriteLine($"=== TRANSCODE PATH DEBUG ==="); + Console.Error.WriteLine($"SegmentContainer: {streamingRequest?.SegmentContainer ?? "NULL"}"); + Console.Error.WriteLine($"TranscodingType: {state.TranscodingType}"); + Console.Error.WriteLine($"OutputContainer: {state.OutputContainer}"); + Console.Error.WriteLine($"IsSegmentContainerNull: {streamingRequest?.SegmentContainer is null}"); + Console.Error.WriteLine($"IsProgressive: {state.TranscodingType == TranscodingJobType.Progressive}"); + Console.Error.WriteLine($"ConditionResult: {streamingRequest?.SegmentContainer is null && state.TranscodingType == TranscodingJobType.Progressive}"); logger?.LogInformation( "GetOutputFilePath: SegmentContainer={SegmentContainer}, TranscodingType={TranscodingType}, OutputContainer={OutputContainer}", @@ -412,14 +413,15 @@ public static class StreamingHelpers var diskTranscodePath = Path.Combine(folder, "downloads"); Directory.CreateDirectory(diskTranscodePath); folder = diskTranscodePath; - try { File.AppendAllText("/tmp/jellyfin-transcode-debug.log", $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using downloads folder: {diskTranscodePath}\n"); } catch { } + Console.Error.WriteLine($"==> Using downloads folder: {diskTranscodePath}"); logger?.LogInformation("Using downloads folder: {Path}", diskTranscodePath); } else { - try { File.AppendAllText("/tmp/jellyfin-transcode-debug.log", $"[{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}] Using standard folder: {folder}\n"); } catch { } + Console.Error.WriteLine($"==> Using standard folder: {folder}"); logger?.LogInformation("Using standard transcode folder: {Path}", folder); } + Console.Error.WriteLine($"=== END DEBUG ==="); return Path.Combine(folder, filename + ext); }