mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-24 03:16:43 +02:00
support parsing and saving multi-valued tags
This commit is contained in:
@@ -744,6 +744,11 @@ const AutoDJSettingsSchema = z.object({
|
||||
timing: z.number(),
|
||||
});
|
||||
|
||||
const TagEditorSettingsSchema = z.object({
|
||||
favoriteValues: z.record(z.string(), z.array(z.string())),
|
||||
multiValueFields: z.array(z.string()),
|
||||
});
|
||||
|
||||
/**
|
||||
* This schema is used for validation of the imported settings json
|
||||
*/
|
||||
@@ -767,6 +772,7 @@ export const ValidationSettingsStateSchema = z.object({
|
||||
z.literal('window'),
|
||||
z.string(),
|
||||
]),
|
||||
tagEditor: TagEditorSettingsSchema,
|
||||
visualizer: VisualizerSettingsSchema,
|
||||
window: WindowSettingsSchema,
|
||||
});
|
||||
@@ -1988,6 +1994,10 @@ const initialState: SettingsState = {
|
||||
username: 'feishin',
|
||||
},
|
||||
tab: 'general',
|
||||
tagEditor: {
|
||||
favoriteValues: {},
|
||||
multiValueFields: ['artist', 'albumArtist', 'genre', 'composer', 'lyricist'],
|
||||
},
|
||||
visualizer: {
|
||||
audiomotionanalyzer: {
|
||||
alphaBars: false,
|
||||
@@ -2677,6 +2687,8 @@ export const useCssSettings = () => useSettingsStore((state) => state.css, shall
|
||||
export const useQueryBuilderSettings = () =>
|
||||
useSettingsStore((state) => state.queryBuilder, shallow);
|
||||
|
||||
export const useTagEditorSettings = () => useSettingsStore((state) => state.tagEditor, shallow);
|
||||
|
||||
const getSettingsStoreVersion = () => useSettingsStore.persist.getOptions().version!;
|
||||
|
||||
export const useSettingsForExport = (): SettingsState & { version: number } =>
|
||||
|
||||
Reference in New Issue
Block a user