aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Brooks <IDisposable@gmail.com>2026-05-27 20:13:52 -0500
committerMarc Brooks <IDisposable@gmail.com>2026-05-27 20:13:52 -0500
commitf12b666cbb1658fb9b98abe59270ee18a9e67085 (patch)
tree2df0b3cbce872b146ec0ed48408b33887ec2e09e
parentaa2370e0212333d93ee250e9f2236f9d5bcb3d93 (diff)
Remove IsStreamIdenticalAsync CanSeek requirement
Now only uses for the Length mismatch.
-rw-r--r--src/Jellyfin.Extensions/StreamExtensions.cs15
1 files 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
/// </summary>
public static class StreamExtensions
{
- private const int StreamComparisonBufferSize = 65536;
+ private const int StreamComparisonBufferSize = 81920;
/// <summary>
/// Reads all lines in the <see cref="Stream" />.
@@ -114,23 +114,12 @@ namespace Jellyfin.Extensions
/// <param name="b">The second stream to compare.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
/// <returns>True if the streams are identical; otherwise false.</returns>
- /// <exception cref="ArgumentException"><paramref name="a"/> or <paramref name="b"/> does not support seeking.</exception>
public static async Task<bool> 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;
}