i2psnark: Tweak 1st column sort order

This commit is contained in:
zzz
2018-07-28 19:34:16 +00:00
parent b8437cd247
commit 9b9f96daf8
2 changed files with 5 additions and 4 deletions

View File

@ -479,7 +479,7 @@ public class I2PSnarkServlet extends BasicServlet {
String currentSort = req.getParameter("sort");
boolean showSort = total > 1;
out.write("<tr><th class=\"snarkGraphicStatus\">");
String sort = ("2".equals(currentSort)) ? "-2" : "2";
String sort = ("-2".equals(currentSort)) ? "2" : "-2";
if (showSort) {
out.write("<a href=\"" + _contextPath + '/' + getQueryString(req, null, null, sort));
out.write("\">");

View File

@ -128,6 +128,7 @@ class Sorters {
private static class TorrentNameComparator implements Comparator<Snark>, Serializable {
private final Pattern _p;
private static final Collator _c = Collator.getInstance();
/** @param lang may be null */
private TorrentNameComparator(String lang) {
@ -155,7 +156,7 @@ class Sorters {
if (m.matches())
rs = rs.substring(m.group(1).length());
}
return Collator.getInstance().compare(ls, rs);
return _c.compare(ls, rs);
}
}
@ -207,10 +208,10 @@ class Sorters {
long remaining = snark.getRemainingLength();
if (snark.isStopped()) {
if (remaining < 0)
return 0;
return 10;
if (remaining > 0)
return 5;
return 10;
return 0;
}
if (snark.isStarting())
return 15;