Bugfix/webtoon lastpage (#757)
* Some small changes to how maxPage is handled for better page tracking on webtoon reader. * Fixed a bug in cover image selection (#756) * Refactored webtoon reader to report page progress exactly as manga reader does. In addition, manga reader moved progress saving to setPageNumber making them the same.
This commit is contained in:
parent
a0db5b0e41
commit
6eb5c34695
5 changed files with 36 additions and 34 deletions
|
@ -138,6 +138,22 @@ namespace API.Services
|
|||
|
||||
if (!string.IsNullOrEmpty(nonNestedFile)) return nonNestedFile;
|
||||
|
||||
// Check the first folder and sort within that to see if we can find a file, else fallback to first file with basic sort.
|
||||
// Get first folder, then sort within that
|
||||
var firstDirectoryFile = fullNames.OrderBy(Path.GetDirectoryName, new NaturalSortComparer()).FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(firstDirectoryFile))
|
||||
{
|
||||
var firstDirectory = Path.GetDirectoryName(firstDirectoryFile);
|
||||
if (!string.IsNullOrEmpty(firstDirectory))
|
||||
{
|
||||
var firstDirectoryResult = fullNames.Where(f => firstDirectory.Equals(Path.GetDirectoryName(f)))
|
||||
.OrderBy(Path.GetFileName, new NaturalSortComparer())
|
||||
.FirstOrDefault();
|
||||
|
||||
if (!string.IsNullOrEmpty(firstDirectoryResult)) return firstDirectoryResult;
|
||||
}
|
||||
}
|
||||
|
||||
var result = fullNames
|
||||
.OrderBy(Path.GetFileName, new NaturalSortComparer())
|
||||
.FirstOrDefault();
|
||||
|
@ -159,7 +175,7 @@ namespace API.Services
|
|||
/// <returns></returns>
|
||||
public string GetCoverImage(string archivePath, string fileName)
|
||||
{
|
||||
if (archivePath == null || !IsValidArchive(archivePath)) return String.Empty;
|
||||
if (archivePath == null || !IsValidArchive(archivePath)) return string.Empty;
|
||||
try
|
||||
{
|
||||
var libraryHandler = CanOpen(archivePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue