From f37b8d9bf550138f9a276f05a79cc495db28934c Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Mon, 14 Oct 2024 20:43:18 +0800 Subject: [PATCH] fixup! fix: update partial file suffix after verifying torrent (#6871) (#7072) --- libtransmission/torrent.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index 40039686a..d6e50fe1b 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -328,7 +328,8 @@ struct tr_torrent [[nodiscard]] auto has_file(tr_file_index_t file) const { - return completion_.has_blocks(block_span_for_file(file)); + auto const span = byte_span_for_file(file); + return completion_.count_has_bytes_in_span(span) == span.end - span.begin; } [[nodiscard]] auto has_piece(tr_piece_index_t piece) const @@ -1224,7 +1225,7 @@ private: // must be called after the torrent's announce list changes. void on_announce_list_changed(); - [[nodiscard]] TR_CONSTEXPR20 auto byte_span_for_file(tr_file_index_t file) const + [[nodiscard]] TR_CONSTEXPR20 tr_byte_span_t byte_span_for_file(tr_file_index_t file) const { return fpm_.byte_span_for_file(file); }