mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: special characters in genre names (#1549)
This commit is contained in:
parent
6d4b6969ef
commit
33b96fe9eb
3 changed files with 9 additions and 9 deletions
|
@ -6,7 +6,10 @@
|
|||
<div class="main-scroll-wrap">
|
||||
<ul class="genres" v-if="genres">
|
||||
<li v-for="genre in genres" :key="genre.name" :class="`level-${getLevel(genre)}`">
|
||||
<a :href="`/#/genres/${genre.name}`" :title="`${genre.name}: ${pluralize(genre.song_count, 'song')}`">
|
||||
<a
|
||||
:href="`/#/genres/${encodeURIComponent(genre.name)}`"
|
||||
:title="`${genre.name}: ${pluralize(genre.song_count, 'song')}`"
|
||||
>
|
||||
<span class="name">{{ genre.name }}</span>
|
||||
<span class="count">{{ genre.song_count }}</span>
|
||||
</a>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<section id="genreWrapper">
|
||||
<ScreenHeader :layout="headerLayout" v-if="genre">
|
||||
Genre: <span class="text-thin">{{ name }}</span>
|
||||
Genre: <span class="text-thin">{{ decodeURIComponent(name) }}</span>
|
||||
<ControlsToggle v-if="songs.length" v-model="showingControls"/>
|
||||
|
||||
<template v-slot:thumbnail>
|
||||
|
@ -125,10 +125,7 @@ const refresh = async () => {
|
|||
await fetch()
|
||||
}
|
||||
|
||||
const getNameFromRoute = () => {
|
||||
let param = router.$currentRoute.value.params?.name
|
||||
return param ? decodeURI(param) : null
|
||||
}
|
||||
const getNameFromRoute = () => router.$currentRoute.value.params?.name || null
|
||||
|
||||
router.onRouteChanged(route => {
|
||||
if (route.screen !== 'Genre') return
|
||||
|
|
|
@ -58,9 +58,9 @@ Route::prefix('api')->middleware('api')->group(static function (): void {
|
|||
Route::get('songs/favorite', [FavoriteSongController::class, 'index']);
|
||||
Route::delete('songs', DeleteSongsController::class);
|
||||
|
||||
Route::apiResource('genres', GenreController::class);
|
||||
Route::get('genres/{genre}/songs', GenreSongController::class);
|
||||
Route::get('genres/{genre}/songs/random', FetchRandomSongsInGenreController::class);
|
||||
Route::get('genres/{genre}/songs', GenreSongController::class)->where('genre', '.*');
|
||||
Route::get('genres/{genre}/songs/random', FetchRandomSongsInGenreController::class)->where('genre', '.*');
|
||||
Route::apiResource('genres', GenreController::class)->where(['genre' => '.*']);
|
||||
|
||||
Route::apiResource('users', UserController::class);
|
||||
|
||||
|
|
Loading…
Reference in a new issue