Skip to content

Commit

Permalink
听兔子的话
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
paulzzh and coderabbitai[bot] authored Nov 20, 2024
1 parent 12377d4 commit cbdc428
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,25 @@ protected void fillTorrentProperties(List<QBittorrentTorrent> qbTorrent) {
try {
torrentPropertiesLimit.acquire();
TorrentProperties properties = getTorrentProperties(detail);
if (properties == null) {
log.warn("Failed to retrieve properties for torrent: {}", detail.getHash());
return;
}
if (detail.getCompleted() != properties.completed) {
// completed value changed, invalidate cache and fetch again.
torrentPropertiesCache.invalidate(detail.getHash());
properties = getTorrentProperties(detail);
if (properties == null) {
log.warn("Failed to retrieve properties after cache invalidation for torrent: {}", detail.getHash());
return;
}
}
if (config.isIgnorePrivate() && detail.getPrivateTorrent() == null) {
log.debug("Field is_private is not present, query from properties api, hash: {}", detail.getHash());
log.debug("Field is_private is not present, querying from properties API, hash: {}", detail.getHash());
detail.setPrivateTorrent(properties.isPrivate);
}
if (detail.getPieceSize() <= 0 || detail.getPiecesHave() <= 0) {
log.debug("Field piece_size,pieces_have is not present, query from properties api, hash: {}", detail.getHash());
log.debug("Field piece_size or pieces_have is not present, querying from properties API, hash: {}", detail.getHash());
detail.setPieceSize(properties.pieceSize);
detail.setPiecesHave(properties.piecesHave);
}
Expand Down

0 comments on commit cbdc428

Please sign in to comment.