From 356062ead3aeb2e238b045e3e2d20a8e9b4c0480 Mon Sep 17 00:00:00 2001 From: Claudio Date: Mon, 11 May 2026 20:56:47 +0200 Subject: [PATCH] feat(date-guess): recognise YY-MM-DD HH-MM-SS Synology export filenames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 0525.mov-style export from Synology Photos uses 2-digit years, which the existing patterns ignored (all required \d{4}). Result: filename gave no signal, suggestion fell through to the YYYY/MM folder layout and snapped to day 15. The explicit HH-MM-SS half rules out random digit triples, so we trust YY → 2000+YY for this specific shape and surface the actual capture time, not noon. --- backend/app/services/date_guess.py | 25 +++++++++++++++++++++++++ frontend/src/lib/guessDateFromPath.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/backend/app/services/date_guess.py b/backend/app/services/date_guess.py index 6ab6512..2b740b7 100644 --- a/backend/app/services/date_guess.py +++ b/backend/app/services/date_guess.py @@ -64,6 +64,13 @@ def _segments(filepath: str) -> list[str]: return [s for s in re.split(r"[\\/]+", filepath) if s] +# Synology Photos export: `YY-MM-DD HH-MM-SS NNNN.ext`. The explicit +# HH-MM-SS half is what makes the 2-digit year safe to trust — a random +# digit triple won't satisfy the hour/minute/second range checks below. +# YY is mapped to 2000+YY (this format is a recent export convention). +_SYNOLOGY_RE = re.compile( + r"(?