From 782a63e25304b7f17b216a231d243f3154ae1128 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 7 Jan 2023 21:47:34 -0400 Subject: quarantine hard-coded official/fandomAlbumData --- src/listing-spec.js | 12 +++++++++--- src/upd8.js | 12 +----------- src/util/magic-constants.js | 1 - 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/listing-spec.js b/src/listing-spec.js index 636e5f6..1538757 100644 --- a/src/listing-spec.js +++ b/src/listing-spec.js @@ -1,3 +1,5 @@ +import {OFFICIAL_GROUP_DIRECTORY} from './util/magic-constants.js'; + import { empty, accumulateSum, @@ -876,16 +878,20 @@ const listingSpec = [ directory: 'random', stringsKey: 'other.randomPages', - data: ({wikiData: {fandomAlbumData, officialAlbumData}}) => [ + data: ({wikiData: {albumData}}) => [ { - albums: officialAlbumData, name: 'Official', randomCode: 'official', + albums: albumData + .filter((album) => album.groups + .some((group) => group.directory === OFFICIAL_GROUP_DIRECTORY)), }, { - albums: fandomAlbumData, name: 'Fandom', randomCode: 'fandom', + albums: albumData + .filter((album) => album.groups + .every((group) => group.directory !== OFFICIAL_GROUP_DIRECTORY)), }, ], diff --git a/src/upd8.js b/src/upd8.js index 6d6990b..d5a5c2a 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -112,9 +112,6 @@ import { } from './util/serialize.js'; */ -// Pensive emoji! -import { OFFICIAL_GROUP_DIRECTORY } from './util/magic-constants.js'; - import FileSizePreloader from './file-size-preloader.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -495,9 +492,7 @@ async function main() { progressCallAll('Caching all data values', Object.entries(wikiData) .filter(([key]) => key !== 'listingSpec' && - key !== 'listingTargetSpec' && - key !== 'officialAlbumData' && - key !== 'fandomAlbumData') + key !== 'listingTargetSpec') .map(([key, value]) => key === 'wikiInfo' ? [key, [value]] : key === 'homepageLayout' ? [key, [value]] : @@ -589,11 +584,6 @@ async function main() { } } - wikiData.officialAlbumData = wikiData.albumData - .filter((album) => album.groups.some((group) => group.directory === OFFICIAL_GROUP_DIRECTORY)); - wikiData.fandomAlbumData = wikiData.albumData - .filter((album) => album.groups.every((group) => group.directory !== OFFICIAL_GROUP_DIRECTORY)); - const urls = generateURLs(urlSpec); const fileSizePreloader = new FileSizePreloader(); diff --git a/src/util/magic-constants.js b/src/util/magic-constants.js index 73fdbc6..83dd7db 100644 --- a/src/util/magic-constants.js +++ b/src/util/magic-constants.js @@ -7,4 +7,3 @@ // (TM). export const OFFICIAL_GROUP_DIRECTORY = 'official'; -export const FANDOM_GROUP_DIRECTORY = 'fandom'; -- cgit 1.3.0-6-gf8a5