Files
drop/server/plugins/07.torrential-depot.ts
T
DecDuck f97fc25ea3 Fix torrential depot (#353)
Adds a plugin to automatically add/update the torrential depot record
2026-02-25 22:24:15 +11:00

20 lines
441 B
TypeScript

import { systemConfig } from "../internal/config/sys-conf";
import prisma from "../internal/db/database";
export default defineNitroPlugin(async () => {
const torrentialUrl = `${systemConfig.getExternalUrl()}/api/v1/depot/`;
await prisma.depot.upsert({
where: {
id: "torrential",
},
update: {
endpoint: torrentialUrl,
},
create: {
id: "torrential",
endpoint: torrentialUrl,
},
});
});