Shakeout Fixes (#422)

# Fixed
- Fixed: Clean the pdf extension from Series title for PDF types
- Fixed: Fixed a bug where a forced metadata refresh wouldn't trigger a volume to force a refresh of cover image
- Fixed: Fixed an issue where Removing series no longer on disk would not use the Series Format and thus after deleting files, they would not be removed.
- Fixed: Fixed an issue with reading a single image file, where the cache code would not properly move the file
- Fixed: For Specials, Get Next/Prev Chapter should use the filename instead of arbitrary Number (which is always 0). Use the same sorting logic when requesting volumes on series detail, so sorting can happen in the backend.

# Added
- Added: (Accessibility) Nearly every page has had a title set for it 

===============================================================================

* Clean the pdf extension from ParseSeries

* Fixed a bug where forced metadata refresh wouldn't trigger the volume to update it's image.

* Added titles to most pages to help distinguish back/forward history.

Fixed a bug in the scanner which didn't account for Format when calculating if we need to remove a series not on disk.

* For Specials, Get Next/Prev Chapter should use the filename instead of arbitrary Number (which is always 0). Use the same sorting logic when requesting volumes on series detail, so sorting can happen in the backend.

* Fixed unit tests
This commit is contained in:
Joseph Milazzo 2021-07-23 18:02:14 -05:00 committed by GitHub
parent 29edadb506
commit ebd4ec25bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 143 additions and 97 deletions

View file

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using API.Entities;
using API.Entities.Enums;
using API.Interfaces.Services;
using API.Parser;
@ -38,6 +39,20 @@ namespace API.Services.Tasks.Scanner
_scannedSeries = new ConcurrentDictionary<ParsedSeries, List<ParserInfo>>();
}
public static IList<ParserInfo> GetInfosByName(Dictionary<ParsedSeries, List<ParserInfo>> parsedSeries, Series series)
{
var existingKey = parsedSeries.Keys.FirstOrDefault(ps =>
ps.Format == series.Format && ps.NormalizedName == Parser.Parser.Normalize(series.OriginalName));
existingKey ??= new ParsedSeries()
{
Format = series.Format,
Name = series.OriginalName,
NormalizedName = Parser.Parser.Normalize(series.OriginalName)
};
return parsedSeries[existingKey];
}
/// <summary>
/// Processes files found during a library scan.
/// Populates a collection of <see cref="ParserInfo"/> for DB updates later.
@ -144,7 +159,7 @@ namespace API.Services.Tasks.Scanner
{
var sw = Stopwatch.StartNew();
totalFiles = 0;
var searchPattern = GetLibrarySearchPattern(libraryType);
var searchPattern = GetLibrarySearchPattern();
foreach (var folderPath in folders)
{
try
@ -174,12 +189,7 @@ namespace API.Services.Tasks.Scanner
return SeriesWithInfos();
}
/// <summary>
/// Given the Library Type, returns the regex pattern that restricts which files types will be found during a file scan.
/// </summary>
/// <param name="libraryType"></param>
/// <returns></returns>
private static string GetLibrarySearchPattern(LibraryType libraryType)
private static string GetLibrarySearchPattern()
{
return Parser.Parser.SupportedExtensions;
}