Kavita/API/DTOs/Reader/BookResourceResultDto.cs
Joe Milazzo 26ff71f42b
OPDS Enhancements, Epub fixes, and a lot more (#4035)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
Co-authored-by: Fabian Pammer <fpammer@mantro.net>
Co-authored-by: Vinícius Licz <vinilicz@gmail.com>
2025-09-20 13:16:21 -07:00

17 lines
638 B
C#

namespace API.DTOs.Reader;
public sealed record BookResourceResultDto
{
public bool IsSuccess { get; init; }
public string ErrorMessage { get; init; }
public byte[] Content { get; init; }
public string ContentType { get; init; }
public string FileName { get; init; }
public static BookResourceResultDto Success(byte[] content, string contentType, string fileName) =>
new() { IsSuccess = true, Content = content, ContentType = contentType, FileName = fileName };
public static BookResourceResultDto Error(string errorMessage) =>
new() { IsSuccess = false, ErrorMessage = errorMessage };
}