feat: dedicated music page(s); pagination fixes; nav + color updates; assorted updates
This commit is contained in:
parent
619abaca03
commit
00a94fc7a8
36 changed files with 111 additions and 148 deletions
|
@ -93,6 +93,11 @@ const aggregateData = (data, groupByField, groupByType, sort = true) => {
|
|||
aggregation[key].plays++
|
||||
})
|
||||
const aggregatedData = sort ? Object.values(aggregation).sort((a, b) => b.plays - a.plays) : Object.values(aggregation)
|
||||
|
||||
aggregatedData.forEach((item, index) => {
|
||||
item.rank = index + 1
|
||||
})
|
||||
|
||||
return aggregatedData.filter(item => item.plays > 0)
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue