Polish for Release (#2841)

This commit is contained in:
Joe Milazzo 2024-04-10 16:51:40 -05:00 committed by GitHub
parent a76de06087
commit e6e228c3d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 46 additions and 36 deletions

View File

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.2" />

View File

@ -53,9 +53,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="31.0.2" />
<PackageReference Include="CsvHelper" Version="31.0.3" />
<PackageReference Include="MailKit" Version="4.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
@ -65,18 +65,18 @@
<PackageReference Include="ExCSS" Version="4.2.5" />
<PackageReference Include="Flurl" Version="3.0.7" />
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Hangfire" Version="1.8.11" />
<PackageReference Include="Hangfire" Version="1.8.12" />
<PackageReference Include="Hangfire.InMemory" Version="0.8.1" />
<PackageReference Include="Hangfire.MaximumConcurrentExecutions" Version="1.1.0" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.4.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.60" />
<PackageReference Include="MarkdownDeep.NET.Core" Version="1.5.0.4" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.11" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.12" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="MimeTypeMapOfficial" Version="1.0.17" />
@ -95,15 +95,15 @@
<PackageReference Include="Serilog.Sinks.SignalR.Core" Version="0.1.2" />
<PackageReference Include="SharpCompress" Version="0.36.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.0.88079">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.1" />
<PackageReference Include="System.IO.Abstractions" Version="21.0.2" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
<PackageReference Include="System.Drawing.Common" Version="8.0.4" />
<PackageReference Include="VersOne.Epub" Version="3.3.1" />
</ItemGroup>

View File

@ -205,14 +205,12 @@ public class LicenseService(
InstallId = HashUtil.ServerToken()
})
.ReceiveString();
var result = bool.Parse(response);
if (!result)
{
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
await provider.FlushAsync();
await provider.SetAsync(CacheKey, result, _licenseCacheTimeout);
}
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
await provider.FlushAsync();
await provider.SetAsync(CacheKey, result, _licenseCacheTimeout);
return result;
}
@ -229,6 +227,7 @@ public class LicenseService(
serverSetting.Value = string.Empty;
unitOfWork.SettingsRepository.Update(serverSetting);
await unitOfWork.CommitAsync();
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
await provider.RemoveAsync(CacheKey);
}

View File

@ -169,12 +169,12 @@ public class TaskScheduler : ITaskScheduler
{
return;
}
RecurringJob.AddOrUpdate(CheckScrobblingTokensId, () => _scrobblingService.CheckExternalAccessTokens(),
Cron.Daily, RecurringJobOptions);
BackgroundJob.Enqueue(() => _scrobblingService.CheckExternalAccessTokens()); // We also kick off an immediate check on startup
RecurringJob.AddOrUpdate(LicenseCheckId, () => _licenseService.HasActiveLicense(true),
LicenseService.Cron, RecurringJobOptions);
BackgroundJob.Enqueue(() => _licenseService.HasActiveLicense(true));
// KavitaPlus Scrobbling (every 4 hours)
RecurringJob.AddOrUpdate(ProcessScrobblingEventsId, () => _scrobblingService.ProcessUpdatesSinceLastSync(),

View File

@ -254,7 +254,7 @@ public class ScannerService : IScannerService
// Transform seen series into the parsedSeries (I think we can actually just have processedSeries be used instead
TrackFoundSeriesAndFiles(parsedSeries, processedSeries);
_logger.LogInformation("ScanFiles for {Series} took {Time}", series.Name, scanElapsedTime);
_logger.LogInformation("ScanFiles for {Series} took {Time} milliseconds", series.Name, scanElapsedTime);
// We now technically have all scannedSeries, we could invoke each Series to be scanned

View File

@ -147,6 +147,6 @@ public class TokenService : ITokenService
if (string.IsNullOrEmpty(token)) return true;
var tokenHandler = new JwtSecurityTokenHandler();
var tokenContent = tokenHandler.ReadJwtToken(token);
return tokenContent.ValidTo <= DateTime.UtcNow;
return tokenContent.ValidTo >= DateTime.UtcNow;
}
}

View File

