Fix tr_torrent_view incorrectly returning is_folder false for single files in a single folder (#4454)

This commit is contained in:
Cœur 2022-12-24 03:52:16 +08:00 committed by GitHub
parent 3cee8bae36
commit 559b759ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1153,7 +1153,7 @@ tr_torrent_view tr_torrentView(tr_torrent const* tor)
ret.piece_size = tor->pieceSize();
ret.n_pieces = tor->pieceCount();
ret.is_private = tor->isPrivate();
ret.is_folder = tor->fileCount() > 1;
ret.is_folder = tor->fileCount() > 1 || (tor->fileCount() == 1 && tr_strvContains(tor->fileSubpath(0), '/'));
return ret;
}