« get me outta code hell

add always reference by directory to albums for mixed find - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
authorMakin <makin@protonmail.com>2025-01-25 09:31:11 +0100
committerMakin <makin@protonmail.com>2025-01-25 09:31:11 +0100
commit0be0f926421d0efb48d2eb9ac7591ef2a03e4f8e (patch)
treeb4cbbd5b0934a11c3aa6300be569ba695cda21f4 /src/data
parentdd4fc11373c63666f25fa62af7e3a515ee06400a (diff)
add always reference by directory to albums for mixed find
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/album.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 151b5087..5f1788f8 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -86,6 +86,7 @@ export class Album extends Thing {
       }),
     ],
 
+    alwaysReferenceByDirectory: flag(false),
     alwaysReferenceTracksByDirectory: flag(false),
     suffixTrackDirectories: flag(false),
 
@@ -349,6 +350,11 @@ export class Album extends Thing {
     album: {
       referenceTypes: ['album', 'album-commentary', 'album-gallery'],
       bindTo: 'albumData',
+
+      getMatchableNames: album =>
+        (album.alwaysReferenceByDirectory 
+          ? [] 
+          : [album.name]),
     },
 
     albumWithArtwork: {
@@ -357,6 +363,11 @@ export class Album extends Thing {
 
       include: album =>
         album.hasCoverArt,
+
+      getMatchableNames: album =>
+        (album.alwaysReferenceByDirectory 
+          ? [] 
+          : [album.name]),
     },
   };
 
@@ -417,6 +428,7 @@ export class Album extends Thing {
       'Directory Suffix': {property: 'directorySuffix'},
       'Suffix Track Directories': {property: 'suffixTrackDirectories'},
 
+      'Always Reference By Directory': {property: 'alwaysReferenceByDirectory'},
       'Always Reference Tracks By Directory': {
         property: 'alwaysReferenceTracksByDirectory',
       },