diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-02-26 18:03:20 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-02-26 18:03:20 -0400 |
commit | 8d05431f0c815227ba5cd503e88b0ee531c6eeb8 (patch) | |
tree | 7acae279d209c20cca1601493548e330317e8646 /src/data/things | |
parent | 84081cc3b5287f925ffeeb94ae730e4c143b5f59 (diff) | |
parent | 2b2f252f246053bd52c36948748a3425d1c950a1 (diff) |
Merge branch 'preview' of github.com:hsmusic/hsmusic-wiki into preview
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/album.js | 2 | ||||
-rw-r--r-- | src/data/things/track.js | 2 | ||||
-rw-r--r-- | src/data/things/validators.js | 13 |
3 files changed, 12 insertions, 5 deletions
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, 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(), 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(':</i>')) { + throw new TypeError(`Missing commentary citation: "${ + firstLine.length > 40 + ? firstLine.slice(0, 40) + '...' + : firstLine + }"`); + } + + return true; } const isArtistRef = validateReference('artist'); |