Fixes for Livestreams
This commit is contained in:
@@ -292,9 +292,23 @@ public class StreamProxyController : ControllerBase
|
||||
_logger.LogDebug("Streamed segment {SegmentPath} ({ContentType})", segmentPath, contentType);
|
||||
return new EmptyResult();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Client disconnected during streaming (e.g., FFmpeg stopped, player seeked).
|
||||
// This is expected behavior, not an error.
|
||||
_logger.LogDebug("Segment streaming canceled - ItemId: {ItemId}, Path: {SegmentPath}", itemId, segmentPath);
|
||||
return new EmptyResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error proxying segment - ItemId: {ItemId}, Path: {SegmentPath}", itemId, segmentPath);
|
||||
|
||||
// If we already started streaming data to the client, we can't change the status code
|
||||
if (Response.HasStarted)
|
||||
{
|
||||
return new EmptyResult();
|
||||
}
|
||||
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user