// only track if torrent's tracker is not available
if ( is_active ){
DownloadAnnounceResult result = download.getLastAnnounceResult();
if ( result == null ||
result.getResponseType() == DownloadAnnounceResult.RT_ERROR ||
TorrentUtils.isDecentralised(result.getURL())){
register_type = REG_TYPE_FULL;
register_reason = "tracker unavailable (announce)";
}else{
register_reason = "tracker available (announce: " + result.getURL() + ")";
}
}else{
DownloadScrapeResult result = download.getLastScrapeResult();
if ( result == null ||
result.getResponseType() == DownloadScrapeResult.RT_ERROR ||
TorrentUtils.isDecentralised(result.getURL())){
register_type = REG_TYPE_FULL;
register_reason = "tracker unavailable (scrape)";
}else{
register_reason = "tracker available (scrape: " + result.getURL() + ")";
}
}
if ( register_type != REG_TYPE_FULL && track_limited_when_online.getValue()){
Boolean existing = (Boolean)limited_online_tracking.get( download );
boolean track_it = false;
if ( existing != null ){
track_it = existing.booleanValue();
}else{
DownloadScrapeResult result = download.getLastScrapeResult();
if ( result != null&&
result.getResponseType() == DownloadScrapeResult.RT_SUCCESS ){
int seeds = result.getSeedCount();
int leechers = result.getNonSeedCount();
int swarm_size = seeds + leechers;
if ( swarm_size <= LIMITED_TRACK_SIZE ){