Message cleanup
This commit is contained in:
@ -533,9 +533,9 @@ public class SnarkManager implements Snark.CompleteListener {
|
|||||||
File f = new File(filename);
|
File f = new File(filename);
|
||||||
if (!dontAutoStart && shouldAutoStart()) {
|
if (!dontAutoStart && shouldAutoStart()) {
|
||||||
torrent.startTorrent();
|
torrent.startTorrent();
|
||||||
addMessage(_("Torrent added and started: \"{0}\"", f.getName()));
|
addMessage(_("Torrent added and started: \"{0}\"", torrent.storage.getBaseName()));
|
||||||
} else {
|
} else {
|
||||||
addMessage(_("Torrent added: \"{0}\"", f.getName()));
|
addMessage(_("Torrent added: \"{0}\"", torrent.storage.getBaseName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,8 +742,14 @@ public class SnarkManager implements Snark.CompleteListener {
|
|||||||
// I2PServerSocket.accept() call properly?)
|
// I2PServerSocket.accept() call properly?)
|
||||||
////_util.
|
////_util.
|
||||||
}
|
}
|
||||||
|
String name;
|
||||||
|
if (torrent.storage != null) {
|
||||||
|
name = torrent.storage.getBaseName();
|
||||||
|
} else {
|
||||||
|
name = sfile.getName();
|
||||||
|
}
|
||||||
if (!wasStopped)
|
if (!wasStopped)
|
||||||
addMessage(_("Torrent stopped: \"{0}\"", sfile.getName()));
|
addMessage(_("Torrent stopped: \"{0}\"", name));
|
||||||
}
|
}
|
||||||
return torrent;
|
return torrent;
|
||||||
}
|
}
|
||||||
@ -756,9 +762,14 @@ public class SnarkManager implements Snark.CompleteListener {
|
|||||||
if (torrent != null) {
|
if (torrent != null) {
|
||||||
File torrentFile = new File(filename);
|
File torrentFile = new File(filename);
|
||||||
torrentFile.delete();
|
torrentFile.delete();
|
||||||
if (torrent.storage != null)
|
String name;
|
||||||
|
if (torrent.storage != null) {
|
||||||
removeTorrentStatus(torrent.storage.getMetaInfo());
|
removeTorrentStatus(torrent.storage.getMetaInfo());
|
||||||
addMessage(_("Torrent removed: \"{0}\"", torrentFile.getName()));
|
name = torrent.storage.getBaseName();
|
||||||
|
} else {
|
||||||
|
name = torrentFile.getName();
|
||||||
|
}
|
||||||
|
addMessage(_("Torrent removed: \"{0}\"", name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,11 +438,12 @@ public class I2PSnarkServlet extends Default {
|
|||||||
if (torrent != null) {
|
if (torrent != null) {
|
||||||
byte infoHash[] = Base64.decode(torrent);
|
byte infoHash[] = Base64.decode(torrent);
|
||||||
if ( (infoHash != null) && (infoHash.length == 20) ) { // valid sha1
|
if ( (infoHash != null) && (infoHash.length == 20) ) { // valid sha1
|
||||||
for (Iterator iter = _manager.listTorrentFiles().iterator(); iter.hasNext(); ) {
|
for (String name : _manager.listTorrentFiles()) {
|
||||||
String name = (String)iter.next();
|
|
||||||
Snark snark = _manager.getTorrent(name);
|
Snark snark = _manager.getTorrent(name);
|
||||||
if ( (snark != null) && (DataHelper.eq(infoHash, snark.meta.getInfoHash())) ) {
|
if ( (snark != null) && (DataHelper.eq(infoHash, snark.meta.getInfoHash())) ) {
|
||||||
snark.startTorrent();
|
snark.startTorrent();
|
||||||
|
if (snark.storage != null)
|
||||||
|
name = snark.storage.getBaseName();
|
||||||
_manager.addMessage(_("Starting up torrent {0}", name));
|
_manager.addMessage(_("Starting up torrent {0}", name));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user