mirror of
https://github.com/Drop-OSS/drop
synced 2026-08-27 14:23:05 -04:00
Fix torrential depot (#353)
Adds a plugin to automatically add/update the torrential depot record
This commit is contained in:
parent
dbe34684d8
commit
f97fc25ea3
1 changed files with 19 additions and 0 deletions
19
server/plugins/07.torrential-depot.ts
Normal file
19
server/plugins/07.torrential-depot.ts
Normal 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,
|
||||
},
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue