From 8f876d97e5c4e08f7811ccd40e3772ca53ac7b0a Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Wed, 17 Aug 2016 23:32:21 +0200 Subject: [PATCH] don't show newest if current video is newest. same for oldest --- s/item.tpl.html | 2 +- src/main.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/s/item.tpl.html b/s/item.tpl.html index b8e4032..3db7e0a 100644 --- a/s/item.tpl.html +++ b/s/item.tpl.html @@ -19,7 +19,7 @@

404 - Not f0cked

{% endif %} -
{% if last != null %}<- newest{% endif %}{% if next != null %} | {% endif %} random {% if prev != null %} | {% endif %}{% if first != null %}oldest ->{% endif %}

+
{% if last != null %}<- newest{% endif %} {% if next != null %} | {% endif %} random {% if prev != null %} | {% endif %} {% if first != null %}oldest ->{% endif %}

src: {{ src }}
dest: {{ dest }}
diff --git a/src/main.js b/src/main.js index b2dcb42..750e781 100644 --- a/src/main.js +++ b/src/main.js @@ -266,9 +266,9 @@ http.createServer((req, res) => { data.next = rows[1][0].id; if(rows[2].length) data.prev = rows[2][0].id; - if(rows[3].length) + if(rows[3].length && data.id != rows[3][0].id) data.first = rows[3][0].id; - if(rows[4].length) + if(rows[4].length && data.id != rows[4][0].id) data.last = rows[4][0].id; } res.writeHead(200, { 'Content-Type': 'text/html' });