Enable turn on/off Favorites/Loved feature. (#917)
* Added option to enable/disable favorites in Song * Added option to enable/disable favorites in Artist * Added option to enable/disable favorites in Albums and Favorites tab in sidebar * Added option to enable/disable favorites in Player * Set default value of enableFavourites as true * Improved the functionality to enable/disable Favorites * Add `EnableFavourites` config option Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
ArtistSimpleList,
|
||||
} from '../common'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import config from '../config'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
contextHeader: {
|
||||
@@ -41,11 +42,13 @@ const useStyles = makeStyles({
|
||||
const ArtistFilter = (props) => (
|
||||
<Filter {...props} variant={'outlined'}>
|
||||
<SearchInput source="name" alwaysOn />
|
||||
<QuickFilter
|
||||
source="starred"
|
||||
label={<FavoriteIcon fontSize={'small'} />}
|
||||
defaultValue={true}
|
||||
/>
|
||||
{config.enableFavourites && (
|
||||
<QuickFilter
|
||||
source="starred"
|
||||
label={<FavoriteIcon fontSize={'small'} />}
|
||||
defaultValue={true}
|
||||
/>
|
||||
)}
|
||||
</Filter>
|
||||
)
|
||||
|
||||
@@ -69,12 +72,15 @@ const ArtistListView = ({ hasShow, hasEdit, hasList, width, ...rest }) => {
|
||||
source={'starred'}
|
||||
sortBy={'starred ASC, starredAt ASC'}
|
||||
sortByOrder={'DESC'}
|
||||
sortable={config.enableFavourites}
|
||||
className={classes.contextMenu}
|
||||
label={
|
||||
<FavoriteBorderIcon
|
||||
fontSize={'small'}
|
||||
className={classes.contextHeader}
|
||||
/>
|
||||
config.enableFavourites && (
|
||||
<FavoriteBorderIcon
|
||||
fontSize={'small'}
|
||||
className={classes.contextHeader}
|
||||
/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Datagrid>
|
||||
|
||||
Reference in New Issue
Block a user