mirror of
https://github.com/gotson/komga.git
synced 2025-12-25 09:53:20 +01:00
feat(webui): add new scanner options to the library edit dialog
This commit is contained in:
parent
e0684851f7
commit
c6c7c89a84
4 changed files with 148 additions and 32 deletions
|
|
@ -29,6 +29,10 @@
|
|||
<v-icon left class="hidden-xs-only">mdi-bookshelf</v-icon>
|
||||
{{ $t('dialog.edit_library.tab_general') }}
|
||||
</v-tab>
|
||||
<v-tab class="justify-start">
|
||||
<v-icon left class="hidden-xs-only">mdi-magnify-scan</v-icon>
|
||||
{{ $t('dialog.edit_library.label_scanner') }}
|
||||
</v-tab>
|
||||
<v-tab class="justify-start">
|
||||
<v-icon left class="hidden-xs-only">mdi-tune</v-icon>
|
||||
{{ $t('dialog.edit_library.tab_options') }}
|
||||
|
|
@ -79,13 +83,12 @@
|
|||
</v-card>
|
||||
</v-tab-item>
|
||||
|
||||
<!-- Tab: Options -->
|
||||
<!-- Tab: Scanner -->
|
||||
<v-tab-item>
|
||||
<v-card flat :min-height="$vuetify.breakpoint.xs ? $vuetify.breakpoint.height * .8 : undefined">
|
||||
<v-container fluid>
|
||||
<v-row>
|
||||
<v-col cols="auto">
|
||||
<span class="text-subtitle-1 text--primary">{{ $t('dialog.edit_library.label_scanner') }}</span>
|
||||
<v-col>
|
||||
<v-checkbox
|
||||
v-model="form.emptyTrashAfterScan"
|
||||
:label="$t('dialog.edit_library.field_scanner_empty_trash_after_scan')"
|
||||
|
|
@ -109,6 +112,21 @@
|
|||
</template>
|
||||
</v-checkbox>
|
||||
|
||||
<v-checkbox
|
||||
v-model="form.scanOnStartup"
|
||||
:label="$t('dialog.edit_library.field_scanner_scan_startup')"
|
||||
hide-details
|
||||
class="mx-4"
|
||||
/>
|
||||
|
||||
<v-select :items="scanInterval"
|
||||
v-model="form.scanInterval"
|
||||
:label="$t('dialog.edit_library.field_scan_interval')"
|
||||
flat
|
||||
hide-details
|
||||
class="mx-4 mt-3"
|
||||
/>
|
||||
|
||||
<v-text-field v-model="form.oneshotsDirectory"
|
||||
clearable
|
||||
:label="$t('dialog.edit_library.field_oneshotsdirectory')"
|
||||
|
|
@ -124,8 +142,35 @@
|
|||
</v-tooltip>
|
||||
</template>
|
||||
</v-text-field>
|
||||
|
||||
<div class="mx-4">
|
||||
<span class="text-subtitle-1 text--primary">{{
|
||||
$t('dialog.edit_library.label_scan_types')
|
||||
}}</span>
|
||||
<v-chip-group
|
||||
multiple
|
||||
v-model="form.scanTypes"
|
||||
active-class="primary"
|
||||
>
|
||||
<v-chip v-for="type in fileTypes"
|
||||
:key="type.value"
|
||||
:value="type.value"
|
||||
filter
|
||||
outlined
|
||||
>{{ type.text }}
|
||||
</v-chip>
|
||||
</v-chip-group>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</v-tab-item>
|
||||
|
||||
<!-- Tab: Options -->
|
||||
<v-tab-item>
|
||||
<v-card flat :min-height="$vuetify.breakpoint.xs ? $vuetify.breakpoint.height * .8 : undefined">
|
||||
<v-container fluid>
|
||||
<v-row>
|
||||
<v-col cols="auto">
|
||||
<span class="text-subtitle-1 text--primary">{{ $t('dialog.edit_library.label_analysis') }}</span>
|
||||
|
|
@ -376,7 +421,7 @@ import FileBrowserDialog from '@/components/dialogs/FileBrowserDialog.vue'
|
|||
import Vue from 'vue'
|
||||
import {required} from 'vuelidate/lib/validators'
|
||||
import {ERROR} from '@/types/events'
|
||||
import {SeriesCoverDto} from '@/types/enum-libraries'
|
||||
import {ScanIntervalDto, SeriesCoverDto} from '@/types/enum-libraries'
|
||||
import {LibraryDto} from '@/types/komga-libraries'
|
||||
|
||||
export default Vue.extend({
|
||||
|
|
@ -401,6 +446,9 @@ export default Vue.extend({
|
|||
importLocalArtwork: true,
|
||||
importBarcodeIsbn: false,
|
||||
scanForceModifiedTime: false,
|
||||
scanInterval: ScanIntervalDto.EVERY_6H,
|
||||
scanOnStartup: false,
|
||||
scanTypes: [],
|
||||
repairExtensions: false,
|
||||
convertToCbz: false,
|
||||
emptyTrashAfterScan: false,
|
||||
|
|
@ -421,7 +469,7 @@ export default Vue.extend({
|
|||
return this.library ? this.$t('dialog.edit_library.button_confirm_edit').toString() : this.$t('dialog.edit_library.button_confirm_add').toString()
|
||||
},
|
||||
showNext(): boolean {
|
||||
return !this.library && this.tab !== 2
|
||||
return !this.library && this.tab !== 3
|
||||
},
|
||||
seriesCover(): any[] {
|
||||
return Object.keys(SeriesCoverDto).map(x => ({
|
||||
|
|
@ -429,6 +477,24 @@ export default Vue.extend({
|
|||
value: x,
|
||||
}))
|
||||
},
|
||||
scanInterval(): any[] {
|
||||
return Object.keys(ScanIntervalDto).map(x => ({
|
||||
text: this.$t(`enums.scan_interval.${x}`),
|
||||
value: x,
|
||||
}))
|
||||
},
|
||||
fileTypes(): any[] {
|
||||
return [{
|
||||
text: this.$t('common.cbx').toString(),
|
||||
value: 'cbx',
|
||||
}, {
|
||||
text: this.$t('common.pdf').toString(),
|
||||
value: 'pdf',
|
||||
}, {
|
||||
text: this.$t('common.epub').toString(),
|
||||
value: 'epub',
|
||||
}]
|
||||
},
|
||||
|
||||
importComicInfo: {
|
||||
get: function (): number {
|
||||
|
|
@ -534,6 +600,13 @@ export default Vue.extend({
|
|||
this.form.importLocalArtwork = library ? library.importLocalArtwork : true
|
||||
this.form.importBarcodeIsbn = library ? library.importBarcodeIsbn : false
|
||||
this.form.scanForceModifiedTime = library ? library.scanForceModifiedTime : false
|
||||
this.form.scanInterval = library ? library.scanInterval : ScanIntervalDto.EVERY_6H
|
||||
this.form.scanOnStartup = library ? library.scanOnStartup : false
|
||||
this.form.scanTypes = []
|
||||
if (!library) this.form.scanTypes = ['cbx', 'pdf', 'epub']
|
||||
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.repairExtensions = library ? library.repairExtensions : false
|
||||
this.form.convertToCbz = library ? library.convertToCbz : false
|
||||
this.form.emptyTrashAfterScan = library ? library.emptyTrashAfterScan : false
|
||||
|
|
@ -562,6 +635,11 @@ export default Vue.extend({
|
|||
importLocalArtwork: this.form.importLocalArtwork,
|
||||
importBarcodeIsbn: this.form.importBarcodeIsbn,
|
||||
scanForceModifiedTime: this.form.scanForceModifiedTime,
|
||||
scanInterval: this.form.scanInterval,
|
||||
scanOnStartup: this.form.scanOnStartup,
|
||||
scanCbx: this.form.scanTypes.includes('cbx'),
|
||||
scanPdf: this.form.scanTypes.includes('pdf'),
|
||||
scanEpub: this.form.scanTypes.includes('epub'),
|
||||
repairExtensions: this.form.repairExtensions,
|
||||
convertToCbz: this.form.convertToCbz,
|
||||
emptyTrashAfterScan: this.form.emptyTrashAfterScan,
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@
|
|||
"books_n": "No book | 1 book | {count} books",
|
||||
"books_total": "{count} / {total} books",
|
||||
"cancel": "Cancel",
|
||||
"cbx": "Comic Book archives",
|
||||
"choose_image": "Choose an image",
|
||||
"close": "Close",
|
||||
"collections": "Collections",
|
||||
|
|
@ -209,6 +210,7 @@
|
|||
"download": "Download",
|
||||
"drag_drop": "drag and drop",
|
||||
"email": "Email",
|
||||
"epub": "Epub",
|
||||
"filename": "Filename",
|
||||
"filter_no_matches": "The active filter has no matches",
|
||||
"genre": "Genre",
|
||||
|
|
@ -230,6 +232,7 @@
|
|||
"pages_left": "No pages left | 1 page left | {count} pages left",
|
||||
"pages_n": "No pages | 1 page | {count} pages",
|
||||
"password": "Password",
|
||||
"pdf": "PDF",
|
||||
"pending_tasks": "No pending tasks | 1 pending task | {count} pending tasks",
|
||||
"publisher": "Publisher",
|
||||
"read": "Read",
|
||||
|
|
@ -432,8 +435,10 @@
|
|||
"field_oneshotsdirectory": "One-Shots directory",
|
||||
"field_repair_extensions": "Automatically repair incorrect file extensions",
|
||||
"field_root_folder": "Root folder",
|
||||
"field_scan_interval": "Scan interval",
|
||||
"field_scanner_empty_trash_after_scan": "Empty trash automatically after every scan",
|
||||
"field_scanner_force_directory_modified_time": "Force directory modified time",
|
||||
"field_scanner_scan_startup": "Scan on startup",
|
||||
"field_series_cover": "Series cover",
|
||||
"file_browser_dialog_button_confirm": "Choose",
|
||||
"file_browser_dialog_title": "Library's root folder",
|
||||
|
|
@ -444,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_types": "Scan for these file types",
|
||||
"label_scanner": "Scanner",
|
||||
"label_series_cover": "Series cover",
|
||||
"tab_general": "General",
|
||||
|
|
@ -651,6 +657,14 @@
|
|||
"VERTICAL": "Vertical",
|
||||
"WEBTOON": "Webtoon"
|
||||
},
|
||||
"scan_interval": {
|
||||
"DAILY": "Daily",
|
||||
"DISABLED": "Disabled",
|
||||
"EVERY_12H": "Every 12 hours",
|
||||
"EVERY_6H": "Every 6 hours",
|
||||
"HOURLY": "Hourly",
|
||||
"WEEKLY": "Weekly"
|
||||
},
|
||||
"series_cover": {
|
||||
"FIRST": "First",
|
||||
"FIRST_UNREAD_OR_FIRST": "First unread else first",
|
||||
|
|
|
|||
|
|
@ -4,3 +4,12 @@ export enum SeriesCoverDto {
|
|||
FIRST_UNREAD_OR_LAST = 'FIRST_UNREAD_OR_LAST',
|
||||
LAST = 'LAST',
|
||||
}
|
||||
|
||||
export enum ScanIntervalDto {
|
||||
DISABLED = 'DISABLED',
|
||||
HOURLY = 'HOURLY',
|
||||
EVERY_6H = 'EVERY_6H',
|
||||
EVERY_12H = 'EVERY_12H',
|
||||
DAILY = 'DAILY',
|
||||
WEEKLY = 'WEEKLY',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,35 @@
|
|||
import {SeriesCoverDto} from '@/types/enum-libraries'
|
||||
import {ScanIntervalDto, SeriesCoverDto} from '@/types/enum-libraries'
|
||||
|
||||
export interface LibraryDto {
|
||||
id: string,
|
||||
name: string,
|
||||
root: string,
|
||||
importComicInfoBook: boolean,
|
||||
importComicInfoSeries: boolean,
|
||||
importComicInfoCollection: boolean,
|
||||
importComicInfoReadList: boolean,
|
||||
importComicInfoSeriesAppendVolume: boolean,
|
||||
importEpubBook: boolean,
|
||||
importEpubSeries: boolean,
|
||||
importMylarSeries: boolean,
|
||||
importLocalArtwork: boolean,
|
||||
importBarcodeIsbn: boolean,
|
||||
scanForceModifiedTime: boolean,
|
||||
scanInterval: ScanIntervalDto,
|
||||
scanOnStartup: boolean,
|
||||
scanCbx: boolean,
|
||||
scanPdf: boolean,
|
||||
scanEpub: boolean,
|
||||
repairExtensions: boolean,
|
||||
convertToCbz: boolean,
|
||||
emptyTrashAfterScan: boolean,
|
||||
seriesCover: SeriesCoverDto,
|
||||
hashFiles: boolean,
|
||||
hashPages: boolean,
|
||||
analyzeDimensions: boolean,
|
||||
oneshotsDirectory: string,
|
||||
unavailable: boolean,
|
||||
}
|
||||
|
||||
export interface LibraryCreationDto {
|
||||
name: string,
|
||||
|
|
@ -14,6 +45,11 @@ export interface LibraryCreationDto {
|
|||
importLocalArtwork: boolean,
|
||||
importBarcodeIsbn: boolean,
|
||||
scanForceModifiedTime: boolean,
|
||||
scanInterval: ScanIntervalDto,
|
||||
scanOnStartup: boolean,
|
||||
scanCbx: boolean,
|
||||
scanPdf: boolean,
|
||||
scanEpub: boolean,
|
||||
repairExtensions: boolean,
|
||||
convertToCbz: boolean,
|
||||
emptyTrashAfterScan: boolean,
|
||||
|
|
@ -38,6 +74,11 @@ export interface LibraryUpdateDto {
|
|||
importLocalArtwork: boolean,
|
||||
importBarcodeIsbn: boolean,
|
||||
scanForceModifiedTime: boolean,
|
||||
scanInterval: ScanIntervalDto,
|
||||
scanOnStartup: boolean,
|
||||
scanCbx: boolean,
|
||||
scanPdf: boolean,
|
||||
scanEpub: boolean,
|
||||
repairExtensions: boolean,
|
||||
convertToCbz: boolean,
|
||||
emptyTrashAfterScan: boolean,
|
||||
|
|
@ -47,29 +88,3 @@ export interface LibraryUpdateDto {
|
|||
analyzeDimensions: boolean,
|
||||
oneshotsDirectory: string,
|
||||
}
|
||||
|
||||
export interface LibraryDto {
|
||||
id: string,
|
||||
name: string,
|
||||
root: string,
|
||||
importComicInfoBook: boolean,
|
||||
importComicInfoSeries: boolean,
|
||||
importComicInfoCollection: boolean,
|
||||
importComicInfoReadList: boolean,
|
||||
importComicInfoSeriesAppendVolume: boolean,
|
||||
importEpubBook: boolean,
|
||||
importEpubSeries: boolean,
|
||||
importMylarSeries: boolean,
|
||||
importLocalArtwork: boolean,
|
||||
importBarcodeIsbn: boolean,
|
||||
scanForceModifiedTime: boolean,
|
||||
repairExtensions: boolean,
|
||||
convertToCbz: boolean,
|
||||
emptyTrashAfterScan: boolean,
|
||||
seriesCover: SeriesCoverDto,
|
||||
hashFiles: boolean,
|
||||
hashPages: boolean,
|
||||
analyzeDimensions: boolean,
|
||||
oneshotsDirectory: string,
|
||||
unavailable: boolean,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue