caught not checking for album

This commit is contained in:
aj 2019-05-10 19:38:12 +01:00
parent 3bc0cdcc63
commit 64029f1d6f

View File

@ -38,7 +38,7 @@ public class FmNetwork {
public FmNetwork(String key) { public FmNetwork(String key) {
this.key = key; this.key = key;
} }
public Album getAlbum(String name, String artist) { public Album getAlbum(String name, String artist) {
return getAlbum(name, getArtist(artist)); return getAlbum(name, getArtist(artist));
} }
@ -213,7 +213,7 @@ public class FmNetwork {
return null; return null;
} }
public Track getTrack(String name, String artist) { public Track getTrack(String name, String artist) {
return getTrack(name, getArtist(artist)); return getTrack(name, getArtist(artist));
} }
@ -338,12 +338,13 @@ public class FmNetwork {
public Track refresh(Track track) { public Track refresh(Track track) {
Logger.getLog().log(new LogEntry("refreshTrack").addArg(track.getName()).addArg(track.getArtist().getName())); Logger.getLog().log(new LogEntry("refreshTrack").addArg(track.getName()).addArg(track.getArtist().getName()));
Artist refreshedArtist = getArtist(track.getArtist().getName());
Artist refreshedArtist = getArtist(track.getArtist().getName());
Track refreshedTrack = getTrack(track.getName(), refreshedArtist); Track refreshedTrack = getTrack(track.getName(), refreshedArtist);
refreshedTrack.setAlbum(getAlbum(track.getAlbum().getName(), refreshedArtist)); if (track.getAlbum() != null) {
refreshedTrack.setAlbum(getAlbum(track.getAlbum().getName(), refreshedArtist));
}
return refreshedTrack; return refreshedTrack;
} }