From f97fc25ea3fa25e07c00d3aea93863e41e71cdb3 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Wed, 25 Feb 2026 22:24:15 +1100 Subject: [PATCH] Fix torrential depot (#353) Adds a plugin to automatically add/update the torrential depot record --- server/plugins/07.torrential-depot.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 server/plugins/07.torrential-depot.ts diff --git a/server/plugins/07.torrential-depot.ts b/server/plugins/07.torrential-depot.ts new file mode 100644 index 00000000..d7550069 --- /dev/null +++ b/server/plugins/07.torrential-depot.ts @@ -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, + }, + }); +});