From 6cbd0236a3c94cd29a0eb419f0eaa22e93b9f320 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 15 Apr 2022 19:49:09 -0300 Subject: make Group.category property actually work --- src/data/things.js | 2 +- src/upd8.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/data/things.js b/src/data/things.js index a4ee2e96..6ed0aa47 100644 --- a/src/data/things.js +++ b/src/data/things.js @@ -1020,7 +1020,7 @@ Group.propertyDescriptors = { expose: { dependencies: ['groupCategoryData'], compute: ({ groupCategoryData, [Group.instance]: group }) => ( - groupCategoryData?.filter(category => category.groups.includes(group)) ?? []) + groupCategoryData.find(category => category.groups.includes(group)) ?? null) } }, }; diff --git a/src/upd8.js b/src/upd8.js index 4fb86469..c40977a3 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -2943,6 +2943,8 @@ async function main() { // console.log(WD.albumData.map(a => `${a.name} (${a.date.toDateString()})`).join('\n')); // console.log(WD.groupData.find(g => g.name === 'Fandom').albums.map(a => `${a.name} (${a.date.toDateString()})`).join('\n')); // console.log(WD.trackData.find(t => t.name === 'Another Chance').commentatorArtists.map(artist => `${artist.name} - commentated ${artist.tracksAsCommentator.length} tracks, ${artist.albumsAsCommentator.length} albums`).join('\n')); + // console.log(WD.groupCategoryData.map(c => `${c.name} (${c.groups.map(g => g.name).join(', ')})`).join('\n')); + // console.log(WD.groupData.map(g => `${g.name} (${g.category?.name})`).join('\n')); // return; // Update languages o8ject with the wiki-specified default language! -- cgit 1.3.0-6-gf8a5