1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

fixes "no data found..." error on restart for paused torrents (#2797)

Co-authored-by: SweetPPro <sweetppro@users.noreply.github.com>
This commit is contained in:
SweetPPro 2022-03-21 22:15:53 +01:00 committed by GitHub
parent 03ee0028d4
commit 6e1b89d9a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -771,9 +771,12 @@ static void torrentInit(tr_torrent* tor, tr_ctor const* ctor)
auto has_local_data = std::optional<bool>{};
if ((loaded & tr_resume::Progress) != 0)
{
// if tr_resume::load() populated checked_pieces_, initCheckedPieces()
// already looked for local data on the filesystem
has_local_data = !tor->checked_pieces_.hasNone();
// if tr_resume::load() loaded progress info, then initCheckedPieces()
// has already looked for local data on the filesystem
has_local_data = std::any_of(
std::begin(tor->file_mtimes_),
std::end(tor->file_mtimes_),
[](auto mtime) { return mtime > 0; });
}
// if we don't have a local .torrent or .magnet file already, assume the torrent is new