Foundational Cover Image Rework (#584)

* Updating wording on card item when total pages is 0, to be just "Cannot Read" since it could be a non-archive file

* Refactored cover images to be stored on disk. This first commit has the extraction to disk and the metadata service to handle updating when applicable.

* Refactored code to have the actual save to cover image directory done by ImageService.

* Implemented the ability to override cover images.

* Some cleanup on Image service

* Implemented the ability to cleanup old covers nightly

* Added a migration to migrate existing covers to new cover image format (files).

* Refactored all CoverImages to just be the filename, leaving the Join with Cover directory to higher level code.

* Ensure when getting user progress, we pick the first.

* Added cleanup cover images for deleted tags. Don't pull any cover images that are blank.

* After series update, clear out cover image. No change on UI, but just keeps things clear before metadata refresh hits

* Refactored image formats for covers to ImageService.

* Fixed an issue where after refactoring how images were stored, the cleanup service was deleting them after each scan.

* Changed how ShouldUpdateCoverImage works to check if file exists or not even if cover image is locked.

* Fixed unit tests

* Added caching back to cover images.

* Caching on series as well

* Code Cleanup items

* Ensure when checking if a file exists in MetadataService, that we join for cover image directory. After we scan library, do one last filter to delete any series that have 0 pages total.

* Catch exceptions so we don't run cover migration if this is first time run.

* After a scan, only clear out the cache directory and not do a deep clean.

* Implemented the ability to backup custom locked covers only.

* Fixed unit tests

* Trying to figure out why GA crashes when running MetadataServiceTests.cs

* Some debugging on GA tests not running

* Commented out tests that were causing issues in GA.

* Fixed an issue where series cover images wouldn't migrate

* Fixed the updating of links to actually do all series and not just locked
This commit is contained in:
Joseph Milazzo 2021-09-21 17:15:29 -07:00 committed by GitHub
parent fd6925b126
commit 82b5b599e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 1928 additions and 234 deletions

View file

@ -58,7 +58,7 @@
<PackageReference Include="NetVips.Native" Version="8.11.0" />
<PackageReference Include="NReco.Logging.File" Version="1.1.2" />
<PackageReference Include="Sentry.AspNetCore" Version="3.8.3" />
<PackageReference Include="SharpCompress" Version="0.28.3" />
<PackageReference Include="SharpCompress" Version="0.29.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.27.0.35380">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@ -78,37 +78,36 @@
<ItemGroup>
<None Remove="Hangfire-log.db" />
<None Remove="obj\**" />
<None Remove="wwwroot\**" />
<None Remove="cache\**" />
<None Remove="backups\**" />
<None Remove="logs\**" />
<None Remove="temp\**" />
<None Remove="kavita.log" />
<None Remove="kavita.db" />
<None Remove="covers\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Interfaces\IMetadataService.cs" />
<Compile Remove="obj\**" />
<Compile Remove="wwwroot\**" />
<Compile Remove="cache\**" />
<Compile Remove="backups\**" />
<Compile Remove="logs\**" />
<Compile Remove="temp\**" />
<Compile Remove="covers\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="obj\**" />
<EmbeddedResource Remove="wwwroot\**" />
<EmbeddedResource Remove="cache\**" />
<EmbeddedResource Remove="backups\**" />
<EmbeddedResource Remove="logs\**" />
<EmbeddedResource Remove="temp\**" />
<EmbeddedResource Remove="covers\**" />
</ItemGroup>
<ItemGroup>
<Content Remove="obj\**" />
<Content Remove="wwwroot\**" />
<Content Remove="cache\**" />
<Content Remove="backups\**" />
<Content Remove="logs\**" />
@ -118,6 +117,7 @@
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Remove="covers\**" />
</ItemGroup>
<ItemGroup>
@ -242,6 +242,48 @@
<_ContentIncludedByDefault Remove="wwwroot\styles.4bd902bb3037f36f2c64.css.map" />
<_ContentIncludedByDefault Remove="wwwroot\vendor.6b2a0912ae80e6fd297f.js" />
<_ContentIncludedByDefault Remove="wwwroot\vendor.6b2a0912ae80e6fd297f.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\10.b727db78581442412e9a.js" />
<_ContentIncludedByDefault Remove="wwwroot\10.b727db78581442412e9a.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\2.fcc031071e80d6837012.js" />
<_ContentIncludedByDefault Remove="wwwroot\2.fcc031071e80d6837012.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\7.c30da7d2e809fa05d1e3.js" />
<_ContentIncludedByDefault Remove="wwwroot\7.c30da7d2e809fa05d1e3.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\8.d4c77a90c95e9861656a.js" />
<_ContentIncludedByDefault Remove="wwwroot\8.d4c77a90c95e9861656a.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\9.489b177dd1a6beeb35ad.js" />
<_ContentIncludedByDefault Remove="wwwroot\9.489b177dd1a6beeb35ad.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\assets\fonts\Spartan\OFL.txt" />
<_ContentIncludedByDefault Remove="wwwroot\assets\fonts\Spartan\Spartan-VariableFont_wght.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\android-chrome-192x192.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\android-chrome-256x256.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\apple-touch-icon.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\browserconfig.xml" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\favicon-16x16.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\favicon-32x32.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\favicon.ico" />
<_ContentIncludedByDefault Remove="wwwroot\assets\icons\mstile-150x150.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\images\image-reset-cover-min.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\images\image-reset-cover.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\images\kavita-book-cropped.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\images\login-bg.jpg" />
<_ContentIncludedByDefault Remove="wwwroot\assets\images\logo.png" />
<_ContentIncludedByDefault Remove="wwwroot\common.fbf71de364f5a1f37413.js" />
<_ContentIncludedByDefault Remove="wwwroot\common.fbf71de364f5a1f37413.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\login-bg.8860e6ff9d2a3598539c.jpg" />
<_ContentIncludedByDefault Remove="wwwroot\main.a3a1e647a39145accff3.js" />
<_ContentIncludedByDefault Remove="wwwroot\main.a3a1e647a39145accff3.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\polyfills.3dda3bf3d087e5d131ba.js" />
<_ContentIncludedByDefault Remove="wwwroot\polyfills.3dda3bf3d087e5d131ba.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\runtime.b9818dfc90f418b3f0a7.js" />
<_ContentIncludedByDefault Remove="wwwroot\runtime.b9818dfc90f418b3f0a7.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\scripts.7d1c78b2763c483bb699.js" />
<_ContentIncludedByDefault Remove="wwwroot\scripts.7d1c78b2763c483bb699.js.map" />
<_ContentIncludedByDefault Remove="wwwroot\site.webmanifest" />
<_ContentIncludedByDefault Remove="wwwroot\Spartan-VariableFont_wght.0427aac0d980a12ae8ba.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\styles.85a58cb3e4a4b1add864.css" />
<_ContentIncludedByDefault Remove="wwwroot\styles.85a58cb3e4a4b1add864.css.map" />
<_ContentIncludedByDefault Remove="wwwroot\vendor.54bf44a9aa720ff8881d.js" />
<_ContentIncludedByDefault Remove="wwwroot\vendor.54bf44a9aa720ff8881d.js.map" />
</ItemGroup>
<ItemGroup>