mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-28 10:32:34 -04:00
Epub Text Bleeding Finally Fixed! (#4086)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Gazy Mahomar <gmahomarf@users.noreply.github.com> Co-authored-by: Stefans.A <104719225+privatestefans@users.noreply.github.com>
This commit is contained in:
@@ -244,7 +244,7 @@ public class ReadingListService : IReadingListService
|
||||
// Collect all Ids to remove
|
||||
var itemIdsToRemove = items.Where(item => item.PagesRead == item.PagesTotal).Select(item => item.Id).ToList();
|
||||
|
||||
if (!itemIdsToRemove.Any()) return true;
|
||||
if (itemIdsToRemove.Count == 0) return true;
|
||||
try
|
||||
{
|
||||
var listItems =
|
||||
@@ -360,8 +360,7 @@ public class ReadingListService : IReadingListService
|
||||
private async Task CalculateReadingListAgeRating(ReadingList readingList, IEnumerable<int> seriesIds)
|
||||
{
|
||||
var ageRating = await _unitOfWork.SeriesRepository.GetMaxAgeRatingFromSeriesAsync(seriesIds);
|
||||
if (ageRating == null) readingList.AgeRating = AgeRating.Unknown;
|
||||
else readingList.AgeRating = (AgeRating) ageRating;
|
||||
readingList.AgeRating = ageRating;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using API.Data.Metadata;
|
||||
using System.IO;
|
||||
using API.Data.Metadata;
|
||||
using API.Entities.Enums;
|
||||
|
||||
namespace API.Services.Tasks.Scanner.Parser;
|
||||
@@ -7,8 +8,26 @@ public class BookParser(IDirectoryService directoryService, IBookService bookSer
|
||||
{
|
||||
public override ParserInfo Parse(string filePath, string rootPath, string libraryRoot, LibraryType type, bool enableMetadata = true, ComicInfo comicInfo = null)
|
||||
{
|
||||
var info = bookService.ParseInfo(filePath);
|
||||
if (info == null) return null;
|
||||
ParserInfo info;
|
||||
if (enableMetadata)
|
||||
{
|
||||
info = bookService.ParseInfo(filePath);
|
||||
if (info == null) return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fileName = directoryService.FileSystem.Path.GetFileNameWithoutExtension(filePath);
|
||||
info = new ParserInfo
|
||||
{
|
||||
Filename = Path.GetFileName(filePath),
|
||||
Format = MangaFormat.Epub,
|
||||
Title = Parser.RemoveExtensionIfSupported(fileName)!,
|
||||
FullFilePath = Parser.NormalizePath(filePath),
|
||||
Series = Parser.ParseSeries(fileName, type),
|
||||
Chapters = Parser.ParseChapter(fileName, type),
|
||||
Volumes = Parser.ParseVolume(fileName, type),
|
||||
};
|
||||
}
|
||||
|
||||
info.ComicInfo = comicInfo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user