Local playlists and uri encoding
This commit is contained in:
@ -219,7 +219,7 @@ class Playlist extends React.Component{
|
||||
<ul className="details">
|
||||
{!this.props.slim_mode ? <li><Icon type="fontawesome" name={helpers.sourceIcon(playlist.uri)} /></li> : null }
|
||||
<li>
|
||||
{playlist.tracks_total ? playlist.tracks_total : (playlist.tracks ? playlist.tracks.length : '0')} tracks,
|
||||
{playlist.tracks_total ? playlist.tracks_total : '0'} tracks{playlist.tracks_total && playlist.tracks_total > 0 ? ',' : null}
|
||||
<Dater type="total-time" data={playlist.tracks} />
|
||||
</li>
|
||||
{!this.props.slim_mode && playlist.followers !== undefined ? <li>{playlist.followers.toLocaleString()} followers</li> : null }
|
||||
@ -251,7 +251,12 @@ class Playlist extends React.Component{
|
||||
}
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
|
||||
// Decode the URI, and then re-encode all the spaces
|
||||
// This is needed as Mopidy encodes spaces in playlist URIs (but not other characters)
|
||||
var uri = decodeURIComponent(ownProps.match.params.uri);
|
||||
uri = uri.replace(/\s/g, '%20');
|
||||
|
||||
return {
|
||||
uri: uri,
|
||||
allow_reporting: state.ui.allow_reporting,
|
||||
|
||||
Reference in New Issue
Block a user