[Android] Trim artist and album names to fix filtering

Geoffrey Métais git at videolan.org
Thu Oct 16 17:33:46 CEST 2014


vlc-ports/android | branch: tv | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Oct 16 17:20:35 2014 +0200| [7b63ae38e0e00a183c3f82b09e2b9b44ad7482e8] | 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=7b63ae38e0e00a183c3f82b09e2b9b44ad7482e8
---

 vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java |   10 +++++-----
 1 file changed, 5 insertions(+), 5 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 373370b..de120d8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
@@ -18,7 +18,6 @@ import org.videolan.vlc.gui.audio.MediaComparators;
 import org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity;
 import org.videolan.vlc.gui.video.VideoBrowserInterface;
 import org.videolan.vlc.gui.video.VideoListHandler;
-import org.videolan.vlc.gui.video.VideoPlayerActivity;
 import org.videolan.vlc.util.Util;
 
 import android.content.Context;
@@ -132,9 +131,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){
@@ -178,12 +178,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