mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
provide transcoding support
This commit is contained in:
parent
da95a644c8
commit
528bef01f0
24 changed files with 347 additions and 69 deletions
|
|
@ -992,6 +992,9 @@ export const usePlayerStore = create<PlayerSlice>()(
|
|||
},
|
||||
repeat: PlayerRepeat.NONE,
|
||||
shuffle: PlayerShuffle.NONE,
|
||||
transcode: {
|
||||
enabled: false,
|
||||
},
|
||||
volume: 50,
|
||||
})),
|
||||
{ name: 'store_player' },
|
||||
|
|
|
|||
|
|
@ -177,6 +177,12 @@ export enum GenreTarget {
|
|||
TRACK = 'track',
|
||||
}
|
||||
|
||||
export type TranscodingConfig = {
|
||||
bitrate?: number;
|
||||
enabled: boolean;
|
||||
format?: string;
|
||||
};
|
||||
|
||||
export interface SettingsState {
|
||||
css: {
|
||||
content: string;
|
||||
|
|
@ -264,6 +270,7 @@ export interface SettingsState {
|
|||
scrobbleAtPercentage: number;
|
||||
};
|
||||
style: PlaybackStyle;
|
||||
transcode: TranscodingConfig;
|
||||
type: PlaybackType;
|
||||
webAudio: boolean;
|
||||
};
|
||||
|
|
@ -300,6 +307,7 @@ export interface SettingsSlice extends SettingsState {
|
|||
setSettings: (data: Partial<SettingsState>) => void;
|
||||
setSidebarItems: (items: SidebarItemType[]) => void;
|
||||
setTable: (type: TableType, data: DataTableProps) => void;
|
||||
setTranscodingConfig: (config: TranscodingConfig) => void;
|
||||
toggleContextMenuItem: (item: ContextMenuItemType) => void;
|
||||
toggleSidebarCollapseShare: () => void;
|
||||
};
|
||||
|
|
@ -439,6 +447,9 @@ const initialState: SettingsState = {
|
|||
scrobbleAtPercentage: 75,
|
||||
},
|
||||
style: PlaybackStyle.GAPLESS,
|
||||
transcode: {
|
||||
enabled: false,
|
||||
},
|
||||
type: PlaybackType.WEB,
|
||||
webAudio: true,
|
||||
},
|
||||
|
|
@ -662,6 +673,11 @@ export const useSettingsStore = create<SettingsSlice>()(
|
|||
state.tables[type] = data;
|
||||
});
|
||||
},
|
||||
setTranscodingConfig: (config) => {
|
||||
set((state) => {
|
||||
state.playback.transcode = config;
|
||||
});
|
||||
},
|
||||
toggleContextMenuItem: (item: ContextMenuItemType) => {
|
||||
set((state) => {
|
||||
state.general.disabledContextMenu[item] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue