feat: dedicated music page(s); pagination fixes; nav + color updates; assorted updates

This commit is contained in:
Cory Dransfeldt 2024-05-18 12:42:17 -07:00
parent 619abaca03
commit 00a94fc7a8
No known key found for this signature in database
36 changed files with 111 additions and 148 deletions

View file

@ -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)
}