Misc Fixes and Changes (#927)

* Cleaned up a ton of warnings/suggestions from the IDE.

* Fixed a bug when clearing the filters some presets could be undone.

* Renamed a class in the OPDS spec

* Simplified logic for when Fit To Screen rendering logic occurs. It now works always rather than only on cover images.

* Give some additional info to the user on what the differences between Library Types are

* Don't scan .qpkg folders (QNAP devices)

* Refactored some code to enable ability to test CoverImage Test. This is a broken test, test.zip is waiting on an issue in NetVips.

* Fixed an issue where Extra might get flagged as special too early, if in a word like Extraordinary

* Cleaned up the regex for the extra issue to be more flexible
This commit is contained in:
Joseph Milazzo 2022-01-12 15:00:00 -08:00 committed by GitHub
parent 6afc17e93e
commit fb71d54fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 162 additions and 361 deletions

View file

@ -52,7 +52,7 @@ namespace API.Data
{
var stream = new MemoryStream(series.CoverImage);
stream.Position = 0;
imageService.WriteCoverThumbnail(stream, ImageService.GetSeriesFormat(int.Parse(series.Id)));
imageService.WriteCoverThumbnail(stream, ImageService.GetSeriesFormat(int.Parse(series.Id)), directoryService.CoverImageDirectory);
}
catch (Exception e)
{
@ -78,7 +78,7 @@ namespace API.Data
{
var stream = new MemoryStream(chapter.CoverImage);
stream.Position = 0;
imageService.WriteCoverThumbnail(stream, $"{ImageService.GetChapterFormat(int.Parse(chapter.Id), int.Parse(chapter.ParentId))}");
imageService.WriteCoverThumbnail(stream, $"{ImageService.GetChapterFormat(int.Parse(chapter.Id), int.Parse(chapter.ParentId))}", directoryService.CoverImageDirectory);
}
catch (Exception e)
{
@ -103,7 +103,7 @@ namespace API.Data
{
var stream = new MemoryStream(tag.CoverImage);
stream.Position = 0;
imageService.WriteCoverThumbnail(stream, $"{ImageService.GetCollectionTagFormat(int.Parse(tag.Id))}");
imageService.WriteCoverThumbnail(stream, $"{ImageService.GetCollectionTagFormat(int.Parse(tag.Id))}", directoryService.CoverImageDirectory);
}
catch (Exception e)
{
@ -131,6 +131,7 @@ namespace API.Data
Console.WriteLine("Updating Chapter entities");
var chapters = await context.Chapter.ToListAsync();
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
foreach (var chapter in chapters)
{
if (directoryService.FileSystem.File.Exists(directoryService.FileSystem.Path.Join(directoryService.CoverImageDirectory,
@ -161,6 +162,7 @@ namespace API.Data
Console.WriteLine("Updating Collection Tag entities");
var tags = await context.CollectionTag.ToListAsync();
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
foreach (var tag in tags)
{
if (directoryService.FileSystem.File.Exists(directoryService.FileSystem.Path.Join(directoryService.CoverImageDirectory,

View file

@ -434,6 +434,10 @@ public class SeriesRepository : ISeriesRepository
{
userLibraries = userLibraries.Where(l => filter.Libraries.Contains(l)).ToList();
}
else if (libraryId > 0)
{
userLibraries = userLibraries.Where(l => l == libraryId).ToList();
}
allPeopleIds = new List<int>();
allPeopleIds.AddRange(filter.Writers);
@ -489,7 +493,7 @@ public class SeriesRepository : ISeriesRepository
Series = s,
PagesRead = s.Progress.Where(p => p.AppUserId == userId).Sum(p => p.PagesRead),
})
.ToList()
.AsEnumerable()
.Where(s => ProgressComparison(s.PagesRead, s.Series.Pages))
.Select(s => s.Series.Id)
.ToList();