Checking to see if memories is returning replicated entries

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-09-12 15:27:16 -07:00
parent 7b846eb2b4
commit cf4102373b

View File

@ -40,17 +40,14 @@ router.get("/memories/*", function(req, res/*, next*/) {
if (id == -1) {
index = "";
} else {
if (id != -1) {
index = " AND ((taken=DATE(:cursor) AND id<"+id+ ") OR taken<DATE(:cursor))";
} else {
index = " AND (taken<=DATE(:cursor))";
}
index = " AND ((taken=DATE(:cursor) AND id<"+id+ ") OR taken<DATE(:cursor))";
}
let date = new Date(decodeURI(req.url).replace(/\?.*$/, ""));
let query = "SELECT * FROM photos WHERE strftime('%m%d',taken)=strftime('%m%d',:date) " + index + " ORDER BY taken DESC,id DESC LIMIT " + (limit * 2 + 1);
console.log("Memories for " + date.toISOString().replace(/T.*/, ""));
console.log(query);
return photoDB.sequelize.query(query, {
replacements: {
@ -112,11 +109,7 @@ router.get("/*", function(req, res/*, next*/) {
if (id == -1) {
index = "";
} else {
if (id != -1) {
index = " AND ((taken=DATE(:cursor) AND id<"+id+ ") OR taken<DATE(:cursor))";
} else {
index = " AND (taken<=DATE(:cursor))";
}
index = " AND ((taken=DATE(:cursor) AND id<"+id+ ") OR taken<DATE(:cursor))";
}
let path = decodeURI(req.url).replace(/\?.*$/, ""),