« get me outta code hell

data: Track: don't intuit directory suffix if custom directory given - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-06-10 09:10:59 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-06-10 09:11:40 -0300
commit52272a8da9a798803abd1176a8294845e8567641 (patch)
tree4f6e378538e016f58b3126b7c66cd58f2af2a2e7 /src/data/composite
parent59bc9f929be7fa10a650fce6b599f389a7d07aea (diff)
data: Track: don't intuit directory suffix if custom directory given
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/track/withDirectorySuffixes.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/data/composite/things/track/withDirectorySuffixes.js b/src/data/composite/things/track/withDirectorySuffixes.js
index 87a737db..efc66f13 100644
--- a/src/data/composite/things/track/withDirectorySuffixes.js
+++ b/src/data/composite/things/track/withDirectorySuffixes.js
@@ -121,6 +121,26 @@ export default templateCompositeFrom({
     },
 
     {
+      dependencies: [input('from'), '_directory'],
+      compute(continuation, {
+        [input('from')]: suffixDirectory,
+        ['_directory']: directory,
+      }) {
+        // If Suffix Directory is not set and Directory IS set, then
+        // no following logic should automatically provide a directory suffix
+        // (which otherwise would be tacked onto the data-given Directory).
+        if (suffixDirectory === null && directory !== null) {
+          return continuation.raiseOutput({
+            ['#directorySuffix']: null,
+            ['#directorySuffixWithinAlbum']: null,
+          });
+        }
+
+        return continuation();
+      },
+    },
+
+    {
       dependencies: [
         '_nameDetail',
          'nameDetailAcrossWiki',