mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-30 19:54:14 -04:00
* Implemented methods to parse out the whole ComicInfo file and a mock ComicInfo from epub files. * Removed unused imports. ScanSeries needs to cleanup deleted chapters and call RefreshMetadata. Ensure after scan we cleanup tags without any series. * Random cleanup * Added some comments about data getting stale and not updating. * Removed old Summary methods in favor of the ComicInfo versions * Added a missing property * Fixed unit test
62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using API.DTOs;
|
|
using API.DTOs.Reader;
|
|
using API.DTOs.ReadingLists;
|
|
using API.DTOs.Settings;
|
|
using API.Entities;
|
|
using API.Helpers.Converters;
|
|
using AutoMapper;
|
|
|
|
namespace API.Helpers
|
|
{
|
|
public class AutoMapperProfiles : Profile
|
|
{
|
|
public AutoMapperProfiles()
|
|
{
|
|
CreateMap<LibraryDto, Library>();
|
|
|
|
CreateMap<Volume, VolumeDto>();
|
|
|
|
CreateMap<MangaFile, MangaFileDto>();
|
|
|
|
CreateMap<Chapter, ChapterDto>();
|
|
|
|
CreateMap<Series, SeriesDto>();
|
|
|
|
CreateMap<CollectionTag, CollectionTagDto>();
|
|
|
|
CreateMap<SeriesMetadata, SeriesMetadataDto>();
|
|
|
|
CreateMap<Person, PersonDto>();
|
|
|
|
CreateMap<AppUserPreferences, UserPreferencesDto>();
|
|
|
|
CreateMap<AppUserBookmark, BookmarkDto>();
|
|
|
|
CreateMap<ReadingList, ReadingListDto>();
|
|
CreateMap<ReadingListItem, ReadingListItemDto>();
|
|
|
|
CreateMap<Series, SearchResultDto>()
|
|
.ForMember(dest => dest.SeriesId,
|
|
opt => opt.MapFrom(src => src.Id))
|
|
.ForMember(dest => dest.LibraryName,
|
|
opt => opt.MapFrom(src => src.Library.Name));
|
|
|
|
|
|
CreateMap<Library, LibraryDto>()
|
|
.ForMember(dest => dest.Folders,
|
|
opt =>
|
|
opt.MapFrom(src => src.Folders.Select(x => x.Path).ToList()));
|
|
|
|
CreateMap<AppUser, MemberDto>()
|
|
.AfterMap((ps, pst, context) => context.Mapper.Map(ps.Libraries, pst.Libraries));
|
|
|
|
CreateMap<RegisterDto, AppUser>();
|
|
|
|
CreateMap<IEnumerable<ServerSetting>, ServerSettingDto>()
|
|
.ConvertUsing<ServerSettingConverter>();
|
|
}
|
|
}
|
|
}
|