Do not break on front end if partial records are received

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-10-16 17:26:24 -07:00
parent 81b01f786e
commit 562debdd04

View File

@ -1063,15 +1063,16 @@
return;
}
photos.forEach(function(photo) {
photos = photos.filter(function(photo) {
var year = (photo.taken || photo.modified || photo.added || "").replace(/^(....).*$/, "$1");
if (!year) {
console.log("Partial photo record received: " + photo.id);
return;
return false;
}
if (this.years.indexOf(year) == -1) {
this.push("years", year);
}
return true;
}.bind(this));
this.pendingPhotos = this.pendingPhotos.concat(photos);