From edc724b475e4c744bd98140751b688a18c59769d Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 7 Nov 2023 04:46:45 +0100 Subject: [PATCH] Storing photo counts. --- assets/components/releases/release.vue | 8 ++++++++ assets/js/fragments.js | 1 + migrations/20231107044032_photocount.js | 11 +++++++++++ src/store-releases.js | 1 + 4 files changed, 21 insertions(+) create mode 100644 migrations/20231107044032_photocount.js diff --git a/assets/components/releases/release.vue b/assets/components/releases/release.vue index 47da075d..accb1e38 100755 --- a/assets/components/releases/release.vue +++ b/assets/components/releases/release.vue @@ -171,6 +171,14 @@
{{ formatDuration(release.duration) }}
+
+ Photos + {{ release.photoCount }} +
+
{ + await knex.schema.alterTable('releases', (table) => { + table.integer('photo_count'); + }); +}; + +exports.down = async (knex) => { + await knex.schema.alterTable('releases', (table) => { + table.dropColumn('photo_count'); + }); +}; diff --git a/src/store-releases.js b/src/store-releases.js index b0d0b9b2..99adbb52 100755 --- a/src/store-releases.js +++ b/src/store-releases.js @@ -42,6 +42,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce slug, description: decode(release.description), comment: release.comment, + photo_count: Number(release.photoCount) || null, deep: typeof release.deep === 'boolean' ? release.deep : false, deep_url: release.deepUrl, updated_batch_id: batchId,