fixes + db changes

This commit is contained in:
tsmethurst 2021-09-10 13:30:20 +02:00
commit d74e5cde57
16 changed files with 401 additions and 78 deletions

View file

@ -46,7 +46,7 @@ func (p *processor) Update(ctx context.Context, account *gtsmodel.Account, media
if form.Description != nil {
attachment.Description = text.RemoveHTML(*form.Description)
if err := p.db.UpdateByID(ctx, mediaAttachmentID, attachment); err != nil {
if err := p.db.UpdateByPrimaryKey(ctx, attachment); err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error updating description: %s", err))
}
}
@ -58,7 +58,7 @@ func (p *processor) Update(ctx context.Context, account *gtsmodel.Account, media
}
attachment.FileMeta.Focus.X = focusx
attachment.FileMeta.Focus.Y = focusy
if err := p.db.UpdateByID(ctx, mediaAttachmentID, attachment); err != nil {
if err := p.db.UpdateByPrimaryKey(ctx, attachment); err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error updating focus: %s", err))
}
}