starshard/peafowl
Template
1
Fork 0
mirror of https://github.com/starshardstudio/peafowl.git synced 2024-11-21 20:44:19 +00:00

Fix CMS not understanding identifier kinds

This commit is contained in:
Steffo 2024-07-04 06:10:54 +02:00
parent bc006a7366
commit 110c7abec9
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
4 changed files with 7 additions and 13 deletions

View file

@ -184,14 +184,8 @@ cms.collection(
name: "steam",
type: "object",
label: "Steam",
description: "",
description: "The game, as it is available on Steam.",
fields: [
{
name: "platform",
type: "hidden",
label: "Platform",
value: "steam",
},
{
name: "appid",
type: "text",

View file

@ -119,7 +119,7 @@ export default function(data: GameData, helpers: Lume.Helpers) {
const milestonesSeparator = ((data.identifiers?.length ?? 0) > 0) ? <hr/> : null
const identifiersRows = data.identifiers?.map((identifier: GameIdentifier, index: number) => {
switch(identifier.platform) {
switch(identifier.type) {
case "steam":
return (
<ReviewInfo.MetadataRow

View file

@ -39,7 +39,7 @@ const filenameToAppId: {[filename: string]: string | null} = {}
for(const _page of site.search.pages("game")) {
const page = _page as GameData
const file: string = page.sourcePath
const identifiers: GameIdentifier[] = page.data.identifiers.filter((i: GameIdentifier) => i.platform === "steam")
const identifiers: GameIdentifier[] = page.data.identifiers.filter((i: GameIdentifier) => i.type === "steam")
let nullify: boolean = false
for(const identifier of identifiers) {
@ -103,9 +103,9 @@ for(const game of games) {
completed_on: page?.completed_on,
mastered_on: page?.mastered_on,
identifiers: [
...(page?.identifiers?.filter(i => i.platform !== "steam") ?? []),
...(page?.identifiers?.filter(i => i.type !== "steam") ?? []),
{
platform: "steam",
type: "steam",
appid: appId,
name: game.name,
synced_on: formatDateIso(new Date())

View file

@ -3,12 +3,12 @@ import {ReviewData} from "./review.ts"
export interface GameBaseIdentifier {
platform: string,
type: string,
synced_on?: string,
}
export interface GameSteamIdentifier extends GameBaseIdentifier {
platform: "steam",
type: "steam",
appid: string,
name?: string,
}