Add 5-star rating system(#986)
* Added Star Rating functionality for Songs * Added Star Rating functionality for Artists * Added Star Rating functionality for AlbumListView * Added Star Rating functionality for AlbumDetails and improved typography for title * Added functionality to turn on/off Star Rating functionality for Songs * Added functionality to turn on/off Star Rating functionality for Artists * Added functionality to turn on/off Star Rating functionality for Albums * Added enableStarRating to server config * Resolved the bugs and improved the ratings functionality. * synced repo and removed duplicate key * changed the default rating size to small, and changed the color to match the theme. * Added translations for ratings, and Top Rated tab in side menu. * Changed rating translation to topRated in albumLists, and added has_rating filter to topRated. * Added empty stars icon to RatingField. * Added sortable=false in AlbumSongs and added sortByOrder=DESC in all List components. * Added translations for rating, for artists and albums, and removed the sortByOrder=DESC from SimpleLists.
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
QuickFilter,
|
||||
SongTitleField,
|
||||
SongSimpleList,
|
||||
RatingField,
|
||||
} from '../common'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { setTrack } from '../actions'
|
||||
@@ -40,11 +41,17 @@ const useStyles = makeStyles({
|
||||
'& $contextMenu': {
|
||||
visibility: 'visible',
|
||||
},
|
||||
'& $ratingField': {
|
||||
visibility: 'visible',
|
||||
},
|
||||
},
|
||||
},
|
||||
contextMenu: {
|
||||
visibility: 'hidden',
|
||||
},
|
||||
ratingField: {
|
||||
visibility: 'hidden',
|
||||
},
|
||||
})
|
||||
|
||||
const SongFilter = (props) => (
|
||||
@@ -114,6 +121,14 @@ const SongList = (props) => {
|
||||
)}
|
||||
<QualityInfo source="quality" sortable={false} />
|
||||
<DurationField source="duration" />
|
||||
{config.enableStarRating && (
|
||||
<RatingField
|
||||
source="rating"
|
||||
sortByOrder={'DESC'}
|
||||
resource={'song'}
|
||||
className={classes.ratingField}
|
||||
/>
|
||||
)}
|
||||
<SongContextMenu
|
||||
source={'starred'}
|
||||
sortBy={'starred ASC, starredAt ASC'}
|
||||
|
||||
Reference in New Issue
Block a user