Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/skin-database/api/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export type Ctx = Express.Request;
export function getUserContext(ctx: Ctx): UserContext {
return ctx.ctx;
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ISkin } from "./CommonSkinResolver";
import { NodeResolver, toId } from "./NodeResolver";
import ReviewResolver from "./ReviewResolver";
import path from "path";
import { ID, Int } from "grats";
import SkinModel from "../../../data/SkinModel";

Expand Down
1 change: 1 addition & 0 deletions packages/skin-database/app/(modern)/scroll/SkinPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

// @ts-expect-error - unstable_ViewTransition is not yet in @types/react
import { unstable_ViewTransition as ViewTransition } from "react";
import { ClientSkin } from "./SkinScroller";
import SkinActionIcons from "./SkinActionIcons";
Expand Down
3 changes: 2 additions & 1 deletion packages/skin-database/app/(modern)/scroll/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, {
useMemo,
useCallback,
useRef,
// @ts-expect-error - unstable_ViewTransition is not yet in @types/react
unstable_ViewTransition as ViewTransition,
} from "react";

Expand Down Expand Up @@ -141,7 +142,7 @@ export default function SkinTable({
return skin ? skin.md5 : `empty-cell-${columnIndex}-${rowIndex}`;
}

const gridRef = React.useRef<any>();
const gridRef = React.useRef<any>(null);
const itemRef = React.useRef<number>(0);

const onScroll = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/skin-database/app/(modern)/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ function SkinTableUnbound({
}
return skin ? skin.hash : `unfectched-index-${requestToken}`;
}
const gridRef = React.useRef();
const itemRef = React.useRef();
const gridRef = React.useRef<any>(null);
const itemRef = React.useRef<number>(0);
React.useLayoutEffect(() => {
if (gridRef.current == null) {
return;
Expand Down
4 changes: 3 additions & 1 deletion packages/skin-database/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ async function main(): Promise<void> {

// Wait for the service to start
log("→ Waiting for service to be ready...", "cyan");
await new Promise((resolve) => setTimeout(resolve, 5000));
await new Promise((resolve) => {
setTimeout(resolve, 5000);
});

// Check if the service is running
const pm2List = execSilent("pm2 list");
Expand Down
18 changes: 11 additions & 7 deletions packages/skin-database/services/internetArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function fetchMetadata(identifier: string): Promise<any> {
}

export async function fetchTasks(identifier: string): Promise<any> {
const result = await execFile(IA_COMMAND, ['tasks', identifier], {
const result = await execFile(IA_COMMAND, ["tasks", identifier], {
env: getVenvEnv(),
});
return result.stdout
Expand All @@ -35,7 +35,7 @@ export async function uploadFile(
identifier: string,
filepath: string
): Promise<any> {
await execFile(IA_COMMAND, ['upload', identifier, filepath], {
await execFile(IA_COMMAND, ["upload", identifier, filepath], {
env: getVenvEnv(),
});
}
Expand All @@ -45,19 +45,19 @@ export async function uploadFiles(
filepaths: string[],
metadata?: { [key: string]: string }
): Promise<any> {
const args = ['upload', identifier, ...filepaths];
const args = ["upload", identifier, ...filepaths];

if (metadata) {
Object.entries(metadata).forEach(([key, value]) => {
args.push(`--metadata=${key}:${value}`);
});
}

await execFile(IA_COMMAND, args, { env: getVenvEnv() });
}

export async function identifierExists(identifier: string): Promise<boolean> {
const result = await execFile(IA_COMMAND, ['metadata', identifier], {
const result = await execFile(IA_COMMAND, ["metadata", identifier], {
env: getVenvEnv(),
});
const data = JSON.parse(result.stdout);
Expand All @@ -69,6 +69,10 @@ export async function setMetadata(
data: { [key: string]: string }
) {
const pairs = Object.entries(data).map(([key, value]) => `${key}:${value}`);
const args = ['metadata', identifier, ...pairs.map((pair) => `--modify=${pair}`)];
const args = [
"metadata",
identifier,
...pairs.map((pair) => `--modify=${pair}`),
];
await execFile(IA_COMMAND, args, { env: getVenvEnv() });
}
2 changes: 1 addition & 1 deletion packages/skin-database/tasks/syncToArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SkinModel from "../data/SkinModel";
import * as Parallel from "async-parallel";
import IaItemModel from "../data/IaItemModel";
import DiscordEventHandler from "../api/DiscordEventHandler";
import { exec, execFile } from "../utils";
import { execFile } from "../utils";
import * as IAService from "../services/internetArchive";

export async function findItemsMissingImages(): Promise<string[]> {
Expand Down