Enhance BoardGameModel and BoardGameGeekAPI: Add age, boardgame famil…#216
Open
Lorite wants to merge 1 commit intomProjectsCode:masterfrom
Open
Enhance BoardGameModel and BoardGameGeekAPI: Add age, boardgame famil…#216Lorite wants to merge 1 commit intomProjectsCode:masterfrom
Lorite wants to merge 1 commit intomProjectsCode:masterfrom
Conversation
…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')) |
Owner
There was a problem hiding this comment.
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'); |
Owner
There was a problem hiding this comment.
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 = |
Owner
There was a problem hiding this comment.
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[]; |
Owner
There was a problem hiding this comment.
I think the new properties could be better sorted. E.g. all the player counts together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ies, boardgame mechanics, awards, description, language dependence, best with players, recommended with players