« get me outta code hell

data: tidy things folder & imports, nicer fields yaml spec - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/group.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-20 17:23:37 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-30 07:59:39 -0400
commit98c2012c0c6233fe3f70ba215c19f6d39d7e1e34 (patch)
treea64dfa62e4134785ad5a4b9b03baaed47aa0854c /src/data/things/group.js
parent4739ac5fae824c6c985fca9ae34f6335f5c9c13e (diff)
data: tidy things folder & imports, nicer fields yaml spec
Diffstat (limited to 'src/data/things/group.js')
-rw-r--r--src/data/things/group.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/data/things/group.js b/src/data/things/group.js
index a9708fb..fe04dfa 100644
--- a/src/data/things/group.js
+++ b/src/data/things/group.js
@@ -1,5 +1,6 @@
 import {input} from '#composite';
 import find from '#find';
+import Thing from '#thing';
 
 import {
   color,
@@ -11,8 +12,6 @@ import {
   wikiData,
 } from '#composite/wiki-properties';
 
-import Thing from './thing.js';
-
 export class Group extends Thing {
   static [Thing.referenceType] = 'group';
 
@@ -87,13 +86,13 @@ export class Group extends Thing {
   });
 
   static [Thing.yamlDocumentSpec] = {
-    propertyFieldMapping: {
-      name: 'Group',
-      directory: 'Directory',
-      description: 'Description',
-      urls: 'URLs',
+    fields: {
+      'Group': {property: 'name'},
+      'Directory': {property: 'directory'},
+      'Description': {property: 'description'},
+      'URLs': {property: 'urls'},
 
-      featuredAlbums: 'Featured Albums',
+      'Featured Albums': {property: 'featuredAlbums'},
     },
 
     ignoredFields: ['Review Points'],
@@ -126,9 +125,9 @@ export class GroupCategory extends Thing {
   });
 
   static [Thing.yamlDocumentSpec] = {
-    propertyFieldMapping: {
-      name: 'Category',
-      color: 'Color',
+    fields: {
+      'Category': {property: 'name'},
+      'Color': {property: 'color'},
     },
   };
 }