mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Fix various file upload issues across server
This commit is contained in:
parent
724b11da4b
commit
dc2fb029f5
2
cli.ts
2
cli.ts
|
|
@ -1251,7 +1251,7 @@ const cliBuilder = new CliBuilder([
|
|||
return 1;
|
||||
}
|
||||
|
||||
newUrl = getUrl(metadata.uploadedFile.name, config);
|
||||
newUrl = getUrl(metadata.path, config);
|
||||
|
||||
console.log(
|
||||
`${chalk.green("✓")} Uploaded emoji to object storage`,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ export default apiRoute<{
|
|||
}
|
||||
|
||||
if (thumbnail) {
|
||||
const { uploadedFile } = await mediaManager.addFile(thumbnail);
|
||||
thumbnailUrl = getUrl(uploadedFile.name, config);
|
||||
const { path } = await mediaManager.addFile(thumbnail);
|
||||
thumbnailUrl = getUrl(path, config);
|
||||
}
|
||||
|
||||
const descriptionText = description || attachment.description;
|
||||
|
|
|
|||
|
|
@ -121,17 +121,17 @@ export default apiRoute<{
|
|||
}
|
||||
|
||||
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 = "";
|
||||
|
||||
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({
|
||||
|
|
|
|||
Loading…
Reference in a new issue