mirror of
https://github.com/starshardstudio/peafowl.git
synced 2024-11-25 06:24:20 +00:00
Fix CMS not understanding identifier kinds
This commit is contained in:
parent
bc006a7366
commit
110c7abec9
4 changed files with 7 additions and 13 deletions
8
_cms.ts
8
_cms.ts
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue