mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 04:04:19 -04:00
* Started working on a report problems implementation. * Started code * Added logging to book and archive service. * Removed an additional ComicInfo read when comicinfo is null when trying to load. But we've already done it once earlier, so there really isn't any point. * Added basic implementation for media errors. * MediaErrors will ignore duplicate errors when there are multiple issues on same file in a scan. * Fixed unit tests * Basic code in place to view and clear. Just UI Cleanup needed. * Slight css upgrade * Fixed up centering and simplified the code to use regular array instead of observables as it wasn't working. * Fixed unit tests * Fixed unit tests for real
32 lines
753 B
C#
32 lines
753 B
C#
using System.IO;
|
|
using API.Entities;
|
|
|
|
namespace API.Helpers.Builders;
|
|
|
|
public class MediaErrorBuilder : IEntityBuilder<MediaError>
|
|
{
|
|
private readonly MediaError _mediaError;
|
|
public MediaError Build() => _mediaError;
|
|
|
|
public MediaErrorBuilder(string filePath)
|
|
{
|
|
_mediaError = new MediaError()
|
|
{
|
|
FilePath = filePath,
|
|
Extension = Path.GetExtension(filePath).Replace(".", string.Empty).ToUpperInvariant()
|
|
};
|
|
}
|
|
|
|
public MediaErrorBuilder WithComment(string comment)
|
|
{
|
|
_mediaError.Comment = comment.Trim();
|
|
return this;
|
|
}
|
|
|
|
public MediaErrorBuilder WithDetails(string details)
|
|
{
|
|
_mediaError.Details = details.Trim();
|
|
return this;
|
|
}
|
|
}
|