16 lines
374 B
TypeScript
16 lines
374 B
TypeScript
import { Database } from "./database";
|
|
|
|
const imgBaseURL = "https://mcg.zyg.ovh/images/cards/";
|
|
|
|
export function cardImageURL(cardid: string): string {
|
|
return `${imgBaseURL}${cardid}.webp`;
|
|
}
|
|
|
|
export async function cardImageSource() {
|
|
if (!Database) {
|
|
return "remote";
|
|
}
|
|
const count = await Database.images.count();
|
|
return count > 1900 ? "local" : "remote";
|
|
}
|