if ( !download.isPersistent()){
continue;
}
Torrent torrent = download.getTorrent();
if ( torrent == null ){
continue;
}
byte[] hash = torrent.getHash();
if ( download_info_map.containsKey( hash )){
continue;
}
String[] networks = download.getListAttribute( ta_networks );
if ( networks == null ){
continue;
}
boolean public_net = false;
for (int i=0;i<networks.length;i++){
if ( networks[i].equalsIgnoreCase( "Public" )){
public_net = true;
break;
}
}
TOTorrent to_torrent = PluginCoreUtils.unwrap( torrent );
if ( public_net && !TorrentUtils.isReallyPrivate( to_torrent )){
DownloadManagerState state = PluginCoreUtils.unwrap( download ).getDownloadState();
if ( state.getFlag(DownloadManagerState.FLAG_LOW_NOISE )){
continue;
}
long rand = global_random_id ^ state.getLongParameter( DownloadManagerState.PARAM_RANDOM_SEED );
long cache = state.getLongAttribute( DownloadManagerState.AT_SCRAPE_CACHE );
int seeds_leechers;
if ( cache == -1 ){
seeds_leechers = -1;
}else{
int seeds = (int)((cache>>32)&0x00ffffff);
int leechers = (int)(cache&0x00ffffff);
seeds_leechers = (int)((seeds<<16)|(leechers&0xffff));
}
DownloadInfo info =
new DownloadInfo(
hash,
hash,
download.getName(),
(int)rand,
torrent.isPrivate()?StringInterner.intern(torrent.getAnnounceURL().getHost()):null,
0,
false,
torrent.getSize(),
(int)( to_torrent.getCreationDate()/(60*60)),
seeds_leechers,
(byte)PlatformTorrentUtils.getContentNetworkID( to_torrent ));
new_info.add( info );