v0.7.3 - The Quality of Life Update (#2036)
* Version bump * Okay this should be the last (#2037) * Fixed improper date visualization for reading list detail page. * Correct not-read badge position (#2034) --------- Co-authored-by: Andre Smith <Hobogrammer@users.noreply.github.com> * Bump versions by dotnet-bump-version. * Merged develop in --------- Co-authored-by: Andre Smith <Hobogrammer@users.noreply.github.com>
This commit is contained in:
parent
51e23b7eca
commit
1b3866568f
235 changed files with 14827 additions and 21948 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;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.DTOs.Settings;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
|
@ -51,11 +52,8 @@ public class ServerSettingConverter : ITypeConverter<IEnumerable<ServerSetting>,
|
|||
case ServerSettingKey.InstallVersion:
|
||||
destination.InstallVersion = row.Value;
|
||||
break;
|
||||
case ServerSettingKey.ConvertBookmarkToWebP:
|
||||
destination.ConvertBookmarkToWebP = bool.Parse(row.Value);
|
||||
break;
|
||||
case ServerSettingKey.ConvertCoverToWebP:
|
||||
destination.ConvertCoverToWebP = bool.Parse(row.Value);
|
||||
case ServerSettingKey.EncodeMediaAs:
|
||||
destination.EncodeMediaAs = Enum.Parse<EncodeFormat>(row.Value);
|
||||
break;
|
||||
case ServerSettingKey.TotalBackups:
|
||||
destination.TotalBackups = int.Parse(row.Value);
|
||||
|
|
|
@ -115,21 +115,21 @@ public static class PersonHelper
|
|||
/// For a given role and people dtos, update a series
|
||||
/// </summary>
|
||||
/// <param name="role"></param>
|
||||
/// <param name="tags"></param>
|
||||
/// <param name="people"></param>
|
||||
/// <param name="series"></param>
|
||||
/// <param name="allTags"></param>
|
||||
/// <param name="allPeople"></param>
|
||||
/// <param name="handleAdd">This will call with an existing or new tag, but the method does not update the series Metadata</param>
|
||||
/// <param name="onModified"></param>
|
||||
public static void UpdatePeopleList(PersonRole role, ICollection<PersonDto>? tags, Series series, IReadOnlyCollection<Person> allTags,
|
||||
public static void UpdatePeopleList(PersonRole role, ICollection<PersonDto>? people, Series series, IReadOnlyCollection<Person> allPeople,
|
||||
Action<Person> handleAdd, Action onModified)
|
||||
{
|
||||
if (tags == null) return;
|
||||
if (people == null) return;
|
||||
var isModified = false;
|
||||
// I want a union of these 2 lists. Return only elements that are in both lists, but the list types are different
|
||||
var existingTags = series.Metadata.People.Where(p => p.Role == role).ToList();
|
||||
foreach (var existing in existingTags)
|
||||
{
|
||||
if (tags.SingleOrDefault(t => t.Id == existing.Id) == null) // This needs to check against role
|
||||
if (people.SingleOrDefault(t => t.Id == existing.Id) == null) // This needs to check against role
|
||||
{
|
||||
// Remove tag
|
||||
series.Metadata.People.Remove(existing);
|
||||
|
@ -138,9 +138,9 @@ public static class PersonHelper
|
|||
}
|
||||
|
||||
// At this point, all tags that aren't in dto have been removed.
|
||||
foreach (var tag in tags)
|
||||
foreach (var tag in people)
|
||||
{
|
||||
var existingTag = allTags.SingleOrDefault(t => t.Name == tag.Name && t.Role == tag.Role);
|
||||
var existingTag = allPeople.FirstOrDefault(t => t.Name == tag.Name && t.Role == tag.Role);
|
||||
if (existingTag != null)
|
||||
{
|
||||
if (series.Metadata.People.Where(t => t.Role == tag.Role).All(t => t.Name != null && !t.Name.Equals(tag.Name)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue