« get me outta code hell

urls: /vgm-album/ -> /album/vgm/ - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-28 14:50:30 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-28 14:50:30 -0300
commit938fa447722c5db6679d4c6ccbfbc876b6b54190 (patch)
tree38c8e2ed9eeb831d8f660f6a995961b14029d61c
parent5dd1ffc055a3656d8f3fec3c8ffe4a2b1fd59237 (diff)
urls: /vgm-album/ -> /album/vgm/
-rw-r--r--src/data/things/album/Album.js29
-rw-r--r--src/static/js/client-util.js2
-rw-r--r--src/urls-default.yaml10
3 files changed, 31 insertions, 10 deletions
diff --git a/src/data/things/album/Album.js b/src/data/things/album/Album.js
index 369186f3..2a21d52e 100644
--- a/src/data/things/album/Album.js
+++ b/src/data/things/album/Album.js
@@ -32,8 +32,6 @@ import {
 } from '#yaml';
 
 import {withFlattenedList, withPropertyFromList} from '#composite/data';
-import {withRecontextualizedContributionList, withResolvedContribs}
-  from '#composite/wiki-data';
 
 import {
   exitWithoutDependency,
@@ -44,6 +42,12 @@ import {
 } from '#composite/control-flow';
 
 import {
+  withDirectory,
+  withRecontextualizedContributionList,
+  withResolvedContribs,
+} from '#composite/wiki-data';
+
+import {
   color,
   commentatorArtists,
   constitutibleArtwork,
@@ -51,7 +55,6 @@ import {
   contentString,
   contributionList,
   dimensions,
-  directory,
   fileExtension,
   flag,
   hasArtwork,
@@ -120,7 +123,25 @@ export class Album extends Thing {
       },
     },
 
-    directory: directory(),
+    directory: [
+      withDirectory({
+        directory:
+          input.updateValue({
+            validate(value) {
+              isDirectory(value);
+
+              if (value === 'vgm') {
+                throw new Error(
+                  `"vgm" is a reserved directory and can't be used albums`);
+              }
+
+              return true;
+            },
+          }),
+      }),
+
+      exposeDependency('#directory'),
+    ],
 
     directorySuffixForTracks: [
       exposeUpdateValueOrContinue({
diff --git a/src/static/js/client-util.js b/src/static/js/client-util.js
index 51fbb1f0..de54945c 100644
--- a/src/static/js/client-util.js
+++ b/src/static/js/client-util.js
@@ -103,7 +103,7 @@ export const openArtist = d => rebase(`artist/${d}/`);
 export const openFlash = d => rebase(`flash/${d}/`);
 export const openGroup = d => rebase(`group/${d}/`);
 export const openTrack = d => rebase(`track/${d}/`);
-export const openVGMAlbum = d => rebase(`vgm-album/${d}/`);
+export const openVGMAlbum = d => rebase(`album/vgm/${d}/`);
 
 // TODO: This should also use urlSpec.
 
diff --git a/src/urls-default.yaml b/src/urls-default.yaml
index e67bce39..95abedd7 100644
--- a/src/urls-default.yaml
+++ b/src/urls-default.yaml
@@ -68,11 +68,11 @@ localized:
     trackReferencedArtworks: 'track/<>/referenced-art/'
     trackReferencingArtworks: 'track/<>/referencing-art/'
 
-    vgmAlbum: 'vgm-album/<>/'
-    vgmAlbumCommentary: 'commentary/vgm-album/<>/'
-    vgmAlbumGallery: 'vgm-album/<>/gallery/'
-    vgmAlbumReferencedArtworks: 'vgm-album/<>/referenced-art/'
-    vgmAlbumReferencingArtworks: 'vgm-album/<>/referencing-art/'
+    vgmAlbum: 'album/vgm/<>/'
+    vgmAlbumCommentary: 'commentary/album/vgm/<>/'
+    vgmAlbumGallery: 'album/vgm/<>/gallery/'
+    vgmAlbumReferencedArtworks: 'album/vgm/<>/referenced-art/'
+    vgmAlbumReferencingArtworks: 'album/vgm/<>/referencing-art/'
 
 # This gets automatically switched in place when working from
 # a baseDirectory, so it should never be referenced manually.