URI handling and encoding

This commit is contained in:
James Barnsley
2019-01-17 15:54:04 +13:00
parent d5c946456f
commit 9144a194e1
6 changed files with 1950 additions and 1980 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
// Release details // Release details
// These are automatically injected to built HTML // These are automatically injected to built HTML
var build = "1547579515"; var build = "1547667440";
var version = "3.31.8"; var version = "3.31.8";
// Construct the script tag // Construct the script tag

View File

@ -411,8 +411,8 @@ class App extends React.Component{
<Route exact path="/library/albums" component={LibraryAlbums} /> <Route exact path="/library/albums" component={LibraryAlbums} />
<Route exact path="/library/tracks" component={LibraryTracks} /> <Route exact path="/library/tracks" component={LibraryTracks} />
<Route exact path="/library/playlists" component={LibraryPlaylists} /> <Route exact path="/library/playlists" component={LibraryPlaylists} />
<Route exact path="/library/browse/:uri" component={LibraryBrowseDirectory} />
<Route exact path="/library/browse" component={LibraryBrowse} /> <Route exact path="/library/browse" component={LibraryBrowse} />
<Route exact path="/library/browse/:uri" component={LibraryBrowseDirectory} />
<Route> <Route>
<h1>I'm lost</h1> <h1>I'm lost</h1>

View File

@ -26,11 +26,11 @@ class LibraryBrowse extends React.Component{
} }
componentDidMount(){ componentDidMount(){
this.loadDirectory() this.loadDirectory();
this.props.uiActions.setWindowTitle("Browse");
} }
componentWillReceiveProps(nextProps){ componentWillReceiveProps(nextProps){
this.props.uiActions.setWindowTitle("Browse");
// mopidy goes online // mopidy goes online
if (!this.props.mopidy_connected && nextProps.mopidy_connected){ if (!this.props.mopidy_connected && nextProps.mopidy_connected){
@ -40,11 +40,7 @@ class LibraryBrowse extends React.Component{
loadDirectory(props = this.props){ loadDirectory(props = this.props){
if (props.mopidy_connected){ if (props.mopidy_connected){
var uri = null this.props.mopidyActions.getDirectory(null);
if (props.uri !== undefined){
uri = props.uri;
}
this.props.mopidyActions.getDirectory(uri);
} }
} }
@ -120,7 +116,8 @@ class LibraryBrowse extends React.Component{
<GridItem <GridItem
item={item} item={item}
key={index} key={index}
type="category" link={item.link}
type="browse"
/> />
) )
} }

View File

@ -41,7 +41,7 @@ class LibraryBrowseDirectory extends React.Component{
console.log(nextProps.uri,this.props.uri); console.log(nextProps.uri,this.props.uri);
//this.loadDirectory(nextProps); this.loadDirectory(nextProps);
} }
} }
@ -122,7 +122,8 @@ class LibraryBrowseDirectory extends React.Component{
return ( return (
<GridItem <GridItem
key={subdirectory.uri} key={subdirectory.uri}
type="directory" type="browse"
link={global.baseURL+'library/browse/'+encodeURIComponent(subdirectory.uri)}
item={subdirectory} item={subdirectory}
/> />
); );