From fadc85449d0f65e4f71b9509494cdd62de7dd56b Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 3 Dec 2023 09:34:24 -0800 Subject: [PATCH] chore: unify mbid data --- src/_data/artists.js | 16 ++-------------- src/_data/json/mbid-patches.json | 13 +++++++++++++ src/_data/mbidPatches.js | 5 +++++ src/api/mbids.liquid | 6 ++++++ 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 src/_data/json/mbid-patches.json create mode 100644 src/_data/mbidPatches.js create mode 100644 src/api/mbids.liquid diff --git a/src/_data/artists.js b/src/_data/artists.js index d1a9c8e6..a364f2f1 100644 --- a/src/_data/artists.js +++ b/src/_data/artists.js @@ -1,20 +1,8 @@ const EleventyFetch = require('@11ty/eleventy-fetch') +const mbidPatches = require('./json/mbid-patches.json') const mbidMap = (artist) => { - const map = { - afi: '1c3919b2-43ca-4a4a-935d-9d50135ec0ef', - 'carpe noctem': 'aa349181-1cb9-4340-bb3f-82eefba3e697', - cruciamentum: '9a783663-db0c-4237-a3a9-afe72d055ddc', - 'edge of sanity': '82d1972f-f815-480d-ba78-9873b799bdd1', - fumes: 'a5139ca1-f4f3-4bea-ae4c-ae4e2efd857d', - ghastly: '70f969df-7fc1-421e-afad-678c0bbd1aea', - krallice: 'b4e4b359-76a3-447e-be1d-80a24887134e', - osees: '194272cc-dcc8-4640-a4a6-66da7d250d5c', - panopticon: 'd9b1f00a-31a7-4f64-9f29-8481e7be8911', - 'pigment vehicle': 'c421f86c-991c-4b2d-9058-516375903deb', - worm: '6313658e-cd68-4c81-9778-17ce3825748e', - } - return map[artist.toLowerCase()] || '' + return mbidPatches[artist.toLowerCase()] || '' } module.exports = async function () { diff --git a/src/_data/json/mbid-patches.json b/src/_data/json/mbid-patches.json new file mode 100644 index 00000000..c9e5883b --- /dev/null +++ b/src/_data/json/mbid-patches.json @@ -0,0 +1,13 @@ +{ + "afi": "1c3919b2-43ca-4a4a-935d-9d50135ec0ef", + "carpe noctem": "aa349181-1cb9-4340-bb3f-82eefba3e697", + "cruciamentum": "9a783663-db0c-4237-a3a9-afe72d055ddc", + "edge of sanity": "82d1972f-f815-480d-ba78-9873b799bdd1", + "fumes": "a5139ca1-f4f3-4bea-ae4c-ae4e2efd857d", + "ghastly": "70f969df-7fc1-421e-afad-678c0bbd1aea", + "krallice": "b4e4b359-76a3-447e-be1d-80a24887134e", + "osees": "194272cc-dcc8-4640-a4a6-66da7d250d5c", + "panopticon": "d9b1f00a-31a7-4f64-9f29-8481e7be8911", + "pigment vehicle": "c421f86c-991c-4b2d-9058-516375903deb", + "worm": "6313658e-cd68-4c81-9778-17ce3825748e" +} diff --git a/src/_data/mbidPatches.js b/src/_data/mbidPatches.js new file mode 100644 index 00000000..1fcb4006 --- /dev/null +++ b/src/_data/mbidPatches.js @@ -0,0 +1,5 @@ +const mbidPatches = require('./json/mbid-patches.json') + +module.exports = async function () { + return mbidPatches +} diff --git a/src/api/mbids.liquid b/src/api/mbids.liquid new file mode 100644 index 00000000..5ee55ad4 --- /dev/null +++ b/src/api/mbids.liquid @@ -0,0 +1,6 @@ +--- +layout: null +eleventyExcludeFromCollections: true +permalink: /api/mbids +--- +{{ mbidPatches | json }} \ No newline at end of file