« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/album/Album.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/album/Album.js')
-rw-r--r--src/data/things/album/Album.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/data/things/album/Album.js b/src/data/things/album/Album.js
index 48d52223..8dcc6854 100644
--- a/src/data/things/album/Album.js
+++ b/src/data/things/album/Album.js
@@ -14,6 +14,7 @@ import {
   parseCreditingSources,
   parseDate,
   parseDimensions,
+  parseMusicVideos,
   parseWallpaperParts,
 } from '#yaml';
 
@@ -76,6 +77,7 @@ export class Album extends Thing {
     CommentaryEntry,
     CreditingSourcesEntry,
     Group,
+    MusicVideo,
     TrackArtistContribution,
     TrackSection,
     WikiInfo,
@@ -350,6 +352,10 @@ export class Album extends Thing {
       find: soupyFind.input('group'),
     }),
 
+    // > Update & expose - Music videos
+
+    musicVideos: thingList(V(MusicVideo)),
+
     // > Update & expose - Content entries
 
     commentary: thingList(V(CommentaryEntry)),
@@ -744,6 +750,13 @@ export class Album extends Thing {
 
       'Groups': {property: 'groups'},
 
+      // Music videos
+
+      'Music Videos': {
+        property: 'musicVideos',
+        transform: parseMusicVideos,
+      },
+
       // Content entries
 
       'Commentary': {
@@ -843,6 +856,18 @@ export class Album extends Thing {
     ];
   }
 
+  getOwnMusicVideoCoverPath(musicVideo) {
+    // Lala, same shenanigan as above, this is media.trackCover
+    // where it shouldn't be.
+
+    return [
+      'media.trackCover',
+      this.directory,
+      musicVideo.unqualifiedDirectory,
+      musicVideo.coverArtFileExtension,
+    ];
+  }
+
   // As of writing, albums don't even have a `duration` property...
   // so this function will never be called... but the message stands...
   countOwnContributionInDurationTotals(_contrib) {