[Android] Trim artist and album names to fix filtering

Geoffrey Métais git at videolan.org
Tue Nov 18 14:20:04 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Oct 16 17:20:35 2014 +0200| [203f8451f262015d6e92dadffe74479821bf57fd] | committer: Geoffrey Métais

Trim artist and album names to fix filtering

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=203f8451f262015d6e92dadffe74479821bf57fd
---

 vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
index bfc1f14..fc46463 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
@@ -149,9 +149,10 @@ public class GridFragment extends VerticalGridFragment implements VideoBrowserIn
 			Collections.sort(audioList, MediaComparators.byAlbum);
 			for (Media media : audioList){
 				if (mFilter == null 
-						|| (mType == FILTER_ARTIST && mFilter.equals(media.getArtist()))
-						|| (mType == FILTER_GENRE && mFilter.equals(media.getGenre())))
+						|| (mType == FILTER_ARTIST && mFilter.equals(media.getArtist().trim()))
+						|| (mType == FILTER_GENRE && mFilter.equals(media.getGenre().trim()))) {
 				add(media.getAlbum(), media.getArtist(), media);
+				}
 			}
 			//Customize title for artist/genre browsing
 			if (mType == FILTER_ARTIST){
@@ -195,12 +196,12 @@ public class GridFragment extends VerticalGridFragment implements VideoBrowserIn
 					intent = new Intent(mContext, VerticalGridActivity.class);
 					intent.putExtra(AUDIO_CATEGORY, getString(R.string.albums));
 					intent.putExtra(MEDIA_SECTION, FILTER_ARTIST);
-					intent.putExtra(AUDIO_FILTER, listItem.mMediaList.get(0).getArtist());
+					intent.putExtra(AUDIO_FILTER, listItem.mMediaList.get(0).getArtist().trim());
 				} else if (getString(R.string.genres).equals(mCategory)){
 					intent = new Intent(mContext, VerticalGridActivity.class);
 					intent.putExtra(AUDIO_CATEGORY, getString(R.string.albums));
 					intent.putExtra(MEDIA_SECTION, FILTER_GENRE);
-					intent.putExtra(AUDIO_FILTER, listItem.mMediaList.get(0).getGenre());
+					intent.putExtra(AUDIO_FILTER, listItem.mMediaList.get(0).getGenre().trim());
 				} else {
 					ArrayList<String> locations = new ArrayList<String>();
 					for (Media media : listItem.mMediaList){



More information about the Android mailing list