fixes + db changes (#204)

* fixes + db changes

* make duration more lenient
This commit is contained in:
tobi 2021-09-10 14:36:10 +02:00 committed by GitHub
commit e681aac589
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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))
}
}