From d15ba785795deb25b748db661e929d0737e22616 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sat, 26 Sep 2026 19:38:15 +0100 Subject: [PATCH] Merge photo highlights by name and capture year --- ...34663795194e5510f26a7175edf5a5489017-00.md | 4 +- ...34663795194e5510f26a7175edf5a5489017-01.md | 1 + ...34663795194e5510f26a7175edf5a5489017-02.md | 1 + ...34663795194e5510f26a7175edf5a5489017-03.md | 1 + ...34663795194e5510f26a7175edf5a5489017-04.md | 1 + ...34663795194e5510f26a7175edf5a5489017-05.md | 1 + ...34663795194e5510f26a7175edf5a5489017-06.md | 1 + ...34663795194e5510f26a7175edf5a5489017-07.md | 1 + ...34663795194e5510f26a7175edf5a5489017-08.md | 1 + ...34663795194e5510f26a7175edf5a5489017-09.md | 1 + ...34663795194e5510f26a7175edf5a5489017-10.md | 1 + ...34663795194e5510f26a7175edf5a5489017-11.md | 1 + ...34663795194e5510f26a7175edf5a5489017-12.md | 1 + ...34663795194e5510f26a7175edf5a5489017-13.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-01.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-02.md | 1 + ...34663795194e5510f26a7175edf5a5489017-14.md | 1 + ...bbe5a518f033f3e971e95f89a8add5c74ace-00.md | 4 +- ...bbe5a518f033f3e971e95f89a8add5c74ace-01.md | 1 + ...bbe5a518f033f3e971e95f89a8add5c74ace-02.md | 1 + ...76be653b366551f065f31800d8c640b56278-00.md | 4 +- ...76be653b366551f065f31800d8c640b56278-01.md | 1 + ...76be653b366551f065f31800d8c640b56278-02.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-03.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-04.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-05.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-06.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-07.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-08.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-09.md | 1 + ...5f0eded30394ea8ff74d9d7ce8ae326bd172-10.md | 2 + ...4169167053873a5a8db4a15b840a3448266c-00.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-00.md | 3 +- ...21be9ffd468a1a96a6bf4900cbf95595d31d-04.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-05.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-06.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-07.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-08.md | 1 + ...21be9ffd468a1a96a6bf4900cbf95595d31d-09.md | 4 +- ...76be653b366551f065f31800d8c640b56278-03.md | 2 + photo-upload/README.md | 7 ++- photo-upload/app.py | 2 + photo-upload/highlights.py | 56 +++++++++++++++++++ photo-upload/publisher.py | 3 + photo-upload/tests/test_upload.py | 50 +++++++++++++++++ scripts/merge-2026-highlights.py | 38 +++++++++++++ scripts/tests/test_photo_highlights.py | 18 +++++- 47 files changed, 221 insertions(+), 9 deletions(-) create mode 100644 photo-upload/highlights.py create mode 100644 scripts/merge-2026-highlights.py diff --git a/_art/2026-01-16-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-00.md b/_art/2026-01-16-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-00.md index a843830..4966b32 100644 --- a/_art/2026-01-16-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-00.md +++ b/_art/2026-01-16-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-00.md @@ -3,7 +3,9 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017" date: "2026-01-16T20:02:00.721000+03:30" categories: art -anchor: "Iran" +highlight_name: "Iran" --- +
+

