mirror of
https://github.com/koel/koel
synced 2024-11-24 05:03:05 +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">
|
<div class="main-scroll-wrap">
|
||||||
<ul class="genres" v-if="genres">
|
<ul class="genres" v-if="genres">
|
||||||
<li v-for="genre in genres" :key="genre.name" :class="`level-${getLevel(genre)}`">
|
<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="name">{{ genre.name }}</span>
|
||||||
<span class="count">{{ genre.song_count }}</span>
|
<span class="count">{{ genre.song_count }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<section id="genreWrapper">
|
<section id="genreWrapper">
|
||||||
<ScreenHeader :layout="headerLayout" v-if="genre">
|
<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"/>
|
<ControlsToggle v-if="songs.length" v-model="showingControls"/>
|
||||||
|
|
||||||
<template v-slot:thumbnail>
|
<template v-slot:thumbnail>
|
||||||
|
@ -125,10 +125,7 @@ const refresh = async () => {
|
||||||
await fetch()
|
await fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNameFromRoute = () => {
|
const getNameFromRoute = () => router.$currentRoute.value.params?.name || null
|
||||||
let param = router.$currentRoute.value.params?.name
|
|
||||||
return param ? decodeURI(param) : null
|
|
||||||
}
|
|
||||||
|
|
||||||
router.onRouteChanged(route => {
|
router.onRouteChanged(route => {
|
||||||
if (route.screen !== 'Genre') return
|
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::get('songs/favorite', [FavoriteSongController::class, 'index']);
|
||||||
Route::delete('songs', DeleteSongsController::class);
|
Route::delete('songs', DeleteSongsController::class);
|
||||||
|
|
||||||
Route::apiResource('genres', GenreController::class);
|
Route::get('genres/{genre}/songs', GenreSongController::class)->where('genre', '.*');
|
||||||
Route::get('genres/{genre}/songs', GenreSongController::class);
|
Route::get('genres/{genre}/songs/random', FetchRandomSongsInGenreController::class)->where('genre', '.*');
|
||||||
Route::get('genres/{genre}/songs/random', FetchRandomSongsInGenreController::class);
|
Route::apiResource('genres', GenreController::class)->where(['genre' => '.*']);
|
||||||
|
|
||||||
Route::apiResource('users', UserController::class);
|
Route::apiResource('users', UserController::class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue