mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
* ci: pull version from package.json on build * fix: implicit any type * feat: inital support for logger * style: fix lint * feat: move more logging over to pino * fix: logging around company importing
51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import { MetadataSource } from "~/prisma/client";
|
|
import type { MetadataProvider } from ".";
|
|
import type {
|
|
_FetchGameMetadataParams,
|
|
GameMetadata,
|
|
_FetchCompanyMetadataParams,
|
|
CompanyMetadata,
|
|
} from "./types";
|
|
import * as jdenticon from "jdenticon";
|
|
|
|
export class ManualMetadataProvider implements MetadataProvider {
|
|
name() {
|
|
return "Manual";
|
|
}
|
|
source() {
|
|
return MetadataSource.Manual;
|
|
}
|
|
async search(_query: string) {
|
|
return [];
|
|
}
|
|
async fetchGame({
|
|
name,
|
|
createObject,
|
|
}: _FetchGameMetadataParams): Promise<GameMetadata> {
|
|
const icon = jdenticon.toPng(name, 512);
|
|
const iconId = createObject(icon);
|
|
|
|
return {
|
|
id: "manual",
|
|
name,
|
|
shortDescription: "Default description.",
|
|
description: "# Default description.",
|
|
released: new Date(),
|
|
publishers: [],
|
|
developers: [],
|
|
tags: [],
|
|
reviews: [],
|
|
|
|
icon: iconId,
|
|
coverId: iconId,
|
|
bannerId: iconId,
|
|
images: [iconId],
|
|
};
|
|
}
|
|
async fetchCompany(
|
|
_params: _FetchCompanyMetadataParams,
|
|
): Promise<CompanyMetadata | undefined> {
|
|
return undefined;
|
|
}
|
|
}
|