Fix days to exclude duplicate and deleted photos
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
b2a1e214e9
commit
0065f26b10
@ -25,13 +25,13 @@ const router = express.Router();
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
router.get("/*", function(req, res/*, next*/) {
|
router.get("/*", function(req, res/*, next*/) {
|
||||||
const path = decodeURI(req.url).replace(/\?.*$/, "").replace(/^\//, ""),
|
const path = decodeURI(req.url).replace(/\?.*$/, "").replace(/^\//, "");
|
||||||
query = "SELECT DATE(photos.taken) AS date,COUNT(photos.id) AS count FROM albums " +
|
|
||||||
"JOIN photos ON photos.albumId=albums.id " +
|
|
||||||
"WHERE albums.path LIKE :path GROUP BY DATE(photos.taken) ORDER BY date DESC";
|
|
||||||
|
|
||||||
console.log("Looking for daily photo counts in " + path);
|
console.log("Looking for daily photo counts in " + path);
|
||||||
return photoDB.sequelize.query(query, {
|
return photoDB.sequelize.query(
|
||||||
|
"SELECT DATE(photos.taken) AS date,COUNT(photos.id) AS count FROM albums " +
|
||||||
|
"JOIN photos ON photos.deleted!=1 AND photos.duplicate=0 AND photos.albumId=albums.id AND photos.taken NOT NULL" +
|
||||||
|
"WHERE albums.path LIKE :path GROUP BY DATE(photos.taken) ORDER BY date DESC", {
|
||||||
replacements: {
|
replacements: {
|
||||||
path: path + "%"
|
path: path + "%"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user