don't show newest if current video is newest. same for oldest

This commit is contained in:
jkhsjdhjs 2016-08-17 23:32:21 +02:00
parent 96fb99d16b
commit 8f876d97e5
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
<h1>404 - Not f0cked</h1>
{% endif %}
</div>
<div class="controls">{% if last != null %}<a id="last" href="/{{ last }}"><- newest</a>{% endif %}{% if next != null %}<a id="next" href="/{{ next }}"><<-</a> | {% endif %} <a id="random" href="/random" title="Random">random</a> {% if prev != null %} | <a id="prev" href="/{{ prev }}">->></a>{% endif %}{% if first != null %}<a id="first" href="/{{ first }}">oldest -></a>{% endif %}</div><br />
<div class="controls">{% if last != null %}<a id="last" href="/{{ last }}"><- newest</a>{% endif %} {% if next != null %}<a id="next" href="/{{ next }}"><<-</a> | {% endif %} <a id="random" href="/random" title="Random">random</a> {% if prev != null %} | <a id="prev" href="/{{ prev }}">->></a>{% endif %} {% if first != null %}<a id="first" href="/{{ first }}">oldest -></a>{% endif %}</div><br />
<div class="info">
<span class="src">src: <a href="{{ src }}" target="_blank">{{ src }}</a></span><br />
<span class="dest">dest: {{ dest }}</span><br />

View File

@ -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' });