From e5e20750e5686102b2b87baeeba6fb4a823ebc57 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 22 Jan 2020 14:18:55 -0500 Subject: [PATCH] UI: Fine tuning the resource navigation --- ui/src/App.js | 4 ++-- ui/src/album/AlbumList.js | 9 +++++++-- ui/src/artist/ArtistList.js | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ui/src/App.js b/ui/src/App.js index 9504f1cbb..0dc096966 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -16,9 +16,9 @@ const App = () => ( layout={Layout} loginPage={Login} > - - + + ) diff --git a/ui/src/album/AlbumList.js b/ui/src/album/AlbumList.js index cc0cc79e7..92ad99e7a 100644 --- a/ui/src/album/AlbumList.js +++ b/ui/src/album/AlbumList.js @@ -34,8 +34,13 @@ const AlbumDetails = (props) => { ) } -const albumRowClick = (id, basePath, record) => - `/song?filter={"artist":"${record.artist}","album":"${record.name}","album_id":"${record.id}"}&order=ASC&sort=trackNumber` +const albumRowClick = (id, basePath, record) => { + const filter = { album: record.name, album_id: id } + if (!record.compilation) { + filter.artist = record.artist + } + return `/song?filter=${JSON.stringify(filter)}&order=ASC&sort=trackNumber` +} const AlbumList = (props) => ( ( ) -const artistRowClick = (id, basePath, record) => - `/album?filter={"artist":"${record.name}","artist_id":"${record.id}"}&order=ASC&sort=year` +const artistRowClick = (id, basePath, record) => { + const filter = { artist_id: id } + return `/album?filter=${JSON.stringify(filter)}&order=ASC&sort=year` +} const ArtistList = (props) => (