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:
team3
2026-08-31 13:54:11 +02:00
parent bbd1270fd9
commit b9dbd5e753

View File

@@ -126,8 +126,10 @@ const genreOptions = computed(() => {
for (const movie of pool) {
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()]
.sort((a, b) => b[1] - a[1])
.sort((a, b) => a[0].localeCompare(b[0], 'de'))
.map(([genre, count]) => ({ genre, count }))
})