- Classify .gif as EAssetType.Video via MimeTypes (moved image/gif to the Video registry)
- Add MediaRepository.GetConvertedData, served by the existing media/{id} endpoint
when a converted file exists on disk (with a fallback + warning log if missing)
- Expose the converted MIME type on AssetPreviewDto/AlbumAssetPreviewDto
so the frontend can detect video assets from a single MimeType field
47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using Butter.Types;
|
|
|
|
namespace Butter.Dtos.Album;
|
|
|
|
/// <summary>
|
|
/// Minimal asset info needed for displaying album assets.
|
|
/// </summary>
|
|
public class AlbumAssetPreviewDto {
|
|
/// <summary>
|
|
/// Gets or sets the asset ID.
|
|
/// </summary>
|
|
public Guid Id { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the resolution width.
|
|
/// </summary>
|
|
public int ResolutionWidth { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the resolution height.
|
|
/// </summary>
|
|
public int ResolutionHeight { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets whether the asset has a thumbnail.
|
|
/// </summary>
|
|
public bool HasThumbnail { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets whether the asset has a preview.
|
|
/// </summary>
|
|
public bool HasPreview { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the MIME type of the asset's display media. For animated assets this is the
|
|
/// converted video MIME type (e.g. "video/mp4"); otherwise the original MIME type.
|
|
/// </summary>
|
|
public string MimeType { get; set; } = string.Empty;
|
|
/// <summary>
|
|
/// Gets or sets the original filename of the asset.
|
|
/// </summary>
|
|
public string? FileName { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the visibility level. Only populated for curators and admins.
|
|
/// </summary>
|
|
public EVisibility? Visibility { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the soft-delete timestamp. Only populated for admins and the asset uploader.
|
|
/// </summary>
|
|
public DateTime? DeletedAt { get; set; }
|
|
}
|