diff --git a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java index 9719872..b518d88 100644 --- a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java +++ b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java @@ -133,7 +133,8 @@ public class MediaRouterPlayService extends Service { title = mPlaylist.get(mCurrentTrack).getTitle(); if (mPlaylist.get(mCurrentTrack) instanceof MusicTrack) { MusicTrack track = (MusicTrack) mPlaylist.get(mCurrentTrack); - artist = track.getArtists()[0].getName(); + if (track.getArtists().length > 0) + artist = track.getArtists()[0].getName(); } } Intent intent = new Intent(MediaRouterPlayService.this, MainActivity.class); diff --git a/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java b/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java index 08a8066..ecd93f8 100644 --- a/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java +++ b/src/com/github/nutomic/controldlna/utility/FileArrayAdapter.java @@ -88,7 +88,8 @@ public class FileArrayAdapter extends ArrayAdapter { } DIDLObject item = getItem(position); TextView title = (TextView) convertView.findViewById(R.id.title); - TextView artist = (TextView) convertView.findViewById(R.id.subtitle); + TextView artist = (TextView) convertView.findViewById(R.id.subtitle); + artist.setText(""); RemoteImageView image = (RemoteImageView) convertView.findViewById(R.id.image); if (item instanceof MusicTrack) { MusicTrack track = (MusicTrack) item; @@ -96,12 +97,12 @@ public class FileArrayAdapter extends ArrayAdapter { ? Integer.toString(track.getOriginalTrackNumber()) + ". " : ""; title.setText(trackNumber + item.getTitle()); - artist.setText(track.getArtists()[0].getName()); + if (track.getArtists().length > 0) + artist.setText(track.getArtists()[0].getName()); } - else { + else title.setText(item.getTitle()); - artist.setText(""); - } + image.setImageUri(item.getFirstPropertyValue( DIDLObject.Property.UPNP.ALBUM_ART_URI.class)); return convertView;