From f12b666cbb1658fb9b98abe59270ee18a9e67085 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 27 May 2026 20:13:52 -0500 Subject: [PATCH] Remove IsStreamIdenticalAsync CanSeek requirement Now only uses for the Length mismatch. --- src/Jellyfin.Extensions/StreamExtensions.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/Jellyfin.Extensions/StreamExtensions.cs b/src/Jellyfin.Extensions/StreamExtensions.cs index 56a66b885a..fb3fd2eac1 100644 --- a/src/Jellyfin.Extensions/StreamExtensions.cs +++ b/src/Jellyfin.Extensions/StreamExtensions.cs @@ -15,7 +15,7 @@ namespace Jellyfin.Extensions /// public static class StreamExtensions { - private const int StreamComparisonBufferSize = 65536; + private const int StreamComparisonBufferSize = 81920; /// /// Reads all lines in the . @@ -114,23 +114,12 @@ namespace Jellyfin.Extensions /// The second stream to compare. /// The token to monitor for cancellation requests. /// True if the streams are identical; otherwise false. - /// or does not support seeking. public static async Task IsStreamIdenticalAsync(this Stream a, Stream b, CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(a); ArgumentNullException.ThrowIfNull(b); - if (!a.CanSeek) - { - throw new ArgumentException("Stream must support seeking.", nameof(a)); - } - - if (!b.CanSeek) - { - throw new ArgumentException("Stream must support seeking.", nameof(b)); - } - - if (b.Length != a.Length) + if (a.CanSeek && b.CanSeek && b.Length != a.Length) { return false; }