« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateMusicVideoArtistsLine.js43
-rw-r--r--src/content/dependencies/generateMusicVideoDateLine.js1
2 files changed, 21 insertions, 23 deletions
diff --git a/src/content/dependencies/generateMusicVideoArtistsLine.js b/src/content/dependencies/generateMusicVideoArtistsLine.js
index 959d3648..f79fdc8c 100644
--- a/src/content/dependencies/generateMusicVideoArtistsLine.js
+++ b/src/content/dependencies/generateMusicVideoArtistsLine.js
@@ -11,31 +11,30 @@ export default {
         : null),
   }),
 
-  generate(data, relations, {html, language}) {
-    const {artistCredit} = relations;
-    const capsule = language.encapsulate('misc.musicVideo');
+  generate: (data, relations, {html, language}) =>
+    language.encapsulate('misc.musicVideo.artistsLine', artistsLineCapsule =>
+      language.encapsulate(artistsLineCapsule, workingCapsule => {
+        const workingOptions = {[language.onlyIfOptions]: ['credit']};
 
-    let artistsLineCapsule = language.encapsulate(capsule, 'artistsLine');
-    let artistsLineOptions = {[language.onlyIfOptions]: ['credit']};
+        if (data.label) {
+          workingCapsule += '.customLabel';
+          workingOptions.label = data.label;
+        }
 
-    if (data.label) {
-      artistsLineCapsule += '.customLabel';
-      artistsLineOptions.label = data.label;
-    }
+        workingOptions.credit =
+          html.tag('span', {class: 'by'},
+            {[html.onlyIfContent]: true},
 
-    artistsLineOptions.credit =
-      html.tag('span', {class: 'by'},
-        {[html.onlyIfContent]: true},
+            relations.artistCredit.slots({
+              normalStringKey:
+                language.encapsulate(artistsLineCapsule, 'credit'),
 
-        artistCredit.slots({
-          normalStringKey: language.encapsulate(capsule, 'artistsLine.credit'),
+              showAnnotation: true,
+              showChronology: true,
 
-          showAnnotation: true,
-          showChronology: true,
+              chronologyKind: 'musicVideo',
+            }));
 
-          chronologyKind: 'musicVideo',
-        }));
-
-    return language.$(artistsLineCapsule, artistsLineOptions);
-  },
-}
+        return language.$(workingCapsule, workingOptions);
+      })),
+};
diff --git a/src/content/dependencies/generateMusicVideoDateLine.js b/src/content/dependencies/generateMusicVideoDateLine.js
index 4fb281f4..40a15438 100644
--- a/src/content/dependencies/generateMusicVideoDateLine.js
+++ b/src/content/dependencies/generateMusicVideoDateLine.js
@@ -20,7 +20,6 @@ function sameDay(musicVideo, thing) {
   }
 
   return null;
-
 }
 
 export default {