mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(database): 🚚 Rename "Attachment" to "Media"
This commit is contained in:
parent
bbd56b600d
commit
2f61cd8f0a
21 changed files with 2429 additions and 101 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Attachment } from "@versia/kit/db";
|
||||
import { Media } from "@versia/kit/db";
|
||||
import { Worker } from "bullmq";
|
||||
import { config } from "~/packages/config-manager";
|
||||
import { connection } from "~/utils/redis.ts";
|
||||
|
|
@ -21,7 +21,7 @@ export const getMediaWorker = (): Worker<MediaJobData, void, MediaJobType> =>
|
|||
|
||||
await job.log(`Fetching attachment ID [${attachmentId}]`);
|
||||
|
||||
const attachment = await Attachment.fromId(attachmentId);
|
||||
const attachment = await Media.fromId(attachmentId);
|
||||
|
||||
if (!attachment) {
|
||||
throw new Error(
|
||||
|
|
@ -68,7 +68,7 @@ export const getMediaWorker = (): Worker<MediaJobData, void, MediaJobType> =>
|
|||
const { path, uploadedFile } =
|
||||
await mediaManager.addFile(processedFile);
|
||||
|
||||
const url = Attachment.getUrl(path);
|
||||
const url = Media.getUrl(path);
|
||||
|
||||
const sha256 = new Bun.SHA256();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue