Book Feedback and small bugs (#183)
* Remove automatic retry for scanLibraries as if something fails, it wont pass magically. Catch exceptions when opening books for parsing and swallow to ignore the file. * Delete extra attempts * Switched to using FirstOrDefault for finding existing series. This will help avoid pointless crashes. * Updated message when duplicate series are found (not sure how this happens) * Fixed a negation for deleting volumes where files still exist. * Implemented the ability to automatically scale the manga reader based on screen size.
This commit is contained in:
parent
a01613f80f
commit
35a47f5d88
8 changed files with 65 additions and 23 deletions
|
|
@ -187,22 +187,37 @@ namespace API.Services
|
|||
return dict;
|
||||
}
|
||||
|
||||
public static ParserInfo ParseInfo(string filePath)
|
||||
/// <summary>
|
||||
/// Parses out Title from book. Chapters and Volumes will always be "0". If there is any exception reading book (malformed books)
|
||||
/// then null is returned.
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public ParserInfo ParseInfo(string filePath)
|
||||
{
|
||||
var epubBook = EpubReader.OpenBook(filePath);
|
||||
|
||||
return new ParserInfo()
|
||||
try
|
||||
{
|
||||
Chapters = "0",
|
||||
Edition = "",
|
||||
Format = MangaFormat.Book,
|
||||
Filename = Path.GetFileName(filePath),
|
||||
Title = epubBook.Title,
|
||||
FullFilePath = filePath,
|
||||
IsSpecial = false,
|
||||
Series = epubBook.Title,
|
||||
Volumes = "0"
|
||||
};
|
||||
var epubBook = EpubReader.OpenBook(filePath);
|
||||
|
||||
return new ParserInfo()
|
||||
{
|
||||
Chapters = "0",
|
||||
Edition = "",
|
||||
Format = MangaFormat.Book,
|
||||
Filename = Path.GetFileName(filePath),
|
||||
Title = epubBook.Title,
|
||||
FullFilePath = filePath,
|
||||
IsSpecial = false,
|
||||
Series = epubBook.Title,
|
||||
Volumes = "0"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "There was an exception when opening epub book: {FileName}", filePath);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public byte[] GetCoverImage(string fileFilePath, bool createThumbnail = true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue