Kavita+ Enhancements (#2616)
This commit is contained in:
parent
625c56b265
commit
dd44f55747
43 changed files with 1056 additions and 468 deletions
|
|
@ -2,7 +2,6 @@
|
|||
using System.Threading.Tasks;
|
||||
using API.Constants;
|
||||
using API.Data;
|
||||
using API.DTOs.Account;
|
||||
using API.DTOs.License;
|
||||
using API.Entities.Enums;
|
||||
using API.Extensions;
|
||||
|
|
@ -20,7 +19,8 @@ public class LicenseController(
|
|||
IUnitOfWork unitOfWork,
|
||||
ILogger<LicenseController> logger,
|
||||
ILicenseService licenseService,
|
||||
ILocalizationService localizationService)
|
||||
ILocalizationService localizationService,
|
||||
ITaskScheduler taskScheduler)
|
||||
: BaseApiController
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -31,7 +31,12 @@ public class LicenseController(
|
|||
[ResponseCache(CacheProfileName = ResponseCacheProfiles.LicenseCache)]
|
||||
public async Task<ActionResult<bool>> HasValidLicense(bool forceCheck = false)
|
||||
{
|
||||
return Ok(await licenseService.HasActiveLicense(forceCheck));
|
||||
var ret = await licenseService.HasActiveLicense(forceCheck);
|
||||
if (ret)
|
||||
{
|
||||
await taskScheduler.ScheduleKavitaPlusTasks();
|
||||
}
|
||||
return Ok(ret);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -57,6 +62,7 @@ public class LicenseController(
|
|||
setting.Value = null;
|
||||
unitOfWork.SettingsRepository.Update(setting);
|
||||
await unitOfWork.CommitAsync();
|
||||
await taskScheduler.ScheduleKavitaPlusTasks();
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +88,7 @@ public class LicenseController(
|
|||
try
|
||||
{
|
||||
await licenseService.AddLicense(dto.License.Trim(), dto.Email.Trim(), dto.DiscordId);
|
||||
await taskScheduler.ScheduleKavitaPlusTasks();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue