« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/album.js15
-rw-r--r--src/data/things/artist.js6
-rw-r--r--src/data/things/flash.js6
-rw-r--r--src/data/things/track.js19
-rw-r--r--src/data/things/wiki-info.js6
5 files changed, 11 insertions, 41 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index c012c243..06982903 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -128,6 +128,9 @@ export class Album extends Thing {
 
     commentatorArtists: Thing.common.commentatorArtists(),
 
+    groups: Thing.common.dynamicThingsFromReferenceList('groupsByRef', 'groupData', find.group),
+    artTags: Thing.common.dynamicThingsFromReferenceList('artTagsByRef', 'artTagData', find.artTag),
+
     hasCoverArt: Thing.common.contribsPresent('coverArtistContribsByRef'),
     hasWallpaperArt: Thing.common.contribsPresent('wallpaperArtistContribsByRef'),
     hasBannerArt: Thing.common.contribsPresent('bannerArtistContribsByRef'),
@@ -146,18 +149,6 @@ export class Album extends Thing {
             : [],
       },
     },
-
-    groups: Thing.common.dynamicThingsFromReferenceList(
-      'groupsByRef',
-      'groupData',
-      find.group
-    ),
-
-    artTags: Thing.common.dynamicThingsFromReferenceList(
-      'artTagsByRef',
-      'artTagData',
-      find.artTag
-    ),
   });
 
   static [Thing.getSerializeDescriptors] = ({
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index bde84cfa..b2383057 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -111,10 +111,8 @@ export class Artist extends Thing {
       },
     },
 
-    flashesAsContributor: Artist.filterByContrib(
-      'flashData',
-      'contributorContribs'
-    ),
+    flashesAsContributor:
+      Artist.filterByContrib('flashData', 'contributorContribs'),
   });
 
   static [Thing.getSerializeDescriptors] = ({
diff --git a/src/data/things/flash.js b/src/data/things/flash.js
index 445fd07c..3f870c51 100644
--- a/src/data/things/flash.js
+++ b/src/data/things/flash.js
@@ -141,10 +141,6 @@ export class FlashAct extends Thing {
 
     // Expose only
 
-    flashes: Thing.common.dynamicThingsFromReferenceList(
-      'flashesByRef',
-      'flashData',
-      find.flash
-    ),
+    flashes: Thing.common.dynamicThingsFromReferenceList('flashesByRef', 'flashData', find.flash),
   })
 }
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 3a4e1585..74713a00 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -167,11 +167,7 @@ export class Track extends Thing {
     // not generally relevant information). It's also not guaranteed that
     // dataSourceAlbum is available (depending on the Track creator to optionally
     // provide dataSourceAlbumByRef).
-    dataSourceAlbum: Thing.common.dynamicThingFromSingleReference(
-      'dataSourceAlbumByRef',
-      'albumData',
-      find.album
-    ),
+    dataSourceAlbum: Thing.common.dynamicThingFromSingleReference('dataSourceAlbumByRef', 'albumData', find.album),
 
     date: Thing.composite.from(`Track.date`, [
       Thing.composite.exposeDependencyOrContinue('dateFirstReleased'),
@@ -303,6 +299,8 @@ export class Track extends Thing {
       Thing.common.dynamicThingsFromReferenceList('sampledTracksByRef', 'trackData', find.track),
     ]),
 
+    artTags: Thing.common.dynamicThingsFromReferenceList('artTagsByRef', 'artTagData', find.artTag),
+
     // Specifically exclude re-releases from this list - while it's useful to
     // get from a re-release to the tracks it references, re-releases aren't
     // generally relevant from the perspective of the tracks being referenced.
@@ -342,16 +340,7 @@ export class Track extends Thing {
       },
     },
 
-    featuredInFlashes: Thing.common.reverseReferenceList(
-      'flashData',
-      'featuredTracks'
-    ),
-
-    artTags: Thing.common.dynamicThingsFromReferenceList(
-      'artTagsByRef',
-      'artTagData',
-      find.artTag
-    ),
+    featuredInFlashes: Thing.common.reverseReferenceList('flashData', 'featuredTracks'),
   });
 
   static composite = {
diff --git a/src/data/things/wiki-info.js b/src/data/things/wiki-info.js
index e906cab1..e8279987 100644
--- a/src/data/things/wiki-info.js
+++ b/src/data/things/wiki-info.js
@@ -59,10 +59,6 @@ export class WikiInfo extends Thing {
 
     // Expose only
 
-    divideTrackListsByGroups: Thing.common.dynamicThingsFromReferenceList(
-      'divideTrackListsByGroupsByRef',
-      'groupData',
-      find.group
-    ),
+    divideTrackListsByGroups: Thing.common.dynamicThingsFromReferenceList('divideTrackListsByGroupsByRef', 'groupData', find.group),
   });
 }