Commit a5e0634d authored by Geoffrey Métais's avatar Geoffrey Métais

Call AudioUtil.readCoverBitmap with full mrl

parent 177bec2a
......@@ -37,7 +37,6 @@ 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.Strings;
import org.videolan.vlc.util.Util;
import java.util.Arrays;
......@@ -118,7 +117,7 @@ public class RecommendationsService extends IntentService {
Bitmap pic;
Collections.shuffle(videoList);
for (MediaWrapper mediaWrapper : videoList){
pic = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mediaWrapper.getArtworkMrl())), 256);
pic = AudioUtil.readCoverBitmap(Uri.decode(mediaWrapper.getArtworkMrl()), 256);
if (pic != null && pic.getByteCount() > 4)
buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
if (id == MAX_RECOMMENDATIONS)
......
......@@ -71,7 +71,7 @@ public class InfoActivity extends AudioPlayerContainerActivity implements View.O
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mItem.getArtworkMrl())), 0);
final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mItem.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(InfoActivity.this.getResources(), cover));
VLCApplication.runOnMainThread(new Runnable() {
......
......@@ -104,7 +104,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mPlaylist.getArtworkMrl())), 0);
final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mPlaylist.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(PlaylistActivity.this.getResources(), cover));
VLCApplication.runOnMainThread(new Runnable() {
......
......@@ -73,7 +73,6 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.preferences.PreferencesActivity;
import org.videolan.vlc.gui.view.AudioMediaSwitcher.AudioMediaSwitcherListener;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.Strings;
public class AudioPlayer extends PlaybackServiceFragment implements PlaybackService.Callback, PlaylistAdapter.IPlayer, TextWatcher {
public static final String TAG = "VLC/AudioPlayer";
......@@ -289,7 +288,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void run() {
final Bitmap blurredCover = UiTools.blurBitmap(AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mw.getArtworkMrl())), mBinding.contentLayout.getWidth()));
final Bitmap blurredCover = UiTools.blurBitmap(AudioUtil.readCoverBitmap(Uri.decode(mw.getArtworkMrl()), mBinding.contentLayout.getWidth()));
if (blurredCover != null)
VLCApplication.runOnMainThread(new Runnable() {
@Override
......
......@@ -46,7 +46,6 @@ import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.helpers.AsyncImageLoader;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.util.HttpImageLoader;
import org.videolan.vlc.util.Strings;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public class CardPresenter extends Presenter {
......@@ -245,7 +244,7 @@ public class CardPresenter extends Presenter {
else
picture = BitmapFactory.decodeResource(res, R.drawable.ic_menu_network_big);
} else
picture = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mediaLibraryItem.getArtworkMrl())), res.getDimensionPixelSize(R.dimen.tv_grid_card_thumb_width));
picture = AudioUtil.readCoverBitmap(Uri.decode(mediaLibraryItem.getArtworkMrl()), res.getDimensionPixelSize(R.dimen.tv_grid_card_thumb_width));
if (picture == null) {
int resId;
switch (mediaLibraryItem.getItemType()) {
......
......@@ -51,7 +51,6 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.preferences.PreferencesActivity;
import org.videolan.vlc.gui.tv.browser.BaseTvActivity;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.Strings;
import java.util.ArrayList;
import java.util.Collections;
......@@ -183,7 +182,7 @@ public class AudioPlayerActivity extends BaseTvActivity implements PlaybackServi
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(mCurrentCoverArt)), mCover.getWidth());
final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mCurrentCoverArt), mCover.getWidth());
final Bitmap blurredCover = UiTools.blurBitmap(cover);
VLCApplication.runOnMainThread(new Runnable() {
@Override
......
......@@ -38,7 +38,6 @@ import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.util.Strings;
import java.util.ArrayList;
import java.util.List;
......@@ -137,7 +136,7 @@ public class BrowserProvider {
for (MediaLibraryItem libraryItem : list) {
if (libraryItem.getItemType() == MediaLibraryItem.TYPE_MEDIA && ((MediaWrapper)libraryItem).getType() != MediaWrapper.TYPE_AUDIO)
continue;
Bitmap cover = AudioUtil.readCoverBitmap(Strings.removeFileProtocole(Uri.decode(libraryItem.getArtworkMrl())), 256);
Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(libraryItem.getArtworkMrl()), 256);
if (cover == null)
cover = DEFAULT_AUDIO_COVER;
item.setTitle(libraryItem.getTitle())
......
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