From 9b2cc5caae0b93ca9158d7e0f9e10e46813f6f62 Mon Sep 17 00:00:00 2001
From: Aaron van Geffen <aaron@aaronweb.net>
Date: Tue, 15 Nov 2016 00:05:40 +0100
Subject: [PATCH] Properly fix prev/next in set.

---
 models/Asset.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/models/Asset.php b/models/Asset.php
index f1ddec6..5f061b1 100644
--- a/models/Asset.php
+++ b/models/Asset.php
@@ -515,12 +515,12 @@ class Asset
 			INNER JOIN assets AS a ON a.id_asset = t.id_asset
 			WHERE t.id_tag = {int:id_tag} AND
 				a.date_captured <= {datetime:date_captured} AND
-				a.id_asset != {int:id_asset}
+				a.id_asset <= {int:id_asset}
 			ORDER BY a.date_captured DESC'
 			: '
 			FROM assets AS a
 			WHERE date_captured >= {datetime:date_captured} AND
-				a.id_asset != {int:id_asset}
+				a.id_asset >= {int:id_asset}
 			ORDER BY date_captured ASC')
 			 . '
 			LIMIT 1',