From c32d860358d2dfd3370a0973418c11186e5ce7c1 Mon Sep 17 00:00:00 2001
From: Florrie
Date: Sat, 16 Nov 2019 17:23:20 -0400
Subject: misc updates; track references from NSND
---
upd8.js | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 81 insertions(+), 22 deletions(-)
(limited to 'upd8.js')
diff --git a/upd8.js b/upd8.js
index 03999896..8890a5cb 100644
--- a/upd8.js
+++ b/upd8.js
@@ -85,7 +85,7 @@ const SITE_TITLE = 'Homestuck Music Wiki';
const SITE_INTRO = fixWS`
Welcome to my fan-made Homestuck music wiki! Select any album below to begin browsing.
This site was mostly made as a remake of Homestuck's official Bandcamp, which saw its content reduced on 10/25/19. This site aims to be a more reliable resource and reference: track art (conspicuously missing from the Bandcamp) is archived here, solo albums are all indexed in the one place, and URLs will always stay consistent. Also included are tracks for listening on Bandcamp and other services.
- This site was mostly made by Florrie. Listings were fetched primarily from the Homestuck Bandcamp. Track art is primarily from the Web Archive. Much of this is made based on and with use of the Homestuck and MSPA Music Wiki on Fandom - thanks a bunch to all who've worked on that!
+ This site was mostly made by Florrie (@florriestuck, /u/towerofnix - feel free to send suggestions and feedback!!). Listings were fetched primarily from the Homestuck Bandcamp. Track art is primarily from the Web Archive. Leitmotif and track-reference info is gathered from the fantastic NSND. Much of this is made based on and with use of the Homestuck and MSPA Music Wiki on Fandom - thanks a bunch to all who've worked on that!
`;
// The folder you stick your random downloads in is called "Downloads", yeah?
@@ -327,6 +327,7 @@ async function processAlbumDataFile(file) {
const trackName = getBasicField(section, 'Track');
const originalDate = getBasicField(section, 'Original Date');
+ const references = getListField(section, 'References') || [];
let trackArtists = getListField(section, 'Artists') || getListField(section, 'Artist');
let trackCoverArtists = getContributionField(section, 'Track Art');
let trackContributors = getContributionField(section, 'Contributors') || [];
@@ -352,7 +353,7 @@ async function processAlbumDataFile(file) {
}
if (!trackCoverArtists) {
- if (albumHasTrackArt) {
+ if (getBasicField(section, 'Track Art') !== 'none' && albumHasTrackArt) {
if (albumTrackCoverArtists) {
trackCoverArtists = albumTrackCoverArtists;
} else {
@@ -391,6 +392,7 @@ async function processAlbumDataFile(file) {
artists: trackArtists,
coverArtists: trackCoverArtists,
contributors: trackContributors,
+ references,
date,
directory: trackDirectory,
urls: trackURLs,
@@ -514,7 +516,7 @@ async function writeAlbumPage(album, albumData) {
${track.name}
${track.artists !== album.artists && fixWS`
- by ${getArtistString(track.artists)}
+ by ${getArtistString(track.artists)}
`}
`).join('\n')}
@@ -529,6 +531,8 @@ async function writeTrackPage(track, albumData) {
const artistNames = getArtistNames(albumData);
const allTracks = getAllTracks(albumData);
const trackDirectory = path.join(TRACK_DIRECTORY, track.directory);
+ const tracksThatReference = getTracksThatReference(track, allTracks);
+ const tracksReferenced = getTracksReferencedBy(track, allTracks);
await mkdirp(trackDirectory);
await writeFile(path.join(trackDirectory, 'index.html'), fixWS`
@@ -553,6 +557,14 @@ async function writeTrackPage(track, albumData) {
`))}.
`}
Released ${getDateString(track)}.
+ Listen on ${joinNoOxford(track.urls.map(url => fixWS`
+ ${
+ url.includes('bandcamp.com') ? 'Bandcamp' :
+ url.includes('youtu') ? 'YouTube' :
+ url.includes('soundcloud') ? 'SoundCloud' :
+ '(External)'
+ }
+ `), 'or')}.
${track.contributors.length && fixWS`
Contributors:
@@ -564,15 +576,28 @@ async function writeTrackPage(track, albumData) {
`).join('\n')}
`}
- Listen on ${joinNoOxford(track.urls.map(url => fixWS`
- ${
- url.includes('bandcamp.com') ? 'Bandcamp' :
- url.includes('youtu') ? 'YouTube' :
- url.includes('soundcloud') ? 'SoundCloud' :
- '(External)'
- }
- `), 'or')}.
-
+ ${tracksReferenced.length && fixWS`
+ Tracks that ${track.name} references:
+
+ ${tracksReferenced.map(track => fixWS`
+ -
+ ${track.name}
+ by ${getArtistString(track.artists)}
+
+ `).join('\n')}
+
+ `}
+ ${tracksThatReference.length && fixWS`
+ Tracks that reference ${track.name}:
+
+ ${tracksThatReference.map(track => fixWS`
+ -
+ ${track.name}
+ by ${getArtistString(track.artists)}
+
+ `).join('\n')}
+
+ `}