|
@ -14,6 +14,18 @@ export interface ConfigPage { |
|
|
playback: { |
|
|
playback: { |
|
|
filters: PlaybackFilter[]; |
|
|
filters: PlaybackFilter[]; |
|
|
}; |
|
|
}; |
|
|
|
|
|
sort: { |
|
|
|
|
|
albumListPage?: SortColumn; |
|
|
|
|
|
albumPage?: SortColumn; |
|
|
|
|
|
artistListPage?: SortColumn; |
|
|
|
|
|
artistPage?: SortColumn; |
|
|
|
|
|
favoriteAlbumsPage?: SortColumn; |
|
|
|
|
|
favoriteArtistsPage?: SortColumn; |
|
|
|
|
|
favoriteTracksPage?: SortColumn; |
|
|
|
|
|
folderListPage?: SortColumn; |
|
|
|
|
|
genreListPage?: SortColumn; |
|
|
|
|
|
playlistListPage?: SortColumn; |
|
|
|
|
|
}; |
|
|
lookAndFeel: { |
|
|
lookAndFeel: { |
|
|
listView: { |
|
|
listView: { |
|
|
music: { columns: any; rowHeight: number; fontSize: number }; |
|
|
music: { columns: any; rowHeight: number; fontSize: number }; |
|
@ -29,6 +41,11 @@ export interface ConfigPage { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface SortColumn { |
|
|
|
|
|
sortColumn?: string; |
|
|
|
|
|
sortType: 'asc' | 'desc'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
interface PlaybackFilter { |
|
|
interface PlaybackFilter { |
|
|
filter: string; |
|
|
filter: string; |
|
|
enabled: boolean; |
|
|
enabled: boolean; |
|
@ -44,6 +61,18 @@ const initialState: ConfigPage = { |
|
|
playback: { |
|
|
playback: { |
|
|
filters: parsedSettings.playbackFilters, |
|
|
filters: parsedSettings.playbackFilters, |
|
|
}, |
|
|
}, |
|
|
|
|
|
sort: { |
|
|
|
|
|
albumListPage: undefined, |
|
|
|
|
|
albumPage: undefined, |
|
|
|
|
|
artistListPage: undefined, |
|
|
|
|
|
artistPage: undefined, |
|
|
|
|
|
favoriteAlbumsPage: undefined, |
|
|
|
|
|
favoriteArtistsPage: undefined, |
|
|
|
|
|
favoriteTracksPage: undefined, |
|
|
|
|
|
folderListPage: undefined, |
|
|
|
|
|
genreListPage: undefined, |
|
|
|
|
|
playlistListPage: undefined, |
|
|
|
|
|
}, |
|
|
lookAndFeel: { |
|
|
lookAndFeel: { |
|
|
listView: { |
|
|
listView: { |
|
|
music: { |
|
|
music: { |
|
@ -103,6 +132,26 @@ const configSlice = createSlice({ |
|
|
state.active = action.payload; |
|
|
state.active = action.payload; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setPageSort: ( |
|
|
|
|
|
state, |
|
|
|
|
|
action: PayloadAction<{ |
|
|
|
|
|
page: |
|
|
|
|
|
| 'albumListPage' |
|
|
|
|
|
| 'albumPage' |
|
|
|
|
|
| 'artistListPage' |
|
|
|
|
|
| 'artistPage' |
|
|
|
|
|
| 'favoriteAlbumsPage' |
|
|
|
|
|
| 'favoriteArtistsPage' |
|
|
|
|
|
| 'favoriteTracksPage' |
|
|
|
|
|
| 'folderListPage' |
|
|
|
|
|
| 'genreListPage' |
|
|
|
|
|
| 'playlistListPage'; |
|
|
|
|
|
sort: SortColumn; |
|
|
|
|
|
}> |
|
|
|
|
|
) => { |
|
|
|
|
|
state.sort[action.payload.page] = action.payload.sort; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
appendPlaybackFilter: (state, action: PayloadAction<PlaybackFilter>) => { |
|
|
appendPlaybackFilter: (state, action: PayloadAction<PlaybackFilter>) => { |
|
|
if (!state.playback.filters.find((f: PlaybackFilter) => f.filter === action.payload.filter)) { |
|
|
if (!state.playback.filters.find((f: PlaybackFilter) => f.filter === action.payload.filter)) { |
|
|
state.playback.filters.push(action.payload); |
|
|
state.playback.filters.push(action.payload); |
|
@ -165,6 +214,7 @@ const configSlice = createSlice({ |
|
|
|
|
|
|
|
|
export const { |
|
|
export const { |
|
|
setActive, |
|
|
setActive, |
|
|
|
|
|
setPageSort, |
|
|
appendPlaybackFilter, |
|
|
appendPlaybackFilter, |
|
|
removePlaybackFilter, |
|
|
removePlaybackFilter, |
|
|
setPlaybackFilter, |
|
|
setPlaybackFilter, |
|
|