« 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.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/data/things/album/Album.js b/src/data/things/album/Album.js
index 1a07656a..b89770aa 100644
--- a/src/data/things/album/Album.js
+++ b/src/data/things/album/Album.js
@@ -519,6 +519,30 @@ export class Album extends Thing {
 
     isAlbum: exposeConstant(V(true)),
 
+    nameForReferencingAcrossWiki: [
+      {
+        dependencies: ['alwaysReferenceByDirectory'],
+        compute: (continuation, {alwaysReferenceByDirectory}) =>
+          (alwaysReferenceByDirectory
+            ? continuation.exit(null)
+            : continuation()),
+      },
+
+      exposeDependency('nameForSorting'),
+    ],
+
+    nameForSorting: [
+      {
+        dependencies: ['name', 'nameDetail'],
+        compute: (continuation, {name, nameDetail}) =>
+          (nameDetail
+            ? continuation.exit(`${name} (${nameDetail})`)
+            : continuation()),
+      },
+
+      exposeDependency('name'),
+    ],
+
     commentatorArtists: commentatorArtists(),
 
     tracks: [