diff --git a/src/js/components/List.js b/src/js/components/List.js index 72824ef5..11f5eadd 100755 --- a/src/js/components/List.js +++ b/src/js/components/List.js @@ -21,7 +21,7 @@ class List extends React.Component{ // make sure we haven't clicked a nested link (ie Artist name) if( e.target.tagName.toLowerCase() !== 'a' ){ - hashHistory.push( this.props.link_prefix + encodeURIComponent(uri) ); + hashHistory.push( (this.props.link_prefix ? this.props.link_prefix : '') + uri ); } } diff --git a/src/js/views/library/LibraryBrowse.js b/src/js/views/library/LibraryBrowse.js index a6b151d9..3ee8c157 100755 --- a/src/js/views/library/LibraryBrowse.js +++ b/src/js/views/library/LibraryBrowse.js @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' -import { Link } from 'react-router' +import { Link, hashHistory } from 'react-router' import FontAwesome from 'react-fontawesome' import Header from '../../components/Header' @@ -44,6 +44,7 @@ class LibraryBrowse extends React.Component{ if (typeof(props.params.uri) !== 'undefined'){ uri = decodeURIComponent(props.params.uri) } + this.props.mopidyActions.getDirectory(uri) } } @@ -56,11 +57,31 @@ class LibraryBrowse extends React.Component{ if (directory[i].type && directory[i].type == 'track') { tracks.push( directory[i] ) } else { + var uri = directory[i].uri + + // If we've navigated to a handled asset type, use our standard views + switch (helpers.uriType(uri)){ + case 'album': + uri = global.baseURL+'album/'+uri + break + + case 'artist': + uri = global.baseURL+'artist/'+uri + break + + case 'playlist': + uri = global.baseURL+'playlist/'+uri + break + + default: + uri = global.baseURL+"library/browse/"+encodeURIComponent(uri) + } + folders.push(Object.assign( {}, directory[i], { - uri: encodeURIComponent(directory[i].uri) + uri: uri } )) } @@ -105,8 +126,7 @@ class LibraryBrowse extends React.Component{ + className="library-local-directory-list" />