added missing thumbnail deletion on media delete
Build and Push Image / build-and-push (push) Failing after 4m14s

This commit is contained in:
2026-05-02 13:42:52 -04:00
parent 61d70aee28
commit e81d432b1f
4 changed files with 43 additions and 2 deletions
+18
View File
@@ -20,6 +20,7 @@ using SixLabors.ImageSharp.Processing;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
@@ -53,6 +54,23 @@ public class ThumbnailService(IMongoDatabase db, AobaService aobaService)
return null;
}
public async Task<Error?> DeleteThumbnailDirectAsync(ObjectId thumbnailId)
{
try
{
await _gridfs.DeleteAsync(thumbnailId);
}
catch (GridFSFileNotFoundException)
{
//Ignore if the file was not found (somehow already deleted)
}
catch (Exception e)
{
return new ExceptionError(e);
}
return null;
}
/// <summary>
///
/// </summary>