mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
[enhancement]: Support toggling Album/Track view for gneres (#591)
* [enhancement]: Support toggling Album/Track view for gneres The _primary_ purpose of this PR is to enable viewing tracks OR albums for genres. This has a few requirements: 1. Ability to set default route for genres, **except** when already on song/album page 2. Ability to toggle between album and genre view 3. Fixed refresh for genre ID Additionally, there was some refactoring: - Since the *-list-headers had very similar functions for search, export that as a hook instead * also use hook for album artist * support switching albumartist tracks/albums * remove toggle on song/album list, simplify logic
This commit is contained in:
parent
595eba152a
commit
ba531505af
20 changed files with 336 additions and 158 deletions
|
|
@ -4,6 +4,7 @@ import isElectron from 'is-electron';
|
|||
import { Select, Tooltip, NumberInput, Switch, Slider } from '/@/renderer/components';
|
||||
import { SettingsSection } from '/@/renderer/features/settings/components/settings-section';
|
||||
import {
|
||||
GenreTarget,
|
||||
SideQueueType,
|
||||
useGeneralSettings,
|
||||
useSettingsStoreActions,
|
||||
|
|
@ -341,6 +342,41 @@ export const ControlSettings = () => {
|
|||
}),
|
||||
title: t('setting.externalLinks', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Select
|
||||
data={[
|
||||
{
|
||||
label: t('entity.album_other', {
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: GenreTarget.ALBUM,
|
||||
},
|
||||
{
|
||||
label: t('entity.track_other', {
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: GenreTarget.TRACK,
|
||||
},
|
||||
]}
|
||||
defaultValue={settings.genreTarget}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
general: {
|
||||
...settings,
|
||||
genreTarget: e as GenreTarget,
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
),
|
||||
description: t('setting.genreBehavior', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.genreBehavior', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={controlOptions} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue