Commit 86853da6 authored by Geoffrey Métais's avatar Geoffrey Métais

Set nicer priorities for recommendations

parent b99f5d68
...@@ -71,7 +71,7 @@ public class RecommendationsService extends IntentService { ...@@ -71,7 +71,7 @@ public class RecommendationsService extends IntentService {
MediaLibrary.getInstance().loadMediaItems(); MediaLibrary.getInstance().loadMediaItems();
} }
} }
private static void buildRecommendation(MediaWrapper movie, int id) { private static void buildRecommendation(MediaWrapper movie, int id, int priority) {
if (movie == null) if (movie == null)
return; return;
...@@ -92,7 +92,7 @@ public class RecommendationsService extends IntentService { ...@@ -92,7 +92,7 @@ public class RecommendationsService extends IntentService {
.setContentText(movie.getDescription()) .setContentText(movie.getDescription())
.setContentInfo("VLC") .setContentInfo("VLC")
// .setSortKey("0.8") // .setSortKey("0.8")
.setPriority(7) .setPriority(priority)
.setLocalOnly(true) .setLocalOnly(true)
.setOngoing(true) .setOngoing(true)
.setColor(sContext.getResources().getColor(R.color.orange500)) .setColor(sContext.getResources().getColor(R.color.orange500))
...@@ -142,7 +142,7 @@ public class RecommendationsService extends IntentService { ...@@ -142,7 +142,7 @@ public class RecommendationsService extends IntentService {
String last = Uri.decode(PreferenceManager.getDefaultSharedPreferences(sContext).getString(PreferencesActivity.VIDEO_LAST, null)); String last = Uri.decode(PreferenceManager.getDefaultSharedPreferences(sContext).getString(PreferencesActivity.VIDEO_LAST, null));
int id = 0; int id = 0;
if (last != null) { if (last != null) {
buildRecommendation(MediaLibrary.getInstance().getMediaItem(last), id); buildRecommendation(MediaLibrary.getInstance().getMediaItem(last), id, Notification.PRIORITY_HIGH);
} }
ArrayList<MediaWrapper> videoList = MediaLibrary.getInstance().getVideoItems(); ArrayList<MediaWrapper> videoList = MediaLibrary.getInstance().getVideoItems();
if (videoList == null || videoList.isEmpty()) if (videoList == null || videoList.isEmpty())
...@@ -154,7 +154,7 @@ public class RecommendationsService extends IntentService { ...@@ -154,7 +154,7 @@ public class RecommendationsService extends IntentService {
continue; continue;
pic = sMediaDatabase.getPicture(sContext, mediaWrapper.getLocation()); pic = sMediaDatabase.getPicture(sContext, mediaWrapper.getLocation());
if (pic != null && pic.getByteCount() > 4 && mediaWrapper.getTime() == 0) { if (pic != null && pic.getByteCount() > 4 && mediaWrapper.getTime() == 0) {
buildRecommendation(mediaWrapper, ++id); buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
} }
if (id == 3) if (id == 3)
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment