Library Settings for Reading List Creation (#1930)

* Added the code for Library Settings to allow turning off Reading List creation.

* Fixed a typo
This commit is contained in:
Joe Milazzo 2023-04-15 10:42:22 -05:00 committed by GitHub
parent 7f53eadfda
commit 4791da1447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 3 deletions

View File

@ -338,6 +338,8 @@ public class LibraryController : BaseApiController
library.IncludeInRecommended = dto.IncludeInRecommended; library.IncludeInRecommended = dto.IncludeInRecommended;
library.IncludeInSearch = dto.IncludeInSearch; library.IncludeInSearch = dto.IncludeInSearch;
library.ManageCollections = dto.ManageCollections; library.ManageCollections = dto.ManageCollections;
library.ManageReadingLists = dto.ManageReadingLists;
_unitOfWork.LibraryRepository.Update(library); _unitOfWork.LibraryRepository.Update(library);

View File

@ -34,6 +34,10 @@ public class LibraryDto
/// </summary> /// </summary>
public bool ManageCollections { get; set; } = true; public bool ManageCollections { get; set; } = true;
/// <summary> /// <summary>
/// Should this library create and manage reading lists from Metadata
/// </summary>
public bool ManageReadingLists { get; set; } = true;
/// <summary>
/// Include library series in Search /// Include library series in Search
/// </summary> /// </summary>
public bool IncludeInSearch { get; set; } = true; public bool IncludeInSearch { get; set; } = true;

View File

@ -24,4 +24,5 @@ public class UpdateLibraryDto
public bool IncludeInSearch { get; init; } public bool IncludeInSearch { get; init; }
[Required] [Required]
public bool ManageCollections { get; init; } public bool ManageCollections { get; init; }
public bool ManageReadingLists { get; init; }
} }

View File

@ -16,5 +16,6 @@ export interface Library {
includeInRecommended: boolean; includeInRecommended: boolean;
includeInSearch: boolean; includeInSearch: boolean;
manageCollections: boolean; manageCollections: boolean;
manageReadingLists: boolean;
collapseSeriesRelationships: boolean; collapseSeriesRelationships: boolean;
} }

View File

@ -96,12 +96,26 @@
<div class="col-md-12 col-sm-12 pe-2 mb-2"> <div class="col-md-12 col-sm-12 pe-2 mb-2">
<div class="mb-3 mt-1"> <div class="mb-3 mt-1">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input type="checkbox" id="manage-collections" role="switch" formControlName="manageCollections" class="form-check-input" aria-labelledby="auto-close-label"> <input type="checkbox" id="manage-collections" role="switch" formControlName="manageCollections" class="form-check-input">
<label class="form-check-label" for="manage-collections">Manage Collections</label> <label class="form-check-label" for="manage-collections">Manage Collections</label>
</div> </div>
</div> </div>
<p class="accent"> <p class="accent">
Should Kavita create and update Collections from SeriesGroup tags found within ComicInfo.xml files Should Kavita create Collections from SeriesGroup tags found within ComicInfo.xml files
</p>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 pe-2 mb-2">
<div class="mb-3 mt-1">
<div class="form-check form-switch">
<input type="checkbox" id="manage-readinglists" role="switch" formControlName="manageReadingLists" class="form-check-input">
<label class="form-check-label" for="manage-readinglists">Manage Reading Lists</label>
</div>
</div>
<p class="accent">
Should Kavita create Reading Lists from StoryArc/StoryArcNumber and AlternativeSeries/AlternativeCount tags found within ComicInfo.xml files
</p> </p>
</div> </div>
</div> </div>

View File

@ -47,6 +47,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
includeInRecommended: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), includeInRecommended: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
includeInSearch: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), includeInSearch: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
manageCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }), manageCollections: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
manageReadingLists: new FormControl<boolean>(true, { nonNullable: true, validators: [Validators.required] }),
collapseSeriesRelationships: new FormControl<boolean>(false, { nonNullable: true, validators: [Validators.required] }), collapseSeriesRelationships: new FormControl<boolean>(false, { nonNullable: true, validators: [Validators.required] }),
}); });
@ -120,6 +121,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
this.libraryForm.get('includeInRecommended')?.setValue(this.library.includeInRecommended); this.libraryForm.get('includeInRecommended')?.setValue(this.library.includeInRecommended);
this.libraryForm.get('includeInSearch')?.setValue(this.library.includeInSearch); this.libraryForm.get('includeInSearch')?.setValue(this.library.includeInSearch);
this.libraryForm.get('manageCollections')?.setValue(this.library.manageCollections); this.libraryForm.get('manageCollections')?.setValue(this.library.manageCollections);
this.libraryForm.get('manageReadingLists')?.setValue(this.library.manageReadingLists);
this.libraryForm.get('collapseSeriesRelationships')?.setValue(this.library.collapseSeriesRelationships); this.libraryForm.get('collapseSeriesRelationships')?.setValue(this.library.collapseSeriesRelationships);
this.selectedFolders = this.library.folders; this.selectedFolders = this.library.folders;
this.madeChanges = false; this.madeChanges = false;

View File

@ -7,7 +7,7 @@
"name": "GPL-3.0", "name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE" "url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
}, },
"version": "0.7.1.35" "version": "0.7.1.36"
}, },
"servers": [ "servers": [
{ {
@ -11928,6 +11928,10 @@
"type": "boolean", "type": "boolean",
"description": "Should this library create and manage collections from Metadata" "description": "Should this library create and manage collections from Metadata"
}, },
"manageReadingLists": {
"type": "boolean",
"description": "Should this library create and manage reading lists from Metadata"
},
"includeInSearch": { "includeInSearch": {
"type": "boolean", "type": "boolean",
"description": "Include library series in Search" "description": "Include library series in Search"
@ -14569,6 +14573,9 @@
}, },
"manageCollections": { "manageCollections": {
"type": "boolean" "type": "boolean"
},
"manageReadingLists": {
"type": "boolean"
} }
}, },
"additionalProperties": false "additionalProperties": false