Skip to content

Commit 14bf440

Browse files
majora2007FesaaweblateLyrqRicky-Tigg
authored
v0.8.6.2 - General Settings Hotfix (#3756)
Co-authored-by: Amelia <[email protected]> Co-authored-by: Weblate (bot) <[email protected]> Co-authored-by: Lyrq <[email protected]> Co-authored-by: Ricky Tigg <[email protected]> Co-authored-by: 無情天 <[email protected]>
1 parent d3f8a50 commit 14bf440

File tree

9 files changed

+28
-10
lines changed

9 files changed

+28
-10
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body:
2828
label: Kavita Version Number - If you don't see your version number listed, please update Kavita and see if your issue still persists.
2929
multiple: false
3030
options:
31-
- 0.8.6.1 - Stable
31+
- 0.8.6.2 - Stable
3232
- Nightly Testing Branch
3333
validations:
3434
required: true

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "develop", "main" ]
16+
branches: [ "develop"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "develop" ]

API/API.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
<None Remove="Hangfire-log.db" />
116116
<None Remove="obj\**" />
117117
<None Remove="cache\**" />
118+
<None Remove="cache-long\**" />
118119
<None Remove="backups\**" />
119120
<None Remove="logs\**" />
120121
<None Remove="temp\**" />

API/Services/CacheService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public string GetCachedFile(Chapter chapter)
186186
}
187187
else
188188
{
189+
// Potential BUG: If the folder is left here and there are no files within, this could theoretically return without proper cache
189190
return chapter;
190191
}
191192
}

API/config/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"TokenKey": "super secret unguessable key that is longer because we require it",
33
"Port": 5000,
4-
"IpAddresses": "0.0.0.0,::",
4+
"IpAddresses": "",
55
"BaseUrl": "/",
66
"Cache": 75,
77
"AllowIFraming": false

UI/Web/src/app/admin/manage-settings/manage-settings.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h4>{{t('networking-settings-title')}}</h4>
6464
@if (settingsForm.get('ipAddresses'); as formControl) {
6565
<app-setting-item [title]="t('ip-address-label')" [subtitle]="t('ip-address-tooltip')">
6666
<ng-template #view>
67-
{{formControl.value}}
67+
{{formControl.value | defaultValue}}
6868
</ng-template>
6969
<ng-template #edit>
7070
<div class="input-group">
@@ -75,7 +75,7 @@ <h4>{{t('networking-settings-title')}}</h4>
7575

7676
@if(settingsForm.dirty || !settingsForm.untouched) {
7777
<div id="ipaddresses-validations" class="invalid-feedback">
78-
@if (formControl.errors?.pattern) {
78+
@if (formControl.errors?.emptyOrPattern) {
7979
<div>{{t('ip-address-validation')}}</div>
8080
}
8181
</div>

UI/Web/src/app/admin/manage-settings/manage-settings.component.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, inject, OnInit} from '@angular/core';
2-
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
2+
import {FormControl, FormGroup, ReactiveFormsModule, ValidatorFn, Validators} from '@angular/forms';
33
import {ToastrService} from 'ngx-toastr';
44
import {take} from 'rxjs/operators';
55
import {ServerService} from 'src/app/_services/server.service';
@@ -62,7 +62,7 @@ export class ManageSettingsComponent implements OnInit {
6262
this.settingsForm.addControl('taskScan', new FormControl(this.serverSettings.taskScan, [Validators.required]));
6363
this.settingsForm.addControl('taskBackup', new FormControl(this.serverSettings.taskBackup, [Validators.required]));
6464
this.settingsForm.addControl('taskCleanup', new FormControl(this.serverSettings.taskCleanup, [Validators.required]));
65-
this.settingsForm.addControl('ipAddresses', new FormControl(this.serverSettings.ipAddresses, [Validators.required, Validators.pattern(ValidIpAddress)]));
65+
this.settingsForm.addControl('ipAddresses', new FormControl(this.serverSettings.ipAddresses, [this.emptyOrPattern(ValidIpAddress)]));
6666
this.settingsForm.addControl('port', new FormControl(this.serverSettings.port, [Validators.required]));
6767
this.settingsForm.addControl('loggingLevel', new FormControl(this.serverSettings.loggingLevel, [Validators.required]));
6868
this.settingsForm.addControl('allowStatCollection', new FormControl(this.serverSettings.allowStatCollection, [Validators.required]));
@@ -77,6 +77,7 @@ export class ManageSettingsComponent implements OnInit {
7777
this.settingsForm.addControl('onDeckProgressDays', new FormControl(this.serverSettings.onDeckProgressDays, [Validators.required]));
7878
this.settingsForm.addControl('onDeckUpdateDays', new FormControl(this.serverSettings.onDeckUpdateDays, [Validators.required]));
7979

80+
8081
// Automatically save settings as we edit them
8182
this.settingsForm.valueChanges.pipe(
8283
distinctUntilChanged(),
@@ -186,4 +187,19 @@ export class ManageSettingsComponent implements OnInit {
186187
console.error('error: ', err);
187188
});
188189
}
190+
191+
emptyOrPattern(pattern: RegExp): ValidatorFn {
192+
return (control) => {
193+
if (!control.value || control.value.length === 0) {
194+
return null;
195+
}
196+
197+
if (pattern.test(control.value)) {
198+
return null;
199+
}
200+
201+
return { 'emptyOrPattern': { 'requiredPattern': pattern.toString(), 'actualValue': control.value } };
202+
}
203+
}
204+
189205
}

UI/Web/src/assets/langs/fi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"devices-tab": "{{tabs.devices-tab}}",
1111
"smart-filters-tab": "{{tabs.smart-filters-tab}}",
1212
"success-toast": "Käyttäjäasetukset päivitetty",
13-
"global-settings-title": "Laajamittaiset asetukset",
13+
"global-settings-title": "Yleisesti pätevät asetukset",
1414
"page-layout-mode-label": "Sivun asettelutila",
1515
"page-layout-mode-tooltip": "Näytä kohteet kortteina tai luettelonäkymänä Sarjojen yksityiskohdat -sivulla.",
1616
"locale-label": "Kieliasetus",

UI/Web/src/assets/langs/zh_Hans.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,12 +2219,12 @@
22192219
"delete-device": "您确定要删除该设备吗?",
22202220
"confirm-regen-covers": "刷新封面将强制重新生成所有封面图片。这是一项繁重的运算。您确定执行,而不想使用扫描操作代替吗?",
22212221
"alert-long-running": "这是一个长时间运行的任务。请等待其完成后再次进行操作。",
2222-
"confirm-delete-multiple-series": "您确定要删除{{count}}个系列吗?这不会修改磁盘上的文件。",
2222+
"confirm-delete-multiple-series": "您确定要删除这 {{count}} 个系列吗?这不会修改磁盘上的文件。",
22232223
"confirm-delete-series": "您确定要删除此系列吗?这不会修改磁盘上的文件。",
22242224
"confirm-delete-chapter": "您确定要删除此章节吗?它不会修改磁盘上的文件。",
22252225
"confirm-delete-volume": "您确定要删除此卷吗?它不会修改磁盘上的文件。",
22262226
"alert-bad-theme": "主题中存在无效或不安全的CSS。请联系管理员进行修正。将默认为暗色主题。",
2227-
"confirm-library-delete": "您确定要删除{{name}}资料库吗?此操作无法撤销。",
2227+
"confirm-library-delete": "您确定要删除 {{name}} 资料库吗?此操作无法撤销。",
22282228
"confirm-library-type-change": "更改资料库类型将触发具有不同解析规则的新扫描,并可能导致重新创建系列,因此您可能会丢失进度和书签。您应该在执行此操作之前进行备份。您确定要继续吗?",
22292229
"confirm-download-size": "{{entityType}}的大小为{{size}}。确定要继续吗?",
22302230
"confirm-download-size-ios": "iOS 在下载大于 200MB 的文件时出现问题,此下载可能无法完成。",

0 commit comments

Comments
 (0)