Report Media Issues (#1964)
* 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
This commit is contained in:
parent
642b23ed61
commit
d1e4878345
32 changed files with 2586 additions and 57 deletions
|
@ -4,6 +4,7 @@ using API.DTOs;
|
|||
using API.DTOs.Account;
|
||||
using API.DTOs.CollectionTags;
|
||||
using API.DTOs.Device;
|
||||
using API.DTOs.MediaErrors;
|
||||
using API.DTOs.Metadata;
|
||||
using API.DTOs.Reader;
|
||||
using API.DTOs.ReadingLists;
|
||||
|
@ -33,6 +34,7 @@ public class AutoMapperProfiles : Profile
|
|||
CreateMap<Tag, TagDto>();
|
||||
CreateMap<AgeRating, AgeRatingDto>();
|
||||
CreateMap<PublicationStatus, PublicationStatusDto>();
|
||||
CreateMap<MediaError, MediaErrorDto>();
|
||||
|
||||
CreateMap<AppUserProgress, ProgressDto>()
|
||||
.ForMember(dest => dest.PageNum,
|
||||
|
|
31
API/Helpers/Builders/MediaErrorBuilder.cs
Normal file
31
API/Helpers/Builders/MediaErrorBuilder.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue