[Android] TV: Recommend last videos added

Geoffrey Métais git at videolan.org
Tue Aug 1 14:48:50 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Aug  1 14:48:04 2017 +0200| [6d38ec3d40c80b9e8bfab2f2be20bee926a31ac8] | committer: Geoffrey Métais

TV: Recommend last videos added

> https://code.videolan.org/videolan/vlc-android/commit/6d38ec3d40c80b9e8bfab2f2be20bee926a31ac8
---

 vlc-android/src/org/videolan/vlc/RecommendationsService.java | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/RecommendationsService.java b/vlc-android/src/org/videolan/vlc/RecommendationsService.java
index 1646776ac..4436c1542 100644
--- a/vlc-android/src/org/videolan/vlc/RecommendationsService.java
+++ b/vlc-android/src/org/videolan/vlc/RecommendationsService.java
@@ -27,20 +27,16 @@ import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.Uri;
 import android.os.Build;
 import android.support.v4.app.NotificationCompat;
 import android.support.v4.content.ContextCompat;
 
 import org.videolan.medialibrary.media.MediaWrapper;
-import org.videolan.vlc.gui.helpers.AudioUtil;
 import org.videolan.vlc.gui.helpers.BitmapUtil;
 import org.videolan.vlc.gui.video.VideoPlayerActivity;
 import org.videolan.vlc.util.Util;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@@ -107,15 +103,11 @@ public class RecommendationsService extends IntentService {
             @Override
             public void run() {
                 int id = 0;
-                List<MediaWrapper> videoList = Arrays.asList(VLCApplication.getMLInstance().getVideos());
+                List<MediaWrapper> videoList = Arrays.asList(VLCApplication.getMLInstance().getRecentVideos());
                 if (Util.isListEmpty(videoList))
                     return;
-                Bitmap pic;
-                Collections.shuffle(videoList);
                 for (MediaWrapper mediaWrapper : videoList){
-                    pic = AudioUtil.readCoverBitmap(Uri.decode(mediaWrapper.getArtworkMrl()), 256);
-                    if (pic != null && pic.getByteCount() > 4)
-                        buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
+                    buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
                     if (id == MAX_RECOMMENDATIONS)
                         break;
                 }



More information about the Android mailing list