mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 00:48:18 +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;
|
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`,
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue