Fix torrential depot (#353)

Adds a plugin to automatically add/update the torrential depot record
This commit is contained in:
DecDuck 2026-02-25 22:24:15 +11:00 committed by GitHub
parent dbe34684d8
commit f97fc25ea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,19 @@
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,
},
});
});