summaryrefslogtreecommitdiff
path: root/internal/processing/media/delete.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-02-07 08:51:15 +0000
committerLibravatar GitHub <noreply@github.com>2023-02-07 08:51:15 +0000
commitac2bdbbc62e8e3fec16497df05d01999ec7597f0 (patch)
tree652b4594c0dbae9450165740c9966b131dedbc69 /internal/processing/media/delete.go
parentIgnore missing files when cleaning up media (#1435) (diff)
downloadgotosocial-ac2bdbbc62e8e3fec16497df05d01999ec7597f0.tar.xz
[bugfix] fix file range length calculation being off by 1 (#1448)
* small formatting change * fix range handling new length calculation --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/processing/media/delete.go')
-rw-r--r--internal/processing/media/delete.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/processing/media/delete.go b/internal/processing/media/delete.go
index c0f8aa948..31e733bc7 100644
--- a/internal/processing/media/delete.go
+++ b/internal/processing/media/delete.go
@@ -39,10 +39,8 @@ func (p *processor) Delete(ctx context.Context, mediaAttachmentID string) gtserr
}
// delete the attachment
- if err := p.db.DeleteByID(ctx, mediaAttachmentID, attachment); err != nil {
- if err != db.ErrNoEntries {
- errs = append(errs, fmt.Sprintf("remove attachment: %s", err))
- }
+ if err := p.db.DeleteByID(ctx, mediaAttachmentID, attachment); err != nil && !errors.Is(err, db.ErrNoEntries) {
+ errs = append(errs, fmt.Sprintf("remove attachment: %s", err))
}
if len(errs) != 0 {