From 5048b3f5ea1c18b9bf9dc8353c4473bbc6eb77e1 Mon Sep 17 00:00:00 2001 From: Tristan Roux Date: Fri, 25 Jan 2019 20:46:59 +0100 Subject: [PATCH] Solving a bug with the queue management. --- MusicApp/Resources/Portable Class/Browse.cs | 4 ++-- MusicApp/Resources/Portable Class/Queue.cs | 4 ++-- MusicApp/Resources/Portable Class/QueueAdapter.cs | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MusicApp/Resources/Portable Class/Browse.cs b/MusicApp/Resources/Portable Class/Browse.cs index 0f45a70..9d665b4 100644 --- a/MusicApp/Resources/Portable Class/Browse.cs +++ b/MusicApp/Resources/Portable Class/Browse.cs @@ -213,9 +213,9 @@ namespace MusicApp.Resources.Portable_Class if (item.Album == null) { var songCover = Uri.Parse("content://media/external/audio/albumart"); - var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, item.AlbumArt); + var songAlbumArtUri = ContentUris.WithAppendedId(songCover, item.AlbumArt); - Picasso.With(MainActivity.instance).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.noAlbum).Resize(400, 400).CenterCrop().Into(bottomView.FindViewById(Resource.Id.bsArt)); + Picasso.With(MainActivity.instance).Load(songAlbumArtUri).Placeholder(Resource.Drawable.noAlbum).Resize(400, 400).CenterCrop().Into(bottomView.FindViewById(Resource.Id.bsArt)); } else { diff --git a/MusicApp/Resources/Portable Class/Queue.cs b/MusicApp/Resources/Portable Class/Queue.cs index 939af2d..9077c00 100644 --- a/MusicApp/Resources/Portable Class/Queue.cs +++ b/MusicApp/Resources/Portable Class/Queue.cs @@ -226,9 +226,9 @@ namespace MusicApp.Resources.Portable_Class public static void InsertToQueue(int position, Song item) { - if (MusicPlayer.CurrentID() > position) + if (MusicPlayer.CurrentID() >= position) { - MusicPlayer.currentID--; + MusicPlayer.currentID++; MusicPlayer.SaveQueueSlot(); } diff --git a/MusicApp/Resources/Portable Class/QueueAdapter.cs b/MusicApp/Resources/Portable Class/QueueAdapter.cs index b9fc599..490aa19 100644 --- a/MusicApp/Resources/Portable Class/QueueAdapter.cs +++ b/MusicApp/Resources/Portable Class/QueueAdapter.cs @@ -339,7 +339,6 @@ namespace MusicApp.Resources.Portable_Class { Song song = songList[position]; Queue.RemoveFromQueue(position); - NotifyItemRemoved(position); Snackbar.Make(Queue.instance.FindViewById(Resource.Id.recycler), (song.Title.Length > 20 ? song.Title.Substring(0, 17) + "..." : song.Title) + " has been removed from the queue.", Snackbar.LengthShort) .SetAction("Undo", (view) => {