From 734b922370a56c7e3577c1f6bbdad69f75301334 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 10 Oct 2026 10:28:12 +0200 Subject: fix(android): back photos up under YYYY/YYYY-MM, not YYYY/MM A month folder named 08 alone read like an album number. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_photo_sync.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/meshbay-hub/tests') diff --git a/packages/meshbay-hub/tests/test_photo_sync.py b/packages/meshbay-hub/tests/test_photo_sync.py index f7852f4..cbc5f5d 100644 --- a/packages/meshbay-hub/tests/test_photo_sync.py +++ b/packages/meshbay-hub/tests/test_photo_sync.py @@ -63,7 +63,7 @@ fake.status = { lastCompleted: null, failure: null, failureAt: null, }; fake.items = [ - { token: 't1', name: 'IMG_3.jpg', dir: 'Media/Photos/Bob/2026/10', size: 30, edited: false, + { token: 't1', name: 'IMG_3.jpg', dir: 'Media/Photos/Bob/2026/2026-10', size: 30, edited: false, alsoKnownAs: 'IMG_3-edited-x.jpg' }, { token: 't2', name: 'IMG_2.jpg', dir: 'Media/Photos/Bob/2026/09', size: 20, edited: false, alsoKnownAs: 'IMG_2-edited-x.jpg' }, @@ -143,11 +143,11 @@ def test_a_due_run_sends_newest_first_and_records_each(tmp_path): # IMG_1 is already in the folder (a reinstall's empty ledger): recorded, # not sent again. assert _of(log, "upload") == [ - ["Media/Photos/Bob/2026/10", "IMG_3.jpg", "tr-30"], + ["Media/Photos/Bob/2026/2026-10", "IMG_3.jpg", "tr-30"], ["Media/Photos/Bob/2026/09", "IMG_2.jpg", "tr-20"], ] assert _of(log, "sent") == [ - ["t1", "Media/Photos/Bob/2026/10", "IMG_3.jpg"], + ["t1", "Media/Photos/Bob/2026/2026-10", "IMG_3.jpg"], ["t2", "Media/Photos/Bob/2026/09", "IMG_2.jpg"], ["t3", "Media/Photos/Bob/2026/09", "IMG_1.jpg"], ] @@ -158,7 +158,7 @@ def test_a_due_run_sends_newest_first_and_records_each(tmp_path): def test_only_missing_folders_are_made_and_parents_first(tmp_path): log = _run(_start(), tmp_path) - assert _of(log, "mkdir") == [["Media/Photos/Bob/2026/10"]] + assert _of(log, "mkdir") == [["Media/Photos/Bob/2026/2026-10"]] def test_every_upload_holds_a_slot_and_gives_it_back(tmp_path): @@ -170,9 +170,9 @@ def test_every_upload_holds_a_slot_and_gives_it_back(tmp_path): def test_an_edit_under_its_own_name_counts_as_already_there(tmp_path): log = _run(_start(""" -fake.index.entries.push({ path: 'Media/Photos/Bob/2026/10', name: 'IMG_3-edited-x.jpg', size: 30 }); +fake.index.entries.push({ path: 'Media/Photos/Bob/2026/2026-10', name: 'IMG_3-edited-x.jpg', size: 30 }); """), tmp_path) - assert ["t1", "Media/Photos/Bob/2026/10", "IMG_3-edited-x.jpg"] in _of(log, "sent") + assert ["t1", "Media/Photos/Bob/2026/2026-10", "IMG_3-edited-x.jpg"] in _of(log, "sent") assert all(u[1] != "IMG_3.jpg" for u in _of(log, "upload")) -- cgit v1.2.3