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"))) {
|
for (const boardgame of Array.from(response.querySelectorAll("boardgame"))) {
|
||||||
const id = boardgame.attributes.getNamedItem("objectid").value;
|
const id = boardgame.attributes.getNamedItem("objectid").value;
|
||||||
const title = boardgame.querySelector("name").textContent;
|
const title = boardgame.querySelector("name").textContent;
|
||||||
const year = boardgame.querySelector("yearpublished").textContent;
|
const year = boardgame.querySelector("yearpublished")?.textContent ?? "";
|
||||||
|
|
||||||
ret.push(new BoardGameModel({
|
ret.push(new BoardGameModel({
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
englishTitle: title,
|
englishTitle: title,
|
||||||
year,
|
year,
|
||||||
} as BoardGameModel));
|
} as BoardGameModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ export class BoardGameGeekAPI extends APIModel {
|
||||||
type: MediaType.BoardGame,
|
type: MediaType.BoardGame,
|
||||||
title,
|
title,
|
||||||
englishTitle: title,
|
englishTitle: title,
|
||||||
year,
|
year: year === "0" ? "" : year,
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
url: `https://boardgamegeek.com/boardgame/${id}`,
|
url: `https://boardgamegeek.com/boardgame/${id}`,
|
||||||
id,
|
id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue