Skip to content

Conversation

Lorite
Copy link

@Lorite Lorite commented Sep 16, 2025

…ies, boardgame mechanics, awards, description, language dependence, best with players, recommended with players

…ies, boardgame mechanics, awards, description, language dependence, best with players, recommended with players
const publishers = Array.from(boardgame.querySelectorAll('boardgamepublisher'))
.map(n => n.textContent)
.filter(n => n !== null);
const boardGameFamilies = Array.from(boardgame.querySelectorAll('boardgamefamily'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to include some not very relevant categories for some games.

const minPlayers = Number.parseFloat(boardgame.querySelector('minplayers')?.textContent ?? '0');
const maxPlayers = Number.parseFloat(boardgame.querySelector('maxplayers')?.textContent ?? '0');
const playtime = (boardgame.querySelector('playingtime')?.textContent ?? 'unknown') + ' minutes';
const age = Number.parseFloat(boardgame.querySelector('age')?.textContent ?? '0');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

age is a quite generic term. Is this the recommended age, or the minimum age to play?


const bestWithPlayers =
response.querySelector('poll-summary[name=suggested_numplayers] result[name=bestwith]')?.attributes.getNamedItem('value')?.value ?? '';
const recommendedWithPlayers =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only including one of those two would be better, as we already have min and max players.

playtime: string;
age: number;
publishers: string[];
boardGameFamilies?: string[];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new properties could be better sorted. E.g. all the player counts together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants