Thesunfei / Pandora music replay and download

Please update the code to the following to allow for the album names to be displayed in the info window with each song.

Line 206
Original:
renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src);
Proposed:
renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src,$("[data-qa='playing_album_name']").text());

Line 220
Original:
<div class='audioartist'>${artist}</div>
Proposed:
<div class='audioalbum'>${album}</div>
<div class='audioartist'>${artist}</div>

Re: @TheOpenUserNut:

Please remember to put any code in back ticks (` ... pair of these with code in between) or code fences (three back ticks on their own lines with the code in between... see this FAQ) so the author can see what you are talking about. You can always tap the Preview button to see how it will turn out.

The posting has been fixed for you.

Thanks,
OUJS Admin

@Marti,
Thanks for the correction in my post, it is much appreciated.

I am actually just going to fork the git repository and do a formal pull request as that is probably preferred.

Nut

Re: @TheOpenUserNut:

... formal pull request ...

Sometimes that gets the attention better.

Could have also used this FAQ applied to this:

diff --git a/./Pandora_music_replay_and_download.user.js.original b/./Pandora_music_replay_and_download.user.js
index 70549c6..ae1637e 100644
--- a/./Pandora_music_replay_and_download.user.js.original
+++ b/./Pandora_music_replay_and_download.user.js
@@ -203,7 +203,7 @@ to {transform:rotate(360deg)}
         $.each(audios,function(index,item){
             if (!audioURLs.contains(item.src)) {
                 audioURLs.push(item.src);
-                renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src);
+                renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src,$("[data-qa='playing_album_name']").text());
             }
         });
     }
@@ -217,6 +217,7 @@ to {transform:rotate(360deg)}
 </div>
 <div class='audioinfo'>
 <div class='audiotitle'>${title}</div>
+<div class='audioalbum'>${album}</div>
 <div class='audioartist'>${artist}</div>
 <div class="audiofns">
 <div class="audiotrack">
@@ -285,4 +286,4 @@ to {transform:rotate(360deg)}
         getAudio();
     }
     setInterval(getAudioURL,1000);
-});
\ No newline at end of file
+});

using the diff keyword after the first set of three backticks. Gives some fancy colorings including which lines were changed. :)

OK... I will post the diff here instead.
Since the first post, I have added some additional error checking and dup checking to make sure the output is as clean as possible.
I am very happy with the result of this.

diff --git a/Pandora_music_replay_and_download.user.js b/Pandora_music_replay_and_download.user.js
index 8f9864e..c5f3147 100644
--- a/Pandora_music_replay_and_download.user.js
+++ b/Pandora_music_replay_and_download.user.js
@@ -1,12 +1,18 @@
 // ==UserScript==
 // @name         Pandora music replay and download
-// @version      0.7
+// @version      0.8
 // @require https://code.jquery.com/jquery-3.2.1.min.js
 // @author       Thesunfei
 // @grant        none
+// @license      MIT; https://opensource.org/licenses/MIT
 // @include      http://*.pandora.com/*
 // @include      https://*.pandora.com/*
 // ==/UserScript==
+
+// ==Revision History==
+// 0.8 Added album name between Title and Artist for reference
+// ==/Revision History==
+
 /*jshint multistr: true */
 $(function(){
     var styleele=$("<style></style>");
@@ -203,11 +209,25 @@ to {transform:rotate(360deg)}
         $.each(audios,function(index,item){
             if (!audioURLs.contains(item.src)) {
                 audioURLs.push(item.src);
-                renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src);
+                //Pull the album information
+                album = $("[data-qa='playing_album_name']");
+                //Make sure only the current album is passed on.
+                //  Only take the first in the array to avoid extras that can come in because of timing issues
+                //    The additional one is from the previous song
+                if(album.length > 1) {
+                    album = album[0];
+                }
+                album = album.text();
+                //Do not add album if it is advertisement
+                if ($("[data-qa='mini_track_title']").text() == "Advertisement")
+                {
+                    album = "";
+                }
+                renderAudioHTML(item.src,$("[data-qa='mini_track_title']").text(),album,$("[data-qa='mini_track_artist_name']").text(),$("[data-qa='mini_track_image']")[0].src);
             }
         });
     }
-    function renderAudioHTML (src,title,artist,image){
+    function renderAudioHTML (src,title,album,artist,image){
         var ele=$(`<div class='audiowrap onloading'>
 <div class='imgwrap'>
 <img class='audioimg' src='${image}'>
@@ -217,6 +237,7 @@ to {transform:rotate(360deg)}
 </div>
 <div class='audioinfo'>
 <div class='audiotitle'>${title}</div>
+<div class='audioalbum'>${album}</div>
 <div class='audioartist'>${artist}</div>
 <div class="audiofns">
 <div class="audiotrack">