Skip to content

Commit

Permalink
fix album cover caching
Browse files Browse the repository at this point in the history
  • Loading branch information
DerrickGold committed Sep 1, 2016
1 parent 46dc357 commit 3da8ac1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,13 @@ MusicLibrary.prototype.updateTrackInfo = function(doneCb) {


this.apiCall("/api/files/"+ this.curTrackInfo.id + "/cover", "GET", true, function(resp) {


var data = JSON.parse(resp);
console.log(data);
var covers = document.getElementsByClassName('cover-art');
for (var i = 0; i < covers.length; i++) {

if (!data.code)
covers[i].setAttribute("src", data.path);
covers[i].setAttribute("src", data.path + "?" + Math.floor(Math.random() * 1000000) + 1);
else
covers[i].setAttribute("src", "static/img/default_album_art.png");
}
Expand Down

0 comments on commit 3da8ac1

Please sign in to comment.