From 3614a90ae3da4d3f258286c999aa3a52880c67a2 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Thu, 6 Sep 2018 20:01:09 -0700 Subject: [PATCH] Adding debug info Signed-off-by: James Ketrenos --- server/routes/photos.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/routes/photos.js b/server/routes/photos.js index 5447b46..e04530a 100755 --- a/server/routes/photos.js +++ b/server/routes/photos.js @@ -55,11 +55,15 @@ router.get("/*", function(req, res/*, next*/) { } } - let query = "SELECT * FROM photos WHERE path LIKE :path " + index + " ORDER BY taken " + order + ",id " + order + " LIMIT " + (limit * 2 + 1); + let path = decodeURI(req.url).replace(/\?.*$/, ""), + query = "SELECT * FROM photos WHERE path LIKE :path " + index + " ORDER BY taken " + order + ",id " + order + " LIMIT " + (limit * 2 + 1); + + console.log("Fetching from: " + path); + return photoDB.sequelize.query(query, { replacements: { cursor: cursor, - path: decodeURI(req.url).replace(/\?.*$/, "") + "%" + path: path + "%" }, type: photoDB.Sequelize.QueryTypes.SELECT }).then(function(photos) {