Converting TuneIn URI into album to resolve viewability, also fixes #581
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -111,7 +111,7 @@ const SearchResults = ({
|
||||
{/*<LazyLoadListener enabled={this.props.artists_more && spotify_search_enabled} loadMore={loadMore} />*/}
|
||||
|
||||
{resultsCount > results.length && (
|
||||
<Button uri={`iris:search:${type}:${encodedTerm}`}>
|
||||
<Button uri={`iris:search:${type}:${encodedTerm}`} debug>
|
||||
<I18n path={`search.${type}.more`} count={resultsCount} />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
|
||||
import React, { memo } from 'react';
|
||||
import Link from './Link';
|
||||
import { uriType as uriTypeHelper } from '../util/helpers';
|
||||
|
||||
export default memo((props) => {
|
||||
let to = null;
|
||||
let { uri, type } = props;
|
||||
const uriType = type || uriTypeHelper(uri);
|
||||
let { uri } = props;
|
||||
const uriType = uriTypeHelper(uri);
|
||||
if (!props.unencoded) {
|
||||
uri = encodeURIComponent(uri);
|
||||
}
|
||||
|
||||
@ -154,6 +154,15 @@ const uriType = function (uri) {
|
||||
return exploded[1];
|
||||
}
|
||||
|
||||
if (exploded[0] === 'tunein') {
|
||||
switch (exploded[1]) {
|
||||
case 'station':
|
||||
return 'album';
|
||||
default:
|
||||
return exploded[1];
|
||||
}
|
||||
}
|
||||
|
||||
switch (exploded[1]) {
|
||||
case 'track':
|
||||
case 'artist':
|
||||
@ -162,12 +171,12 @@ const uriType = function (uri) {
|
||||
case 'genre':
|
||||
return exploded[1];
|
||||
case 'user':
|
||||
if (exploded.length > 3 && exploded[3] == 'playlist') {
|
||||
if (exploded.length > 3 && exploded[3] === 'playlist') {
|
||||
return 'playlist';
|
||||
}
|
||||
return exploded[1];
|
||||
default:
|
||||
return null;
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
@ -192,7 +201,7 @@ const sourceIcon = function (uri, source = null) {
|
||||
case 'tunein':
|
||||
case 'somafm':
|
||||
case 'dirble':
|
||||
return 'microphone';
|
||||
return 'cloud';
|
||||
|
||||
default:
|
||||
return source;
|
||||
|
||||
@ -85,7 +85,7 @@ export class Album extends React.Component {
|
||||
|
||||
// We have just received our full album or our album artists
|
||||
if ((!prevAlbum && album) || (!prevAlbum.artists && album.artists)) {
|
||||
if (album.wiki === undefined && album.artists.length > 0) {
|
||||
if (album.artists && album.wiki === undefined) {
|
||||
getAlbum(album.uri, album.artists[0].name, album.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user