🐛 Bug fixes on fragment based uploading
This commit is contained in:
@ -23,8 +23,6 @@ func openAttachment(c *fiber.Ctx) error {
|
||||
metadata, err := services.GetAttachmentByRID(id)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusNotFound)
|
||||
} else if !metadata.IsUploaded {
|
||||
return fiber.NewError(fiber.StatusNotFound, "file is in uploading progress, please wait until all chunk uploaded")
|
||||
}
|
||||
|
||||
destMap := viper.GetStringMap(fmt.Sprintf("destinations.%d", metadata.Destination))
|
||||
@ -91,7 +89,6 @@ func updateAttachmentMeta(c *fiber.Ctx) error {
|
||||
|
||||
var data struct {
|
||||
Alternative *string `json:"alt"`
|
||||
Thumbnail *string `json:"thumbnail"`
|
||||
Metadata *map[string]any `json:"metadata"`
|
||||
IsIndexable *bool `json:"is_indexable"`
|
||||
}
|
||||
@ -108,9 +105,6 @@ func updateAttachmentMeta(c *fiber.Ctx) error {
|
||||
if data.Alternative != nil {
|
||||
attachment.Alternative = *data.Alternative
|
||||
}
|
||||
if data.Thumbnail != nil {
|
||||
attachment.Thumbnail = *data.Thumbnail
|
||||
}
|
||||
if data.Metadata != nil {
|
||||
attachment.Usermeta = *data.Metadata
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ func createAttachmentDirectly(c *fiber.Ctx) error {
|
||||
MimeType: c.FormValue("mimetype"),
|
||||
Usermeta: usermeta,
|
||||
IsAnalyzed: false,
|
||||
IsUploaded: true,
|
||||
Destination: models.AttachmentDstTemporary,
|
||||
Pool: &pool,
|
||||
PoolID: &pool.ID,
|
||||
|
Reference in New Issue
Block a user