diff --git a/_art/2026-01-19-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-01.md b/_art/2026-01-19-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-01.md index 81f859e..48f78f7 100644 --- a/_art/2026-01-19-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-01.md +++ b/_art/2026-01-19-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-01.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-01" date: "2026-01-19T14:54:34.806000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-01-21-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-02.md b/_art/2026-01-21-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-02.md index a701889..c8812a4 100644 --- a/_art/2026-01-21-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-02.md +++ b/_art/2026-01-21-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-02.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-02" date: "2026-01-21T16:33:29.339000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-03.md b/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-03.md index 8912bfa..d4188fe 100644 --- a/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-03.md +++ b/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-03.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-03" date: "2026-01-24T14:04:39.306000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-04.md b/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-04.md index fa5f85e..41db595 100644 --- a/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-04.md +++ b/_art/2026-01-24-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-04.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-04" date: "2026-01-24T15:18:34.557000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-01-28-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-05.md b/_art/2026-01-28-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-05.md index 7e46969..15d5fe8 100644 --- a/_art/2026-01-28-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-05.md +++ b/_art/2026-01-28-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-05.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-05" date: "2026-01-28T17:07:06.982000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-02-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-06.md b/_art/2026-02-02-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-06.md index 28d9d9a..e11f4a6 100644 --- a/_art/2026-02-02-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-06.md +++ b/_art/2026-02-02-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-06.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-06" date: "2026-02-02T08:03:58.683000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-07.md b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-07.md index f366f13..962bd0a 100644 --- a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-07.md +++ b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-07.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-07" date: "2026-02-06T15:56:02.032000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-08.md b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-08.md index e3031b5..26f554e 100644 --- a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-08.md +++ b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-08.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-08" date: "2026-02-06T19:01:35.759000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-09.md b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-09.md index be68278..4f39063 100644 --- a/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-09.md +++ b/_art/2026-02-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-09.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-09" date: "2026-02-06T19:04:14.947000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-07-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-10.md b/_art/2026-02-07-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-10.md index 07f67dd..1cbff14 100644 --- a/_art/2026-02-07-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-10.md +++ b/_art/2026-02-07-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-10.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-10" date: "2026-02-07T20:49:41.304000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-14-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-11.md b/_art/2026-02-14-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-11.md index 30d1b32..58d30ff 100644 --- a/_art/2026-02-14-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-11.md +++ b/_art/2026-02-14-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-11.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-11" date: "2026-02-14T15:15:35.920000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-20-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-12.md b/_art/2026-02-20-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-12.md index 957642f..019bd44 100644 --- a/_art/2026-02-20-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-12.md +++ b/_art/2026-02-20-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-12.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-12" date: "2026-02-20T14:58:05.265000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-02-26-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-13.md b/_art/2026-02-26-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-13.md index 325ce3a..4110729 100644 --- a/_art/2026-02-26-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-13.md +++ b/_art/2026-02-26-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-13.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-13" date: "2026-02-26T11:56:39.486000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-01.md b/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-01.md index 7bd567b..b1f6343 100644 --- a/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-01.md +++ b/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-01.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-01" date: "2026-03-06T13:31:34.372000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-02.md b/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-02.md index 446096a..32ec1aa 100644 --- a/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-02.md +++ b/_art/2026-03-06-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-02.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-02" date: "2026-03-06T14:48:51.818000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-03-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-14.md b/_art/2026-03-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-14.md index 017f453..6d6fcc3 100644 --- a/_art/2026-03-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-14.md +++ b/_art/2026-03-06-photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-14.md @@ -3,6 +3,7 @@ layout: post title: "photo-a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017-14" date: "2026-03-06T15:11:26.932000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-00.md b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-00.md index c4bbf4e..cab979a 100644 --- a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-00.md +++ b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-00.md @@ -3,7 +3,9 @@ layout: post title: "photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace" date: "2026-03-07T11:58:57.224000+04:00" categories: art -anchor: "Armenia" +highlight_name: "Armenia" --- +
+

diff --git a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-01.md b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-01.md index 9bbe768..8f54fa1 100644 --- a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-01.md +++ b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-01.md @@ -3,6 +3,7 @@ layout: post title: "photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-01" date: "2026-03-07T12:34:32.793000+04:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-02.md b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-02.md index bb70f76..43208b8 100644 --- a/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-02.md +++ b/_art/2026-03-07-photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-02.md @@ -3,6 +3,7 @@ layout: post title: "photo-bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace-02" date: "2026-03-07T15:33:07.690000+04:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-00.md b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-00.md index 4ac245e..7b6ee9c 100644 --- a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-00.md +++ b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-00.md @@ -3,7 +3,9 @@ layout: post title: "photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278" date: "2026-06-26T16:53:49.633000+04:00" categories: art -anchor: "Armenia" +highlight_name: "Armenia" --- +
+

