forked from I2P_Developers/i2p.i2p
* i2psnark: Start torrents by default (ticket #1072)
This commit is contained in:
@ -1018,7 +1018,8 @@ public class SnarkManager implements CompleteListener {
|
||||
* @since 0.8.4
|
||||
*/
|
||||
public void addMagnet(String name, byte[] ih, String trackerURL, boolean updateStatus) {
|
||||
addMagnet(name, ih, trackerURL, updateStatus, shouldAutoStart(), this);
|
||||
// updateStatus is true from UI, false from config file bulk add
|
||||
addMagnet(name, ih, trackerURL, updateStatus, updateStatus, this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,8 +160,8 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl
|
||||
return;
|
||||
}
|
||||
|
||||
name = Storage.filterName(name);
|
||||
name = name + ".torrent";
|
||||
String originalName = Storage.filterName(name);
|
||||
name = originalName + ".torrent";
|
||||
File torrentFile = new File(_mgr.getDataDir(), name);
|
||||
|
||||
String canonical = torrentFile.getCanonicalPath();
|
||||
@ -174,6 +174,8 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl
|
||||
} else {
|
||||
// This may take a LONG time to create the storage.
|
||||
_mgr.copyAndAddTorrent(file, canonical);
|
||||
snark = _mgr.getTorrentByBaseName(originalName);
|
||||
snark.startTorrent();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
_mgr.addMessage(_("Torrent at {0} was not valid", urlify(_url)) + ": " + ioe.getMessage());
|
||||
|
Reference in New Issue
Block a user