Fix issue with search results without yearpublished tag
This commit is contained in:
parent
47d59278a6
commit
3d4041cf16
1 changed files with 3 additions and 3 deletions
|
|
@ -41,14 +41,14 @@ export class BoardGameGeekAPI extends APIModel {
|
|||
for (const boardgame of Array.from(response.querySelectorAll("boardgame"))) {
|
||||
const id = boardgame.attributes.getNamedItem("objectid").value;
|
||||
const title = boardgame.querySelector("name").textContent;
|
||||
const year = boardgame.querySelector("yearpublished").textContent;
|
||||
const year = boardgame.querySelector("yearpublished")?.textContent ?? "";
|
||||
|
||||
ret.push(new BoardGameModel({
|
||||
dataSource: this.apiName,
|
||||
id,
|
||||
title,
|
||||
englishTitle: title,
|
||||
year,
|
||||
year,
|
||||
} as BoardGameModel));
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ export class BoardGameGeekAPI extends APIModel {
|
|||
type: MediaType.BoardGame,
|
||||
title,
|
||||
englishTitle: title,
|
||||
year,
|
||||
year: year === "0" ? "" : year,
|
||||
dataSource: this.apiName,
|
||||
url: `https://boardgamegeek.com/boardgame/${id}`,
|
||||
id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue