forked from I2P_Developers/i2p.i2p
* i2psnark:
- Display torrent file downloads in torrent area - Sort magnets and downloads first - Fix sorting problem when torrent dir is a symlink - Reduce max file idle time - arrow_down icon copied from console css
This commit is contained in:
@@ -598,7 +598,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ot null ok, default is none
|
||||
* @param pt null ok, default is none
|
||||
* @since 0.9.1
|
||||
*/
|
||||
public void savePrivateTrackers(List<String> pt) {
|
||||
@@ -881,6 +881,29 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
_magnets.remove(snark.getName());
|
||||
removeMagnetStatus(snark.getInfoHash());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add and start a FetchAndAdd task.
|
||||
* Remove it with deleteMagnet().
|
||||
*
|
||||
* @param torrent must be instanceof FetchAndAdd
|
||||
* @throws RuntimeException via Snark.fatal()?
|
||||
* @since 0.9.1
|
||||
*/
|
||||
public void addDownloader(Snark torrent) {
|
||||
synchronized (_snarks) {
|
||||
Snark snark = getTorrentByInfoHash(torrent.getInfoHash());
|
||||
if (snark != null) {
|
||||
addMessage(_("Download already running: {0}", snark.getBaseName()));
|
||||
return;
|
||||
}
|
||||
String name = torrent.getName();
|
||||
// Tell the dir monitor not to delete us
|
||||
_magnets.add(name);
|
||||
_snarks.put(name, torrent);
|
||||
}
|
||||
torrent.startTorrent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a torrent from a MetaInfo. Save the MetaInfo data to filename.
|
||||
@@ -1399,7 +1422,7 @@ public class SnarkManager implements Snark.CompleteListener {
|
||||
byte[] ih = Base64.decode(b64);
|
||||
// ignore value - TODO put tracker URL in value
|
||||
if (ih != null && ih.length == 20)
|
||||
addMagnet("Magnet: " + I2PSnarkUtil.toHex(ih), ih, null, false);
|
||||
addMagnet("* " + _("Magnet") + ' ' + I2PSnarkUtil.toHex(ih), ih, null, false);
|
||||
// else remove from config?
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user