Cleanup from the Release (#2127)

* Added an FAQ link on the Kavita+ tab.

* Don't query Kavita+ for ratings on comic libraries as there is no upstream provider yet.

* Jumpbar keys are a little hard to click

* Fixed an issue where libraries that don't allow scrobbling could be scrobbled when generating past history with read events.

* Made the min/max release year on metadata filter number and removed the spin arrows for styling.

* Fixed disable tabs color contrast due to bootstrap undocumented change.

* Refactored whole codebase to unify caching mechanism. Upped the default cache memory amount to 75 to account for the extra data load. Still LRU.

Fixed an issue where Cache key was using Port instead.

Refactored all the Configuration code to use strongly typed deserialization.

* Fixed an issue where get latest progress would throw an exception if there was no progress due to LINQ and MAX query.

* Fixed a bug where Send to Device wasn't present on Series cards.

* Hooked up the ability to change the cache size for Kavita via the UI.
This commit is contained in:
Joe Milazzo 2023-07-12 16:06:30 -05:00 committed by GitHub
parent 1ed8889d08
commit 81da9dc444
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 402 additions and 272 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using API.Data;
@ -40,6 +41,9 @@ public class RatingService : IRatingService
var license = await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.LicenseKey);
var series = await _unitOfWork.SeriesRepository.GetSeriesByIdAsync(seriesId,
SeriesIncludes.Metadata | SeriesIncludes.Library | SeriesIncludes.Chapters | SeriesIncludes.Volumes);
// Don't send any ratings back for Comic libraries as Kavita+ doesn't have any providers for that
if (series == null || series.Library.Type == LibraryType.Comic) return ImmutableList<RatingDto>.Empty;
return await GetRatings(license.Value, series);
}

View file

@ -74,7 +74,7 @@ public class RecommendationService : IRecommendationService
var series =
await _unitOfWork.SeriesRepository.GetSeriesByIdAsync(seriesId,
SeriesIncludes.Metadata | SeriesIncludes.Library | SeriesIncludes.Volumes | SeriesIncludes.Chapters);
if (series == null) return new RecommendationDto();
if (series == null || series.Library.Type == LibraryType.Comic) return new RecommendationDto();
var license = await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.LicenseKey);
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(userId);

View file

@ -466,10 +466,11 @@ public class ScrobblingService : IScrobblingService
var userIds = (await _unitOfWork.UserRepository.GetAllUsersAsync())
.Where(l => userId == 0 || userId == l.Id)
.Select(u => u.Id);
if (!await _licenseService.HasActiveLicense()) return;
foreach (var uId in userIds)
{
if (!await _licenseService.HasActiveLicense()) continue;
var wantToRead = await _unitOfWork.SeriesRepository.GetWantToReadForUserAsync(uId);
foreach (var wtr in wantToRead)
{
@ -505,6 +506,7 @@ public class ScrobblingService : IScrobblingService
foreach (var series in seriesWithProgress)
{
if (!libAllowsScrobbling[series.LibraryId]) continue;
await ScrobbleReadingUpdate(uId, series.Id);
}
@ -687,7 +689,10 @@ public class ScrobblingService : IScrobblingService
_logger.LogDebug("Processing Reading Events: {Count} / {Total}", progressCounter, totalProgress);
progressCounter++;
// Check if this media item can even be processed for this user
if (!DoesUserHaveProviderAndValid(evt)) continue;
if (!DoesUserHaveProviderAndValid(evt))
{
continue;
}
var count = await SetAndCheckRateLimit(userRateLimits, evt.AppUser, license.Value);
if (count == 0)
{