From 2e3ff679f304c469bbdb41a912630af973ccfa28 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Tue, 7 Jul 2020 13:22:44 +0000
Subject: [PATCH] i2psnark: Change ETA default sort order (ticket #2733) add
 markdown mime type

---
 .../i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java | 3 ++-
 apps/i2psnark/mime.properties                                  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
index ba5e69bbe2..a06470abd9 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
@@ -564,7 +564,7 @@ public class I2PSnarkServlet extends BasicServlet {
         out.write("</th>\n<th class=\"snarkTorrentETA\" align=\"right\">");
         if (_manager.util().connected() && !snarks.isEmpty()) {
             if (showSort) {
-                sort = ("-4".equals(currentSort)) ? "4" : "-4";
+                sort = ("4".equals(currentSort)) ? "-4" : "4";
                 out.write("<a href=\"" + _contextPath + '/' + getQueryString(req, null, null, sort));
                 out.write("\">");
             }
@@ -4141,6 +4141,7 @@ public class I2PSnarkServlet extends BasicServlet {
         if (mime.equals("text/html"))
             icon = "html";
         else if (mime.equals("text/plain") ||
+                 mime.equals("text/markdown") ||
                  mime.equals("text/x-sfv") ||
                  mime.equals("application/rtf"))
             icon = "page";
diff --git a/apps/i2psnark/mime.properties b/apps/i2psnark/mime.properties
index f6d7342420..ae90c648e7 100644
--- a/apps/i2psnark/mime.properties
+++ b/apps/i2psnark/mime.properties
@@ -16,6 +16,7 @@ m3u8	= audio/mpegurl
 m4a	= audio/mp4a-latm
 m4b	= audio/mp4a-latm
 m4v	= video/x-m4v
+md	= text/markdown
 mka	= audio/x-matroska
 mkv	= video/x-matroska
 mobi	= application/x-mobipocket-ebook
-- 
GitLab