Usenet streaming with a WebDAV server and a SABnzbd-compatible API
C#
Fixed `Cannot find byte position` bug.
nzbdav-dev23d85410f40f
diff --git a/backend/Streams/NzbFileStream.cs b/backend/Streams/NzbFileStream.csindex cda37a50..91f016ef 100644--- a/backend/Streams/NzbFileStream.cs+++ b/backend/Streams/NzbFileStream.cs@@ -33,8 +33,8 @@ public class NzbFileStream(public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default){- if (_innerStream == null)- _innerStream = await GetFileStream(_position, cancellationToken).ConfigureAwait(false);+ if (_position >= fileSize) return 0;+ _innerStream ??= await GetFileStream(_position, cancellationToken).ConfigureAwait(false);var read = await _innerStream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);_position += read;return read;