aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/photo-sync.js2
-rw-r--r--packages/meshbay-hub/tests/test_photo_sync.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/photo-sync.js b/packages/meshbay-hub/src/meshbay_hub/static/photo-sync.js
index 154a009..74084b8 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/photo-sync.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/photo-sync.js
@@ -249,7 +249,7 @@ async function upload(transport, item) {
}
}
-/** `<folder>/YYYY/MM`, one level at a time; a level that exists is fine. */
+/** `<folder>/YYYY/YYYY-MM`, one level at a time; a level that exists is fine. */
async function makeDirs(transport, folder, dir, dirs) {
let at = folder;
for (const name of dir.slice(folder.length + 1).split('/').filter(Boolean)) {
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"))