Fix various file upload issues across server

This commit is contained in:
Jesse Wierzbinski 2024-04-09 16:54:33 -10:00
parent 724b11da4b
commit dc2fb029f5
No known key found for this signature in database
4 changed files with 11 additions and 11 deletions

2
cli.ts
View file

@ -1251,7 +1251,7 @@ const cliBuilder = new CliBuilder([
return 1; return 1;
} }
newUrl = getUrl(metadata.uploadedFile.name, config); newUrl = getUrl(metadata.path, config);
console.log( console.log(
`${chalk.green("✓")} Uploaded emoji to object storage`, `${chalk.green("✓")} Uploaded emoji to object storage`,

View file

@ -178,9 +178,9 @@ export default apiRoute<{
); );
} }
const { uploadedFile } = await mediaManager.addFile(avatar); const { path } = await mediaManager.addFile(avatar);
user.avatar = getUrl(uploadedFile.name, config); user.avatar = getUrl(path, config);
} }
if (header) { if (header) {
@ -192,9 +192,9 @@ export default apiRoute<{
); );
} }
const { uploadedFile } = await mediaManager.addFile(header); const { path } = await mediaManager.addFile(header);
user.header = getUrl(uploadedFile.name, config); user.header = getUrl(path, config);
} }
if (locked) { if (locked) {

View file

@ -74,8 +74,8 @@ export default apiRoute<{
} }
if (thumbnail) { if (thumbnail) {
const { uploadedFile } = await mediaManager.addFile(thumbnail); const { path } = await mediaManager.addFile(thumbnail);
thumbnailUrl = getUrl(uploadedFile.name, config); thumbnailUrl = getUrl(path, config);
} }
const descriptionText = description || attachment.description; const descriptionText = description || attachment.description;

View file

@ -121,17 +121,17 @@ export default apiRoute<{
} }
if (isImage) { if (isImage) {
const { uploadedFile } = await mediaManager.addFile(file); const { path } = await mediaManager.addFile(file);
url = getUrl(uploadedFile.name, config); url = getUrl(path, config);
} }
let thumbnailUrl = ""; let thumbnailUrl = "";
if (thumbnail) { if (thumbnail) {
const { uploadedFile } = await mediaManager.addFile(thumbnail); const { path } = await mediaManager.addFile(thumbnail);
thumbnailUrl = getUrl(uploadedFile.name, config); thumbnailUrl = getUrl(path, config);
} }
const newAttachment = await client.attachment.create({ const newAttachment = await client.attachment.create({