diff --git a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-01.md b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-01.md index 2fe1b22..2074713 100644 --- a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-01.md +++ b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-01.md @@ -3,6 +3,7 @@ layout: post title: "photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-01" date: "2026-06-26T17:15:56.830000+04:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-02.md b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-02.md index 8a826c4..6969233 100644 --- a/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-02.md +++ b/_art/2026-06-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-02.md @@ -3,6 +3,7 @@ layout: post title: "photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-02" date: "2026-06-26T17:17:37.263000+04:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-08-25-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-03.md b/_art/2026-08-25-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-03.md index 3c85288..6c918fb 100644 --- a/_art/2026-08-25-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-03.md +++ b/_art/2026-08-25-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-03.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-03" date: "2026-08-25T11:29:18.840000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-04.md b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-04.md index 2b85947..634e8ce 100644 --- a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-04.md +++ b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-04.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-04" date: "2026-08-28T18:42:14.080000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-05.md b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-05.md index 91a07b5..b362f57 100644 --- a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-05.md +++ b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-05.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-05" date: "2026-08-28T21:03:02.299000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-06.md b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-06.md index 2996f14..e211b6a 100644 --- a/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-06.md +++ b/_art/2026-08-28-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-06.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-06" date: "2026-08-28T21:35:02.917000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-07.md b/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-07.md index 864cf45..bc3c3e1 100644 --- a/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-07.md +++ b/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-07.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-07" date: "2026-08-30T18:27:21.073000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-08.md b/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-08.md index 78f2728..7a03a32 100644 --- a/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-08.md +++ b/_art/2026-08-30-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-08.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-08" date: "2026-08-30T18:30:02.249000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-09-01-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-09.md b/_art/2026-09-01-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-09.md index 5f61b98..9df36e6 100644 --- a/_art/2026-09-01-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-09.md +++ b/_art/2026-09-01-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-09.md @@ -3,6 +3,7 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-09" date: "2026-09-01T14:21:37.968000+03:30" categories: art +highlight_name: "Iran" ---

diff --git a/_art/2026-09-19-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-10.md b/_art/2026-09-19-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-10.md index 5586c74..522de20 100644 --- a/_art/2026-09-19-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-10.md +++ b/_art/2026-09-19-photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-10.md @@ -3,6 +3,8 @@ layout: post title: "photo-0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172-10" date: "2026-09-19T20:21:02.987000+03:30" categories: art +anchor: "Iran" +highlight_name: "Iran" ---

diff --git a/_art/2026-09-19-photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c-00.md b/_art/2026-09-19-photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c-00.md index 99a7697..4aedebb 100644 --- a/_art/2026-09-19-photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c-00.md +++ b/_art/2026-09-19-photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c-00.md @@ -3,6 +3,7 @@ layout: post title: "photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c" date: "2026-09-19T12:40:18+00:00" categories: art +highlight_name: "Armenia" ---
diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00.md index 20fc3ee..39d9d2f 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00.md @@ -3,7 +3,8 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d" date: "2026-09-19T12:40:33+00:00" categories: art -anchor: "Romania" --- +
+

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04.md index 915a18c..80ccdaf 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04.md @@ -3,6 +3,7 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04" date: "2026-09-19T12:40:19+00:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05.md index c9b5650..009938e 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05.md @@ -3,6 +3,7 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05" date: "2026-09-19T12:40:20+00:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06.md index bb42f3c..356a031 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06.md @@ -3,6 +3,7 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06" date: "2026-09-19T12:40:21+00:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07.md index c070ad4..85d49e5 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07.md @@ -3,6 +3,7 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07" date: "2026-09-19T12:40:22+00:00" categories: art +highlight_name: "Armenia" ---

