if (torrent == null) {
return false;
}
try {
DownloadManagerEnhancer enhancer = DownloadManagerEnhancer.getSingleton();
EnhancedDownloadManager edm = DownloadManagerEnhancer.getSingleton().getEnhancedDownload(
torrent.getHash());
if (edm == null) {
return enhancer.isProgressiveAvailable()
&& PlatformTorrentUtils.isContentProgressive(torrent);
}
boolean complete = edm.getDownloadManager().isDownloadComplete(false);
if (complete) {
return true;
}
// not complete
if (!edm.supportsProgressiveMode()) {
return false;
}
} catch (TOTorrentException e) {
return false;
}