No More Sort Prefixes (#3895)

This commit is contained in:
Joe Milazzo 2025-07-05 17:18:11 -05:00 committed by GitHub
parent 9eadf956fb
commit 08c52b4281
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 4095 additions and 3 deletions

View file

@ -32,6 +32,7 @@ export interface Library {
allowScrobbling: boolean;
allowMetadataMatching: boolean;
enableMetadata: boolean;
removePrefixForSortName: boolean;
collapseSeriesRelationships: boolean;
libraryFileTypes: Array<FileTypeGroup>;
excludePatterns: Array<string>;

View file

@ -127,6 +127,16 @@
</app-setting-item>
</div>
<div class="row g-0 mt-4 mb-4">
<app-setting-switch [title]="t('remove-prefix-for-sortname-label')" [subtitle]="t('remove-prefix-for-sortname-tooltip')">
<ng-template #switch>
<div class="form-check form-switch float-end">
<input type="checkbox" id="remove-prefix-for-sortname" role="switch" formControlName="removePrefixForSortName" class="form-check-input">
</div>
</ng-template>
</app-setting-switch>
</div>
<div class="row g-0 mt-4 mb-4">
<app-setting-switch [title]="t('enable-metadata-label')" [subtitle]="t('enable-metadata-tooltip')">
<ng-template #switch>

View file

@ -115,6 +115,7 @@ export class LibrarySettingsModalComponent implements OnInit {
allowMetadataMatching: new FormControl<boolean>(true, { nonNullable: true, validators: [] }),
collapseSeriesRelationships: new FormControl<boolean>(false, { nonNullable: true, validators: [] }),
enableMetadata: new FormControl<boolean>(true, { nonNullable: true, validators: [] }), // required validator doesn't check value, just if true
removePrefixForSortName: new FormControl<boolean>(false, { nonNullable: true, validators: [] }),
});
selectedFolders: string[] = [];
@ -273,7 +274,8 @@ export class LibrarySettingsModalComponent implements OnInit {
this.libraryForm.get('allowScrobbling')?.setValue(this.IsKavitaPlusEligible ? this.library.allowScrobbling : false);
this.libraryForm.get('allowMetadataMatching')?.setValue(this.IsMetadataDownloadEligible ? this.library.allowMetadataMatching : false);
this.libraryForm.get('excludePatterns')?.setValue(this.excludePatterns ? this.library.excludePatterns : false);
this.libraryForm.get('enableMetadata')?.setValue(this.library.enableMetadata, true);
this.libraryForm.get('enableMetadata')?.setValue(this.library.enableMetadata);
this.libraryForm.get('removePrefixForSortName')?.setValue(this.library.removePrefixForSortName);
this.selectedFolders = this.library.folders;
this.madeChanges = false;

View file

@ -1131,6 +1131,8 @@
"include-in-search-tooltip": "Should series and any derived information (genres, people, files) from the library be included in search results.",
"enable-metadata-label": "Enable Metadata (ComicInfo/Epub/PDF)",
"enable-metadata-tooltip": "Allow Kavita to read metadata files which override filename parsing.",
"remove-prefix-for-sortname-label": "Remove common prefixes for Sort Name",
"remove-prefix-for-sortname-tooltip": "Kavita will remove common prefixes like 'The', 'A', 'An' from titles for sort name. Does not override set metadata.",
"force-scan": "Force Scan",
"force-scan-tooltip": "This will force a scan on the library, treating like a fresh scan",
"reset": "{{common.reset}}",