@ -15,7 +15,7 @@
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.0.88079">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -115,6 +115,7 @@ export class AccountService {
}
hasValidLicense(forceCheck: boolean = false) {
console.log('hasValidLicense being called: ', forceCheck);
return this.httpClient.get<string>(this.baseUrl + 'license/valid-license?forceCheck=' + forceCheck, TextResonse)
.pipe(
map(res => res === "true"),

View File

@ -49,16 +49,21 @@ export class LicenseComponent implements OnInit {
this.formGroup.addControl('licenseKey', new FormControl('', [Validators.required]));
this.formGroup.addControl('email', new FormControl('', [Validators.required]));
this.formGroup.addControl('discordId', new FormControl('', [Validators.pattern(/\d+/)]));
this.isChecking = true;
this.cdRef.markForCheck();
this.accountService.hasAnyLicense().subscribe(res => {
this.hasLicense = res;
this.cdRef.markForCheck();
});
this.isChecking = true;
this.cdRef.markForCheck();
this.accountService.hasValidLicense().subscribe(res => {
this.hasValidLicense = res;
this.isChecking = false;
this.cdRef.markForCheck();
if (this.hasLicense) {
this.accountService.hasValidLicense().subscribe(res => {
this.hasValidLicense = res;
this.isChecking = false;
this.cdRef.markForCheck();
});
}
});
}

View File

@ -47,7 +47,7 @@
<input width="100%" #title ngbAutofocus type="text" class="form-control mb-2" id="add-rlist" formControlName="title">
</div>
<div class="col-2">
<button type="submit" class="btn btn-primary" (click)="create()">{{t('create')}}</button>
<button type="submit" class="btn btn-primary" [disabled]="isCreating" (click)="create()">{{t('create')}}</button>
</div>
</div>
</div>

View File

@ -48,6 +48,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
*/
lists: Array<UserCollection> = [];
loading: boolean = false;
isCreating: boolean = false;
listForm: FormGroup = new FormGroup({});
ngOnInit(): void {
@ -77,9 +78,13 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
}
create() {
if (this.isCreating) return;
const tagName = this.listForm.value.title;
this.isCreating = true;
this.cdRef.markForCheck();
this.collectionService.addByMultiple(0, this.seriesIds, tagName).subscribe(() => {
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.isCreating = false;
this.modal.close();
});
}

View File

@ -299,8 +299,8 @@ export class MetadataFilterRowComponent implements OnInit {
case FilterField.Penciller: return this.getPersonOptions(PersonRole.Penciller);
case FilterField.Publisher: return this.getPersonOptions(PersonRole.Publisher);
case FilterField.Imprint: return this.getPersonOptions(PersonRole.Imprint);
case FilterField.Team: return this.getPersonOptions(PersonRole.Imprint);
case FilterField.Location: return this.getPersonOptions(PersonRole.Imprint);
case FilterField.Team: return this.getPersonOptions(PersonRole.Team);
case FilterField.Location: return this.getPersonOptions(PersonRole.Location);
case FilterField.Translators: return this.getPersonOptions(PersonRole.Translator);
case FilterField.Writers: return this.getPersonOptions(PersonRole.Writer);
}

View File

@ -8,8 +8,8 @@
<div>{{t('no-data')}}</div>
} @else {
<ngb-progressbar-stacked>
<ngb-progressbar type="danger" [value]="errorPercent" [ngbTooltip]="t('errored-series-label') + ' ' + breakdown.erroredSeries"></ngb-progressbar>
<ngb-progressbar type="success" [value]="completedPercent" [ngbTooltip]="t('completed-series-label') + ' ' + breakdown.seriesCompleted"></ngb-progressbar>
<ngb-progressbar type="danger" [showValue]="true" [value]="errorPercent" [ngbTooltip]="t('errored-series-label') + ' ' + breakdown.erroredSeries"></ngb-progressbar>
<ngb-progressbar type="success" [showValue]="true" [value]="completedPercent" [ngbTooltip]="t('completed-series-label') + ' ' + breakdown.seriesCompleted"></ngb-progressbar>
</ngb-progressbar-stacked>
@if (breakdown.seriesCompleted >= breakdown.totalSeries) {
<p>{{t('complete') }}

View File

@ -60,7 +60,7 @@ export class ManageScrobblingProvidersComponent implements OnInit {
loaded: boolean = false;
constructor() {
this.accountService.hasValidLicense().subscribe(res => {
this.accountService.hasValidLicense$.subscribe(res => {
this.hasValidLicense = res;
this.cdRef.markForCheck();
if (this.hasValidLicense) {

View File

@ -7,7 +7,7 @@
"name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
},
"version": "0.7.14.13"
"version": "0.7.14.14"
},
"servers": [
{