Chore: format

This commit is contained in:
MotorTruck1221 2024-10-16 03:12:18 -06:00
parent 7d325d424a
commit c18f175b08
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4
8 changed files with 236 additions and 195 deletions

View file

@ -1,12 +1,12 @@
import chalk from "chalk";
import { CatalogModel, Catalog } from "./server.js";
import { ModelStatic } from "sequelize";
import { fileURLToPath } from "node:url";
import ora from 'ora';
import chalk from "chalk";
import ora from "ora";
import { ModelStatic } from "sequelize";
import { Catalog, CatalogModel } from "./server.js";
interface Items extends Omit<Catalog, "background_video" | "background_image"> {
background_video?: string
background_image?: string
background_video?: string;
background_image?: string;
}
async function installItems(db: ModelStatic<CatalogModel>, items: Items[]) {
@ -30,35 +30,35 @@ async function installItems(db: ModelStatic<CatalogModel>, items: Items[]) {
async function setupDB(db: ModelStatic<CatalogModel>) {
//We have some packages that need to be installed if they aren't.
const items: Items[] = [
{
package_name: 'com.nebula.gruvbox',
title: 'Gruvbox',
image: 'gruvbox.jpeg',
author: 'Nebula Services',
version: '1.0.0',
description: 'The gruvbox theme',
{
package_name: "com.nebula.gruvbox",
title: "Gruvbox",
image: "gruvbox.jpeg",
author: "Nebula Services",
version: "1.0.0",
description: "The gruvbox theme",
tags: ["Theme", "Simple"],
payload: "gruvbox.css",
type: 'theme'
type: "theme"
},
{
package_name: 'com.nebula.oled',
title: 'Oled theme',
image: 'oled.jpg',
author: 'Nebula Services',
version: '1.0.0',
description: 'A sleek & simple Oled theme for Nebula',
tags: ['Theme', 'Simple', 'Sleek'],
payload: 'oled.css',
type: 'theme'
package_name: "com.nebula.oled",
title: "Oled theme",
image: "oled.jpg",
author: "Nebula Services",
version: "1.0.0",
description: "A sleek & simple Oled theme for Nebula",
tags: ["Theme", "Simple", "Sleek"],
payload: "oled.css",
type: "theme"
}
]
];
const dbItems = await db.findAll();
if (dbItems.length === 0) {
const spinner = ora(chalk.hex('#7967dd')('Performing DB setup...')).start();
const spinner = ora(chalk.hex("#7967dd")("Performing DB setup...")).start();
await installItems(db, items);
spinner.succeed(chalk.hex('#eb6f92')('DB setup complete!'));
spinner.succeed(chalk.hex("#eb6f92")("DB setup complete!"));
}
}
export { setupDB }
export { setupDB };