Still using LastFM, but remove images for artist images (they broke it)

This commit is contained in:
James Barnsley
2019-06-09 15:46:34 +12:00
parent ab8677bb5d
commit db87c3c94d
10 changed files with 38 additions and 28 deletions

View File

@ -26,7 +26,7 @@ export default class GridItem extends React.Component{
switch (helpers.uriType(item.uri)){
case 'artist':
this.props.lastfmActions.getArtist(item.uri, item.name);
//this.props.lastfmActions.getArtist(item.uri, item.name);
break;
case 'album':

View File

@ -30,7 +30,7 @@ export default class ListItem extends React.Component{
switch (helpers.uriType(item.uri)){
case 'artist':
this.props.lastfmActions.getArtist(item.uri, item.name);
//this.props.lastfmActions.getArtist(item.uri, item.name);
break;
case 'album':

View File

@ -61,7 +61,8 @@ class TrackList extends React.Component{
prevent = true;
break;
case "d":
case "backspace":
case "delete":
if (tracks_keys && tracks_keys.length > 0){
this.removeTracks();
}
@ -316,15 +317,17 @@ class TrackList extends React.Component{
}
removeTracks(){
let selected_tracks = this.digestTracksKeys();
// Our parent handles removal
// Our parent has a handler for this
if (this.props.removeTracks !== undefined){
let selected_tracks = this.digestTracksKeys()
let selected_tracks_indexes = helpers.arrayOf('index',selected_tracks)
return this.props.removeTracks(selected_tracks_indexes)
}
let selected_tracks_indexes = helpers.arrayOf('index',selected_tracks);
return this.props.removeTracks(selected_tracks_indexes);
// By default, do nothing
// No handler? We can't really do anything then, so notify user
} else {
this.props.uiActions.createNotification({content: 'Cannot delete '+(selected_tracks.length > 1 ? 'these tracks' : 'this track'), type: 'bad'});
}
}

View File

@ -60,7 +60,7 @@ export function handleException(message, data = {}, description = null, show_not
}
if (!description && data.description){
description = data.description;
} else if (!description && data.error.description){
} else if (!description && data.error && data.error.description){
description = data.error.description;
}
return {

View File

@ -253,7 +253,7 @@ export function getArtist(uri, artist, mbid = false){
if (response.artist){
var artist = {
uri: uri,
images: response.artist.image,
//images: response.artist.image,
mbid: response.artist.mbid,
biography: response.artist.bio.content,
biography_publish_date: response.artist.bio.published,

View File

@ -2141,9 +2141,11 @@ const MopidyMiddleware = (function(){
store.dispatch(coreActions.artistLoaded(artist));
// load artwork from LastFM
// Load supprting information from LastFM
// Note: This excludes artwork as this was removed from their API
// in May 2019
var existing_artist = store.getState().core.artists[artist.uri];
if (existing_artist && !existing_artist.images){
if (existing_artist && !existing_artist.biography){
if (artist.musicbrainz_id){
store.dispatch(lastfmActions.getArtist(artist.uri, false, artist.musicbrainz_id));
} else {