@@ -1225,8 +1233,30 @@
this.async(this.processItems.bind(this));
console.log("Total pending: " + this.pendingPhotos.length);
+
+ if (this.mode == "slideshow" && !this.slideshowTimeout) {
+ this.slideshowNext();
+ }
},
+ slideshowNext: function() {
+ if (this.mode != "slideshow") {
+ window.cancelTimeout(this.slideshowTimeout);
+ delete this.slideshowTimeout;
+ return;
+ }
+ this.slideshowTimeout = window.setTimeout(this.slideshowNext.bind(this), 24 * 1000);
+ if (!this.thumbnails.length) {
+ return;
+ }
+ var photo = this.thumbnails[Math.floor(this.thumbnails.length * Math.random())];
+ this.$.kenBurns.item = photo.item;
+ this.$.kenBurns.src = this.base + photo.item.path + "thumbs/scaled/" + photo.item.filename;
+ var datetime = (photo.taken || photo.modified || photo.added).replace(/T.*/, "");
+ this.slideshowInfo = "In the year of " + datetime.replace(/(....).*/, "$1");
+ },
+
+
/* Asynchronously load items into the DOM */
processItems: function() {
if (this.processing) {
@@ -1761,7 +1791,7 @@
path = mode;
if (mode == "time") {
path = "";
- } else if (mode == "memories") {
+ } else if (mode == "memories" || mode == "slideshow") {
path = "memories/" + (this.date.replace(this.year + "-", "") || "");
} else if (mode == "holiday") {
path = "holiday/" + this.holiday;
@@ -1780,7 +1810,7 @@
(mode != this.mode) ||
((mode == "albums") && (path != (this.path || ""))) ||
((mode == "holiday") && (path != ("holiday/" + this.holiday))) ||
- ((mode == "memories") && (path != ("memories/" + (this.date.replace(this.year + "-", "") || ""))))) {
+ ((mode == "memories" || mode == "slideshow") && (path != ("memories/" + (this.date.replace(this.year + "-", "") || ""))))) {
console.log("Skipping results for old query. Triggering re-fetch of photos for new path or mode.");
this._loadPhotos();
return;