diff --git a/app/actions/index.js b/app/actions/index.js index 3b42408612..784851c5a7 100644 --- a/app/actions/index.js +++ b/app/actions/index.js @@ -69,7 +69,7 @@ export function unifiedSearchError () { function discogsSearch (terms, searchType, dispatchType) { return dispatch => { - return searchType(terms) + return discogs.search(terms, searchType) .then(searchResults => searchResults.json()) .then(searchResultsJson => { dispatch({ @@ -85,11 +85,11 @@ function discogsSearch (terms, searchType, dispatchType) { } export function albumSearch (terms) { - return discogsSearch(terms, discogs.searchReleases, 'ALBUM_SEARCH_SUCCESS'); + return discogsSearch(terms, 'albums', 'ALBUM_SEARCH_SUCCESS'); } export function artistSearch (terms) { - return discogsSearch(terms, discogs.searchArtists, 'ARTIST_SEARCH_SUCCESS'); + return discogsSearch(terms, 'artists', 'ARTIST_SEARCH_SUCCESS'); } export function lastFmTrackSearchStart (terms) { @@ -286,7 +286,7 @@ export function artistReleasesSearch (artistId) { export function artistInfoSearchByName (artistName, history) { return dispatch => { discogs - .searchArtists(artistName) + .search(artistName, 'artists') .then(searchResults => searchResults.json()) .then(searchResultsJson => { let artist = searchResultsJson.results[0]; @@ -305,7 +305,7 @@ export function artistInfoSearchByName (artistName, history) { export function albumInfoSearchByName (albumName, history) { return dispatch => { discogs - .searchAlbums(albumName) + .search(albumName, 'albums') .then(searchResults => searchResults.json()) .then(searchResultsJson => { let album = searchResultsJson.results[0]; diff --git a/app/components/TrackInfo/styles.scss b/app/components/TrackInfo/styles.scss index 1067d5c4a3..222f865a5d 100644 --- a/app/components/TrackInfo/styles.scss +++ b/app/components/TrackInfo/styles.scss @@ -11,7 +11,7 @@ .track_name { margin-bottom: 10px; font-size: 22px; - overflow: hidden; + overflow: visible; white-space: nowrap; text-overflow: ellipsis; } diff --git a/app/rest/Discogs.js b/app/rest/Discogs.js index 6a62be141b..fa4341d511 100644 --- a/app/rest/Discogs.js +++ b/app/rest/Discogs.js @@ -5,20 +5,12 @@ const secret = 'uluhDSPtelRtLUvjrvQhRBnNwpZMtkZq'; function addToken (query, first = false) { let newQuery = query + '&token=' + userToken; - if (first) { - return newQuery.replace('&', '?'); - } else { - return newQuery; - } + return first ? newQuery.replace('&', '?') : newQuery; } function addKeys (query, first = false) { let newQuery = query + '&key=' + key + '&secret=' + secret; - if (first) { - return newQuery.replace('&', '?'); - } else { - return newQuery; - } + return first ? newQuery.replace('&', '?') : newQuery; } function searchQuery (terms, count = 15) { @@ -30,16 +22,8 @@ function searchQuery (terms, count = 15) { ); } -function searchAlbums (terms, count = 15) { - return fetch(searchQuery(terms, count) + '&type=albums'); -} - -function searchArtists (terms, count = 15) { - return fetch(searchQuery(terms, count) + '&type=artist'); -} - -function searchReleases (terms, count = 15) { - return fetch(searchQuery(terms, count) + '&type=master'); +function search (terms, type, count = 15) { + return fetch(searchQuery(terms, count) + '&type=' + type); } function releaseInfo (releaseId, releaseType) { @@ -69,9 +53,7 @@ function artistReleases (artistId) { } module.exports = { - searchAlbums, - searchArtists, - searchReleases, + search, releaseInfo, artistInfo, artistReleases