refactor(database): 🚚 Rename "Attachment" to "Media"

This commit is contained in:
Jesse Wierzbinski 2025-01-23 16:08:42 +01:00
parent bbd56b600d
commit 2f61cd8f0a
No known key found for this signature in database
21 changed files with 2429 additions and 101 deletions

View file

@ -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();