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.IncludeInSearch = dto.IncludeInSearch;
library.ManageCollections = dto.ManageCollections;
library.ManageReadingLists = dto.ManageReadingLists;
_unitOfWork.LibraryRepository.Update(library);

View File

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

View File

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

View File

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

View File

@ -96,12 +96,26 @@
<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-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>
</div>
</div>
<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>
</div>
</div>

View File

@ -47,6 +47,7 @@ export class LibrarySettingsModalComponent implements OnInit, OnDestroy {
includeInRecommended: 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] }),
manageReadingLists: new FormControl<boolean>(true, { 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('includeInSearch')?.setValue(this.library.includeInSearch);
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.selectedFolders = this.library.folders;
this.madeChanges = false;

View File

@ -7,7 +7,7 @@
"name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
},
"version": "0.7.1.35"
"version": "0.7.1.36"
},
"servers": [
{
@ -11928,6 +11928,10 @@
"type": "boolean",
"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": {
"type": "boolean",
"description": "Include library series in Search"
@ -14569,6 +14573,9 @@
},
"manageCollections": {
"type": "boolean"
},
"manageReadingLists": {
"type": "boolean"
}
},
"additionalProperties": false