added missing thumbnail deletion on media delete
Build and Push Image / build-and-push (push) Failing after 4m14s
Build and Push Image / build-and-push (push) Failing after 4m14s
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user