Skip to content

Commit

Permalink
feat(webui): add scan directory exclusions to the library edit dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Sep 22, 2023
1 parent b518473 commit 364df50
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions komga-webui/src/components/dialogs/LibraryEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@
</v-chip>
</v-chip-group>
</div>

<v-combobox v-model="form.scanDirectoryExclusions"
clearable
multiple
small-chips
deletable-chips
:label="$t('dialog.edit_library.label_scan_directory_exclusions')"
class="mx-4"
/>
</v-col>
</v-row>
</v-container>
Expand Down Expand Up @@ -449,6 +458,7 @@ export default Vue.extend({
scanInterval: ScanIntervalDto.EVERY_6H,
scanOnStartup: false,
scanTypes: [],
scanDirectoryExclusions: [] as string[],
repairExtensions: false,
convertToCbz: false,
emptyTrashAfterScan: false,
Expand Down Expand Up @@ -607,6 +617,7 @@ export default Vue.extend({
if (library?.scanEpub == true) this.form.scanTypes.splice(0, 0, 'epub')
if (library?.scanPdf == true) this.form.scanTypes.splice(0, 0, 'pdf')
if (library?.scanCbx == true) this.form.scanTypes.splice(0, 0, 'cbx')
this.form.scanDirectoryExclusions = library ? library.scanDirectoryExclusions : ['#recycle', '@eaDir', '@Recycle']
this.form.repairExtensions = library ? library.repairExtensions : false
this.form.convertToCbz = library ? library.convertToCbz : false
this.form.emptyTrashAfterScan = library ? library.emptyTrashAfterScan : false
Expand Down Expand Up @@ -640,6 +651,7 @@ export default Vue.extend({
scanCbx: this.form.scanTypes.includes('cbx'),
scanPdf: this.form.scanTypes.includes('pdf'),
scanEpub: this.form.scanTypes.includes('epub'),
scanDirectoryExclusions: this.form.scanDirectoryExclusions,
repairExtensions: this.form.repairExtensions,
convertToCbz: this.form.convertToCbz,
emptyTrashAfterScan: this.form.emptyTrashAfterScan,
Expand Down
1 change: 1 addition & 0 deletions komga-webui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@
"label_import_epub": "Import metadata from EPUB files",
"label_import_local": "Import local media assets",
"label_import_mylar": "Import metadata generated by Mylar",
"label_scan_directory_exclusions": "Directory exclusions",
"label_scan_types": "Scan for these file types",
"label_scanner": "Scanner",
"label_series_cover": "Series cover",
Expand Down
3 changes: 3 additions & 0 deletions komga-webui/src/types/komga-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface LibraryDto {
scanCbx: boolean,
scanPdf: boolean,
scanEpub: boolean,
scanDirectoryExclusions: string[],
repairExtensions: boolean,
convertToCbz: boolean,
emptyTrashAfterScan: boolean,
Expand Down Expand Up @@ -50,6 +51,7 @@ export interface LibraryCreationDto {
scanCbx: boolean,
scanPdf: boolean,
scanEpub: boolean,
scanDirectoryExclusions: string[],
repairExtensions: boolean,
convertToCbz: boolean,
emptyTrashAfterScan: boolean,
Expand Down Expand Up @@ -79,6 +81,7 @@ export interface LibraryUpdateDto {
scanCbx: boolean,
scanPdf: boolean,
scanEpub: boolean,
scanDirectoryExclusions: string[],
repairExtensions: boolean,
convertToCbz: boolean,
emptyTrashAfterScan: boolean,
Expand Down

0 comments on commit 364df50

Please sign in to comment.