From 588a2617960faafec864f534fbd3b15f4c12da74 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sat, 8 Sep 2018 16:41:06 -0700 Subject: [PATCH] Fixed date scanning for whatsapp and google images Signed-off-by: James Ketrenos --- frontend/elements/photo-thumbnail.html | 1 + server/scanner.js | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/elements/photo-thumbnail.html b/frontend/elements/photo-thumbnail.html index 8c8ca88..b881729 100755 --- a/frontend/elements/photo-thumbnail.html +++ b/frontend/elements/photo-thumbnail.html @@ -36,6 +36,7 @@ bottom: 0px; left: 0px; right: 0px; + font-size: 0.6em; } :host:hover > div { diff --git a/server/scanner.js b/server/scanner.js index 1ea7f5c..2366d85 100644 --- a/server/scanner.js +++ b/server/scanner.js @@ -363,17 +363,16 @@ function triggerWatcher() { } } else { /* Attempt to infer the datestamp from the filename */ - let patterns = /WhatsApp Image (20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) at (.*).(jpeg|jpg)/; let date = moment(created).format(); - let match = file.match(patterns); + + let match = file.match(/WhatsApp Image (20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) at (.*).(jpeg|jpg)/); if (match) { date = moment((match[1]+" "+match[2]), "YYYY-MM-DD h.mm.ss a").format(); if (date == "Invalid date") { date = moment(created).format(); } } else { - patterns = /(20[0-9][0-9]-?[0-9][0-9]-?[0-9][0-9])[_\-]?([0-9]{6})?/; - match = file.match(patterns); + match = file.match(/(20[0-9][0-9]-?[0-9][0-9]-?[0-9][0-9])[_\-]?([0-9]{6})?/); if (match) { if (match[2]) { /* Stamp had time in it */ date = moment((match[1]+""+match[2]).replace(/-/g, ""), "YYYYMMDDHHmmss").format();