« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/things/album.js6
-rw-r--r--src/data/things/track.js6
-rw-r--r--src/find.js2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index c9999f7c..b93c7479 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -513,9 +513,9 @@ export class Album extends Thing {
 
       bindTo: 'artworkData',
 
-      include: (artwork, {Artwork, Album}) =>
-        artwork instanceof Artwork &&
-        artwork.thing instanceof Album &&
+      include: (artwork) =>
+        artwork.isArtwork &&
+        artwork.thing.isAlbum &&
         artwork === artwork.thing.coverArtworks[0],
 
       getMatchableNames: ({thing: album}) =>
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 5b40ca4d..e65830c7 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -1150,9 +1150,9 @@ export class Track extends Thing {
 
       bindTo: 'artworkData',
 
-      include: (artwork, {Artwork, Track}) =>
-        artwork instanceof Artwork &&
-        artwork.thing instanceof Track &&
+      include: (artwork) =>
+        artwork.isArtwork &&
+        artwork.thing.isTrack &&
         artwork === artwork.thing.trackArtworks[0],
 
       getMatchableNames: ({thing: track}) =>
diff --git a/src/find.js b/src/find.js
index 7b605e97..5740ebd4 100644
--- a/src/find.js
+++ b/src/find.js
@@ -70,7 +70,7 @@ export function processAvailableMatchesByName(data, fuzz, {
   multipleNameMatches = Object.create(null),
 }) {
   for (const thing of data) {
-    if (!include(thing, thingConstructors)) continue;
+    if (!include(thing)) continue;
 
     for (const name of getMatchableNames(thing)) {
       if (typeof name !== 'string') {