Subdirectories now route to artist/album/playlist if backend type provided
This commit is contained in:
@ -57,6 +57,7 @@ class DiscoverCategories extends React.Component {
|
||||
className="grid--tiles"
|
||||
items={categories}
|
||||
getLink={(item) => `/discover/categories/${encodeUri(item.uri)}`}
|
||||
sourceIcon={false}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@ -31,7 +31,6 @@ class LibraryBrowse extends React.Component {
|
||||
const {
|
||||
loading,
|
||||
directory,
|
||||
mopidyActions,
|
||||
} = this.props;
|
||||
|
||||
if (!directory) {
|
||||
|
||||
@ -37,7 +37,12 @@ const Breadcrumbs = ({ uri }) => {
|
||||
const Subdirectories = ({ items, view }) => {
|
||||
if (!items.length) return null;
|
||||
|
||||
const link = (item) => `/library/browse/${encodeURIComponent(item.name)}/${encodeUri(item.uri)}`;
|
||||
// Only define the link for directories; allows URILink to intelligently route based on type
|
||||
const link = (item) => (
|
||||
item.type === 'directory'
|
||||
? `/library/browse/${encodeURIComponent(item.name)}/${encodeUri(item.uri)}`
|
||||
: null
|
||||
);
|
||||
|
||||
if (view === 'list') {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user