diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html index 1099033..a7f526b 100755 --- a/frontend/src/ketr-photos/ketr-photos.html +++ b/frontend/src/ketr-photos/ketr-photos.html @@ -773,7 +773,10 @@ triggerLoadMore: function() { if (this.$.bottom.getBoundingClientRect().bottom < window.innerHeight + 200) { if (this.pendingPhotos.length) { + console.log("At bottom - more items; processItems requested."); this.async(this.processItems.bind(this)); + } else { + console.log("At bottom - no more items."); } } }, @@ -787,12 +790,6 @@ this.triggerLoadMore(); - if (this.$.bottom.getBoundingClientRect().bottom < window.innerHeight + 200) { - if (this.pendingPhotos.length) { - this.async(this.processItems.bind(this)); - } - } - var headerHeight = this.$.header.offsetHeight; var i, date = null, top = null, lowest = window.innerHeight; @@ -1053,12 +1050,9 @@ photos.forEach(function(photo) { var year = (photo.taken || photo.modified || photo.added).replace(/^(....).*$/, "$1"); - for (var i = 0; i < this.years.length; i++) { - if (this.years[i] == year) { - return; - } + if (this.years.indexOf(year) == -1) { + this.push("years", year); } - this.push("years", year); }.bind(this)); this.pendingPhotos = this.pendingPhotos.concat(photos); @@ -1090,6 +1084,7 @@ var photos = this.pendingPhotos.splice(0, 50); this.notifyPath("pendingPhotos.length"); + console.log(this.pendingPhotos.length + " photos remain to be converted to photo-thumbnail"); for (var i = 0; i < photos.length; i++) { var photo = photos[i], datetime; diff --git a/server/app.js b/server/app.js index c4f899a..bebf3c0 100755 --- a/server/app.js +++ b/server/app.js @@ -62,7 +62,7 @@ app.use(bodyParser.urlencoded({ /* Any path starting with the following won't be logged via morgan */ const logSkipPaths = new RegExp("^" + basePath + "(" + [ - ".*\/thumbs\/", + ".*thumbs\\/", "bower_components", ].join(")|(") + ")"); app.use(morgan('common', { diff --git a/server/routes/photos.js b/server/routes/photos.js index 510bdd9..fb9f0d5 100755 --- a/server/routes/photos.js +++ b/server/routes/photos.js @@ -480,16 +480,17 @@ router.get("/*", function(req, res/*, next*/) { if (id == -1) { index = ""; } else { - index = "AND ((strftime('%Y-%m-%d',taken)=strftime('%Y-%m-%d',:cursor) AND photos.id<"+id+ ") OR " + - "(strftime('%m-%d',taken)=strftime('%m-%d',:cursor) AND strftime('%Y',taken) limit; /* We queried one extra item to see if there are more than LIMIT available */ +// console.log("Requested " + limit + " and matched " + photos.length); + let last; if (more) { photos.splice(limit);