feat(webui): library dialog options for extension repair

This commit is contained in:
Gauthier Roebroeck 2021-05-05 16:39:45 +08:00
parent 7f70f85b8e
commit f6ad0f0012
3 changed files with 44 additions and 5 deletions

View File

@ -185,8 +185,25 @@
</v-row>
<v-row>
<v-col>
<span class="text-subtitle-2">{{ $t('dialog.edit_library.label_convert_to_cbz') }}</span>
<v-alert type="warning" text class="text-subtitle-2">{{ $t('dialog.edit_library.warning_early_feature_convert_to_cbz') }}</v-alert>
<v-checkbox
v-model="fileManagement"
:indeterminate="fileManagement === 1"
hide-details
>
<template v-slot:label>
<span class="text-subtitle-2">{{ $t('dialog.edit_library.label_file_management') }}</span>
</template>
</v-checkbox>
<v-alert type="warning" text class="text-subtitle-2 mt-4">{{ $t('dialog.edit_library.warning_early_feature_repair_extensions') }}</v-alert>
<v-checkbox
v-model="form.repairExtensions"
:label="$t('dialog.edit_library.field_repair_extensions')"
hide-details
class="mx-4"
/>
<v-alert type="warning" text class="text-subtitle-2 mt-4">{{ $t('dialog.edit_library.warning_early_feature_convert_to_cbz') }}</v-alert>
<v-checkbox
v-model="form.convertToCbz"
:label="$t('dialog.edit_library.field_convert_to_cbz')"
@ -254,6 +271,7 @@ export default Vue.extend({
importBarcodeIsbn: true,
scanForceModifiedTime: false,
scanDeep: false,
repairExtensions: false,
convertToCbz: false,
},
validationFieldNames: new Map([]),
@ -310,6 +328,20 @@ export default Vue.extend({
this.form.scanForceModifiedTime = value
},
},
fileManagement: {
get: function (): number {
const val = [this.form.repairExtensions, this.form.convertToCbz]
const count = val.filter(Boolean).length
if (count === val.length) return 2
if (count === 0) return 0
return 1
},
set: function (value: boolean): void {
this.form.repairExtensions = value
this.form.convertToCbz = value
},
},
},
props: {
value: Boolean,
@ -369,6 +401,7 @@ export default Vue.extend({
this.form.importBarcodeIsbn = library ? library.importBarcodeIsbn : true
this.form.scanForceModifiedTime = library ? library.scanForceModifiedTime : false
this.form.scanDeep = library ? library.scanDeep : false
this.form.repairExtensions = library ? library.repairExtensions : false
this.form.convertToCbz = library ? library.convertToCbz : false
this.$v.$reset()
},
@ -389,6 +422,7 @@ export default Vue.extend({
importBarcodeIsbn: this.form.importBarcodeIsbn,
scanForceModifiedTime: this.form.scanForceModifiedTime,
scanDeep: this.form.scanDeep,
repairExtensions: this.form.repairExtensions,
convertToCbz: this.form.convertToCbz,
}
}

View File

@ -291,7 +291,7 @@
"button_confirm_edit": "Edit",
"dialog_title_add": "Add Library",
"dialot_title_edit": "Edit Library",
"field_convert_to_cbz": "Convert to CBZ",
"field_convert_to_cbz": "Automatically convert to CBZ",
"field_import_barcode_isbn": "ISBN barcode",
"field_import_comicinfo_book": "Book metadata",
"field_import_comicinfo_collections": "Collections",
@ -301,12 +301,13 @@
"field_import_epub_series": "Series metadata",
"field_import_local_artwork": "Local artwork",
"field_name": "Name",
"field_repair_extensions": "Automatically repair incorrect file extensions",
"field_root_folder": "Root folder",
"field_scanner_deep_scan": "Deep scan",
"field_scanner_force_directory_modified_time": "Force directory modified time",
"file_browser_dialog_button_confirm": "Choose",
"file_browser_dialog_title": "Library's root folder",
"label_convert_to_cbz": "Automatically convert to CBZ",
"label_file_management": "File management",
"label_import_barcode_isbn": "Import ISBN within barcode",
"label_import_comicinfo": "Import metadata for CBR/CBZ containing a ComicInfo.xml file",
"label_import_epub": "Import metadata from EPUB files",
@ -314,7 +315,8 @@
"label_scanner": "Scanner",
"tab_general": "General",
"tab_options": "Options",
"warning_early_feature_convert_to_cbz": "Book conversion is still an early feature, and must be used with caution. Make sure your files are backed up before using it."
"warning_early_feature_convert_to_cbz": "Book conversion is still an early feature, and must be used with caution. Make sure your files are backed up before using it.",
"warning_early_feature_repair_extensions": "Repair file extension is still an early feature, and must be used with caution. Make sure your files are backed up before using it."
},
"edit_readlist": {
"button_cancel": "Cancel",

View File

@ -11,6 +11,7 @@ interface LibraryCreationDto {
importBarcodeIsbn: boolean,
scanForceModifiedTime: boolean,
scanDeep: boolean,
repairExtensions: boolean,
convertToCbz: boolean
}
@ -27,6 +28,7 @@ interface LibraryUpdateDto {
importBarcodeIsbn: boolean,
scanForceModifiedTime: boolean,
scanDeep: boolean,
repairExtensions: boolean,
convertToCbz: boolean
}
@ -44,5 +46,6 @@ interface LibraryDto {
importBarcodeIsbn: boolean,
scanForceModifiedTime: boolean,
scanDeep: boolean,
repairExtensions: boolean,
convertToCbz: boolean
}