更新最新代码

This commit is contained in:
CodeBuddy
2026-10-26 17:32:47 +08:00
commit 0f5dc01674
315 changed files with 42640 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
function photoForm(photo) {
return { taken_at: String(photo.taken_at || '').slice(0, 10), location: photo.location || '', activity: photo.activity || '' };
}
function metadataRows(photos) {
const rows = photos.map((photo, index) => ({ ...photoForm(photo), id: photo.id, photoIndex: index, label: photos.length > 1 ? '第 ' + (index + 1) + ' 张' : '' }));
if (!rows.length) return [];
const same = rows.every(row => row.taken_at === rows[0].taken_at && row.location === rows[0].location && row.activity === rows[0].activity);
if (same) rows.splice(1);
if (same) rows[0].label = '';
return rows.filter(row => row.taken_at || row.location || row.activity);
}
module.exports = { photoForm, metadataRows };