Genre-Badges alphabetisch
Nach Häufigkeit sortiert wanderten sie bei jedem Reiterwechsel an eine andere Stelle. Alphabetisch findet man ein Genre immer dort, wo man es zuletzt gesehen hat. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013XVnRop5c3or3B8xE2hpgZ
This commit is contained in:
@@ -126,8 +126,10 @@ const genreOptions = computed(() => {
|
|||||||
for (const movie of pool) {
|
for (const movie of pool) {
|
||||||
for (const genre of movie.genres || []) counts.set(genre, (counts.get(genre) || 0) + 1)
|
for (const genre of movie.genres || []) counts.set(genre, (counts.get(genre) || 0) + 1)
|
||||||
}
|
}
|
||||||
|
// Alphabetisch, damit man ein Genre an derselben Stelle wiederfindet.
|
||||||
|
// Nach Häufigkeit sortiert wanderten die Badges bei jedem Reiterwechsel.
|
||||||
return [...counts.entries()]
|
return [...counts.entries()]
|
||||||
.sort((a, b) => b[1] - a[1])
|
.sort((a, b) => a[0].localeCompare(b[0], 'de'))
|
||||||
.map(([genre, count]) => ({ genre, count }))
|
.map(([genre, count]) => ({ genre, count }))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user