FEATURE: single source of truth for default values added
This commit is contained in:
@@ -1,24 +1,44 @@
|
||||
// web/frontend/src/stores/optionsStore.ts
|
||||
import { create } from 'zustand'
|
||||
import { SplitOptions } from '../types'
|
||||
import {
|
||||
DEFAULT_FORMAT,
|
||||
DEFAULT_OUTPUT_TEMPLATE,
|
||||
DEFAULT_REPLACEMENT_CHAR,
|
||||
DEFAULT_BAD_CHARS,
|
||||
DEFAULT_ALBUM,
|
||||
DEFAULT_COMMENT,
|
||||
DEFAULT_NO_COMMENT,
|
||||
DEFAULT_COMMENT_STREAM,
|
||||
DEFAULT_MERGE_COMMENTS,
|
||||
DEFAULT_COMMENT_SEPARATOR,
|
||||
DEFAULT_DROP_VIDEO,
|
||||
DEFAULT_DROP_SUBS,
|
||||
DEFAULT_NUMBER_TRACKS,
|
||||
DEFAULT_REPLACE_BAD_CHARS,
|
||||
DEFAULT_SKIP_EXISTING,
|
||||
DEFAULT_TRANSCODE_TO,
|
||||
DEFAULT_TRACKLIST_FORMAT,
|
||||
} from '../constants/generated'
|
||||
|
||||
const DEFAULT_OPTIONS: SplitOptions = {
|
||||
format: 'mp3',
|
||||
transcode_to: '',
|
||||
drop_video: false,
|
||||
drop_subs: false,
|
||||
number_tracks: false,
|
||||
replace_bad_chars: false,
|
||||
replacement_char: '_',
|
||||
bad_chars: '!@#№$;:%^&?*(){}[]\\/<>+=~`\' ',
|
||||
skip_existing: false,
|
||||
output_template: '%an-%tn.%ext',
|
||||
album: '',
|
||||
comment: '',
|
||||
no_comment: false,
|
||||
comment_stream: null,
|
||||
merge_comments: false,
|
||||
comment_separator: '; ',
|
||||
tracklist_format: '%ts %tn - %an', // NEW
|
||||
format: DEFAULT_FORMAT,
|
||||
transcode_to: DEFAULT_TRANSCODE_TO ?? '',
|
||||
drop_video: DEFAULT_DROP_VIDEO,
|
||||
drop_subs: DEFAULT_DROP_SUBS,
|
||||
number_tracks: DEFAULT_NUMBER_TRACKS,
|
||||
replace_bad_chars: DEFAULT_REPLACE_BAD_CHARS,
|
||||
replacement_char: DEFAULT_REPLACEMENT_CHAR,
|
||||
bad_chars: DEFAULT_BAD_CHARS,
|
||||
skip_existing: DEFAULT_SKIP_EXISTING,
|
||||
output_template: DEFAULT_OUTPUT_TEMPLATE,
|
||||
album: DEFAULT_ALBUM ?? '',
|
||||
comment: DEFAULT_COMMENT ?? '',
|
||||
no_comment: DEFAULT_NO_COMMENT,
|
||||
comment_stream: DEFAULT_COMMENT_STREAM,
|
||||
merge_comments: DEFAULT_MERGE_COMMENTS,
|
||||
comment_separator: DEFAULT_COMMENT_SEPARATOR,
|
||||
tracklist_format: DEFAULT_TRACKLIST_FORMAT,
|
||||
}
|
||||
|
||||
interface OptionsState {
|
||||
|
||||
Reference in New Issue
Block a user