feat: enhance thumbnail generation with category support and update storage paths

This commit is contained in:
2026-01-07 10:25:33 +03:30
parent 34bd7ba444
commit 2cd838a5e3
4 changed files with 34 additions and 14 deletions

View File

@@ -106,7 +106,8 @@ public class SendMessageCommandHandler : IBaseCommandHandler<SendMessageCommand,
uploadedFile.SetImageDimensions(dimensions.Value.Width, dimensions.Value.Height);
}
var thumbnail = await _thumbnailService.GenerateImageThumbnailAsync(uploadResult.StoragePath);
var thumbnail = await _thumbnailService
.GenerateImageThumbnailAsync(uploadResult.StoragePath, category: "TaskChatMessage");
if (thumbnail.HasValue)
{
uploadedFile.SetThumbnail(thumbnail.Value.ThumbnailUrl);

View File

@@ -9,15 +9,17 @@ public interface IThumbnailGeneratorService
/// تولید thumbnail برای تصویر
/// </summary>
Task<(string ThumbnailPath, string ThumbnailUrl)?> GenerateImageThumbnailAsync(
string imagePath,
int width = 200,
string imagePath,
string category,
int width = 200,
int height = 200);
/// <summary>
/// تولید thumbnail برای ویدیو
/// </summary>
Task<(string ThumbnailPath, string ThumbnailUrl)?> GenerateVideoThumbnailAsync(
string videoPath);
string videoPath,
string category);
/// <summary>
/// حذف thumbnail