Transmission of Flesh by Erfan Ashourioun

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08.md index 99bdc00..703f97f 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08.md @@ -3,6 +3,7 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08" date: "2026-09-19T12:40:23+00:00" categories: art +highlight_name: "Armenia" ---

diff --git a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-09.md b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-09.md index 28cdaa6..681287d 100644 --- a/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-09.md +++ b/_art/2026-09-19-photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-09.md @@ -3,7 +3,9 @@ layout: post title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-09" date: "2026-09-19T12:40:24+00:00" categories: art -anchor: "Armenia" +highlight_name: "Armenia" --- +
+

diff --git a/_art/2026-09-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-03.md b/_art/2026-09-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-03.md index 1e4967d..69cb4ba 100644 --- a/_art/2026-09-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-03.md +++ b/_art/2026-09-26-photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-03.md @@ -3,6 +3,8 @@ layout: post title: "photo-3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278-03" date: "2026-09-26T18:27:11.763827+00:00" categories: art +anchor: "Armenia" +highlight_name: "Armenia" ---

diff --git a/photo-upload/README.md b/photo-upload/README.md index 9a3ee28..ecc92a2 100644 --- a/photo-upload/README.md +++ b/photo-upload/README.md @@ -179,8 +179,11 @@ photos. When none of these date sources is available, the service uses the uploa date. Re-sharing the same images, caption, and highlight with dates replaces the earlier undated upload. Captions are plain text and optional. -An optional highlight name (up to 200 characters) adds one link to **Highlights**, -pointing to the first photo in the batch. Leave it blank for an ordinary upload. +An optional highlight name (up to 200 characters) adds a link to **Highlights**. +If that name already exists in the same capture year, publishing merges the new +photos into that highlight and keeps one link at its newest photo. A batch spanning +years gets one link per year. Photo dates and gallery order stay unchanged. Leave +the name blank for an ordinary upload. Gallery images are progressive JPEGs with a maximum edge of 1600 pixels and a 300 KiB size limit. The uploader tries moderate JPEG quality levels, then reduces diff --git a/photo-upload/app.py b/photo-upload/app.py index 68d647b..34e07f1 100644 --- a/photo-upload/app.py +++ b/photo-upload/app.py @@ -177,6 +177,8 @@ def photo_entry(job, date, index, caption, highlight): f'date: "{item_date.isoformat()}"', "categories: art"] if index == 0 and highlight: content.append(f"anchor: {json.dumps(highlight)}") + if highlight: + content.append(f"highlight_name: {json.dumps(highlight)}") content.extend(["---", ""]) if index == 0 and not highlight: content.extend([f'
', ""]) diff --git a/photo-upload/highlights.py b/photo-upload/highlights.py new file mode 100644 index 0000000..acd1934 --- /dev/null +++ b/photo-upload/highlights.py @@ -0,0 +1,56 @@ +"""Keep one gallery highlight link per name and capture year.""" + +from datetime import datetime, timezone +import json +from pathlib import Path +import re + + +def field(content, name): + match = re.search(rf"^{re.escape(name)}: (.+)$", content.split("---", 2)[1], re.MULTILINE) + if not match: + return None + value = match.group(1).strip() + return json.loads(value) if value.startswith('"') else value + + +def normalize_highlights(art): + """Place each link on the newest photo in its named, dated group.""" + groups = {} + for path in Path(art).glob("*.md"): + content = path.read_text() + name = field(content, "highlight_name") or field(content, "anchor") + date = field(content, "date") + if not name or not date: + continue + taken = datetime.fromisoformat(str(date)) + if taken.tzinfo is None: + taken = taken.replace(tzinfo=timezone.utc) + groups.setdefault((name, taken.year), []).append((taken, path, content)) + + changed = [] + for (name, _), entries in groups.items(): + # An old single anchor is already the only link; a newer named photo + # moves the link without changing any photo's capture date or position. + newest = max(entries, key=lambda entry: (entry[0], entry[1].name))[1] + if len(entries) == 1 and field(entries[0][2], "anchor") == name: + continue + for _, path, content in entries: + old = content + had_anchor = field(content, "anchor") is not None + if (path == newest and had_anchor and + all(field(other[2], "anchor") is None for other in entries if other[1] != path)): + continue + if had_anchor: + content = re.sub(r"^anchor: .+\n", "", content, count=1, flags=re.MULTILINE) + if path == newest: + content = content.replace("categories: art\n", "categories: art\n" + + f"anchor: {json.dumps(name, ensure_ascii=False)}\n", 1) + elif had_anchor: + title = field(content, "title") + if title and title.startswith("photo-") and f'id="{title}"' not in content: + content = content.replace("---\n\n", f'---\n\n
\n\n', 1) + if content != old: + path.write_text(content) + changed.append(path) + return changed diff --git a/photo-upload/publisher.py b/photo-upload/publisher.py index 01a263d..d24d4fa 100644 --- a/photo-upload/publisher.py +++ b/photo-upload/publisher.py @@ -11,6 +11,7 @@ import sys import time from app import atomic_json +from highlights import normalize_highlights from posts import publish_post log = logging.getLogger("publisher") @@ -117,6 +118,8 @@ class Publisher: self.git("add", "--", str(entry)) shutil.copytree(submission / "images", self.repo / images, dirs_exist_ok=True) self.git("add", "--", str(images)) + for path in normalize_highlights(self.repo / "_art"): + self.git("add", "--", str(path.relative_to(self.repo))) if self.git("diff", "--cached", "--name-only"): self.git("commit", "-m", f"Publish {len(jobs)} submission(s)") self.git("push", "origin", f"HEAD:refs/heads/{self.branch}") diff --git a/photo-upload/tests/test_upload.py b/photo-upload/tests/test_upload.py index 3ed3a53..58575f4 100644 --- a/photo-upload/tests/test_upload.py +++ b/photo-upload/tests/test_upload.py @@ -379,6 +379,56 @@ def test_publisher_names_photo_entry_from_capture_date(publisher, service): assert f'_art/2025-04-18-photo-{response.json["id"]}-00.md' in paths +def test_publisher_merges_highlights_by_name_and_capture_year(publisher): + run, remote, client = publisher + first = client.post("/api/photos", headers=AUTH, data={ + "photos": [(io.BytesIO(photo("red")), "first.jpg")], + "highlight": "Trip", "photo_dates": "2026-03-01T12:00:00+00:00", + }).json["id"] + assert run().returncode == 0 + second = client.post("/api/photos", headers=AUTH, data={ + "photos": [(io.BytesIO(photo("blue")), "second.jpg")], + "highlight": "Trip", "photo_dates": "2026-06-01T12:00:00+00:00", + }).json["id"] + assert run().returncode == 0 + files = git(remote, "ls-tree", "-r", "--name-only", "master").splitlines() + entries = [git(remote, "show", f"master:{path}") for path in files if path.startswith("_art/")] + assert sum('anchor: "Trip"' in entry for entry in entries) == 1 + assert f'anchor: "Trip"' in next(entry for entry in entries if f"photo-{second}" in entry) + assert f'
' in next( + entry for entry in entries if f'title: "photo-{first}"' in entry) + old_year = client.post("/api/photos", headers=AUTH, data={ + "photos": [(io.BytesIO(photo("green")), "old-year.jpg")], + "highlight": "Trip", "photo_dates": "2025-12-31T12:00:00+00:00", + }).json["id"] + assert run().returncode == 0 + files = git(remote, "ls-tree", "-r", "--name-only", "master").splitlines() + entries = [git(remote, "show", f"master:{path}") for path in files if path.startswith("_art/")] + assert sum('anchor: "Trip"' in entry for entry in entries) == 2 + assert 'anchor: "Trip"' in next(entry for entry in entries if f"photo-{old_year}" in entry) + commit = git(remote, "rev-parse", "master") + assert run().returncode == 0 + assert git(remote, "rev-parse", "master") == commit + + +def test_publisher_splits_a_highlight_across_capture_years(publisher): + run, remote, client = publisher + response = client.post("/api/photos", headers=AUTH, data={ + "photos": [(io.BytesIO(photo("red")), "old.jpg"), + (io.BytesIO(photo("blue")), "new.jpg")], + "highlight": "Trip", + "photo_dates": "2025-12-31T12:00:00+00:00\n2026-01-01T12:00:00+00:00", + }) + assert response.status_code == 202 + result = run() + assert result.returncode == 0, result.stderr + job = response.json["id"] + files = git(remote, "ls-tree", "-r", "--name-only", "master").splitlines() + entries = [git(remote, "show", f"master:{path}") for path in files if f"photo-{job}" in path] + assert len(entries) == 2 + assert all('anchor: "Trip"' in entry for entry in entries) + + def test_publisher_replaces_an_undated_version_of_the_same_photos(publisher, service): run, remote, client = publisher raw = photo() diff --git a/scripts/merge-2026-highlights.py b/scripts/merge-2026-highlights.py new file mode 100644 index 0000000..511343a --- /dev/null +++ b/scripts/merge-2026-highlights.py @@ -0,0 +1,38 @@ +"""One-time migration of existing Iran and Armenia photo groups.""" + +import json +from pathlib import Path +import sys + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "photo-upload")) +from highlights import normalize_highlights + +ART = ROOT / "_art" +IRAN = ( + "0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172", + "a85137ab7990cb095c8043cf21c034663795194e5510f26a7175edf5a5489017", +) +ARMENIA = ( + "bcf8d1409da4d748b2ba060fc090bbe5a518f033f3e971e95f89a8add5c74ace", + "3c708b27ab8e8af18bd3ad8ce25876be653b366551f065f31800d8c640b56278", + "474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c", +) + +for path in ART.glob("*photo-*.md"): + if not path.name.startswith("2026-"): + continue + job = path.name.split("-photo-", 1)[1][:64] + name = "Iran" if job in IRAN else "Armenia" if job in ARMENIA else None + if job == "7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d": + index = int(path.stem[-2:]) + name = "Armenia" if index >= 4 else None + if not name: + continue + content = path.read_text() + if "highlight_name:" not in content: + content = content.replace("categories: art\n", "categories: art\n" + + f"highlight_name: {json.dumps(name)}\n", 1) + path.write_text(content) + +normalize_highlights(ART) diff --git a/scripts/tests/test_photo_highlights.py b/scripts/tests/test_photo_highlights.py index 87152ec..8d432a0 100644 --- a/scripts/tests/test_photo_highlights.py +++ b/scripts/tests/test_photo_highlights.py @@ -83,10 +83,24 @@ class PhotoHighlightTests(unittest.TestCase): records.sort(reverse=True) grouped = [record for record in records if record[1] in ARMENIA + ROMANIA] self.assertEqual([record[1] for record in grouped], ROMANIA + ARMENIA) - self.assertEqual(grouped[0][2], "Romania") - self.assertEqual(grouped[9][2], "Armenia") + # Newer uploads now own the one link for each name/year. + self.assertIsNone(grouped[0][2]) + self.assertIsNone(grouped[9][2]) self.assertIn("Transmission of Flesh by Erfan Ashourioun", grouped[11][3]) + def test_iran_and_armenia_have_one_link_each_in_2026(self): + for name in ("Iran", "Armenia"): + anchors = [] + for path in ART.glob("2026-*.md"): + content = path.read_text() + if f'anchor: "{name}"' in content: + anchors.append(path) + self.assertEqual(len(anchors), 1, (name, anchors)) + iran = next(path for path in ART.glob("2026-*.md") + if 'anchor: "Iran"' in path.read_text()) + self.assertIn("0b1781e580e6d0852728b6aab4f45f0eded30394ea8ff74d9d7ce8ae326bd172", + iran.name) + def test_2026_highlights_follow_supplied_chronology(self): anchors = {} for path in ART.glob("*photo-*.md"):