DownloadManager dm = (DownloadManager) ci.torrents.get(number - 1);
String name = dm.getDisplayName();
if (name == null)
name = "?";
GlobalManager gm = dm.getGlobalManager();
if (moveto) {
gm.moveTo(dm, nmoveto - 1);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to #" + Integer.toString(nmoveto) + ".");
} else if (ncommand > 0) {
if (gm.isMoveableUp(dm)) {
while (gm.isMoveableUp(dm))
gm.moveUp(dm);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to top.");
} else {
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at top.");
}
} else {
if (gm.isMoveableDown(dm)) {
while (gm.isMoveableDown(dm))
gm.moveDown(dm);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to bottom.");
} else {
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at bottom.");
}
}