From 732273af162ff6b97cf4442964223fbf6c2acf5f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 31 Jan 2023 09:49:02 -0400 Subject: data format cleanup: tracks * Remove `Has URLs` (`hasURLs`), unused * Tidy `propertyFieldMapping` order --- src/data/things/track.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/data/things') diff --git a/src/data/things/track.js b/src/data/things/track.js index 6b1e958b..1778ed27 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -34,8 +34,6 @@ export class Track extends Thing { urls: Thing.common.urls(), dateFirstReleased: Thing.common.simpleDate(), - hasURLs: Thing.common.flag(true), - artistContribsByRef: Thing.common.contribsByRef(), contributorContribsByRef: Thing.common.contribsByRef(), coverArtistContribsByRef: Thing.common.contribsByRef(), -- cgit 1.3.0-6-gf8a5 From bbb9a3ad9c4626b4b9a2559d0e251d1fe1f5ef01 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 4 Feb 2023 20:32:24 -0400 Subject: data format cleanup: albums * Remove `Is Major Release` (`isMajorRelease`) * Remove major-release code in wiki-data.js * Tidy `propertyFieldMapping` order Major releases were useful when albums were being added to the wiki on the regular, but are unused on HSMusic now, and alternative approaches get more particular results (currently hard-coded grid layout for larger icons, and manually selected albums in homepage rows). --- src/data/things/album.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/data/things') diff --git a/src/data/things/album.js b/src/data/things/album.js index 0c0c7fb4..2a188f2d 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -106,7 +106,6 @@ export class Album extends Thing { hasCoverArt: Thing.common.flag(true), hasTrackArt: Thing.common.flag(true), hasTrackNumbers: Thing.common.flag(true), - isMajorRelease: Thing.common.flag(false), isListedOnHomepage: Thing.common.flag(true), isListedInGalleries: Thing.common.flag(true), @@ -192,7 +191,6 @@ export class Album extends Thing { bannerDimensions: S.id, hasTrackArt: S.id, - isMajorRelease: S.id, isListedOnHomepage: S.id, commentary: S.id, -- cgit 1.3.0-6-gf8a5 From f554897f3728fcb771fe26dffad898a54b37335a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 5 Feb 2023 08:40:25 -0400 Subject: data format cleanup: commentary fields The parseCommentary function was actually going unused. This commit moves its behavior to the more appropriate location (validateCommentary), which actually unveils a couple data errors in the HSMusic data files. --- src/data/things/validators.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/data/things') diff --git a/src/data/things/validators.js b/src/data/things/validators.js index 24db3c79..b116120a 100644 --- a/src/data/things/validators.js +++ b/src/data/things/validators.js @@ -195,7 +195,18 @@ export function isColor(color) { } export function isCommentary(commentary) { - return isString(commentary); + isString(commentary); + + const [firstLine] = commentary.match(/.*/); + if (!firstLine.replace(/<\/b>/g, '').includes(':')) { + throw new TypeError(`Missing commentary citation: "${ + firstLine.length > 40 + ? firstLine.slice(0, 40) + '...' + : firstLine + }"`); + } + + return true; } const isArtistRef = validateReference('artist'); -- cgit 1.3.0-6-gf8a5