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