1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

fix: macOS watchdirs (#5058)

This commit is contained in:
Cœur 2023-02-26 12:50:30 +08:00 committed by GitHub
parent 47fd150bab
commit 8a374a3310
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3580,10 +3580,19 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
continue;
}
NSDictionary<NSFileAttributeKey, id>* fileAttributes = [NSFileManager.defaultManager attributesOfItemAtPath:fullFile
error:nil];
if (fileAttributes.fileSize == 0)
{
// Workaround for Firefox downloads happening in two steps: first time being an empty file
[self.fAutoImportedNames removeObject:file];
continue;
}
auto metainfo = tr_torrent_metainfo{};
if (!metainfo.parseTorrentFile(fullFile.UTF8String))
{
break;
continue;
}
[self openFiles:@[ fullFile ] addType:ADD_AUTO forcePath:nil];