After this modification, you will rarely if ever have to clear your cache to play a song.
Basically, we are going to salt the URL passed to the player in playqueue.jsp.
Because the cache stores separate info for each unique URL, this will prevent the cache from re-caching the same URL over and over, which is what causes the problem in the first place.
We are going to edit playqueue.jsp.
Here is the part of the file we are going to edit:
Code: Select all
function skip(index) {
if (index < 0 || index >= songs.length) {
return;
}
var song = songs[index];
currentStreamUrl = song.streamUrl;
updateCurrentImage();
var list = new Array();
list[0] = {
file:song.streamUrl,
title:song.title,
provider:"sound"
};
if (song.duration != null) {
list[0].duration = song.duration;
}
if (song.format == "aac" || song.format == "m4a") {
list[0].provider = "video";
}
player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
}
Code: Select all
function skip(index) {
if (index < 0 || index >= songs.length) {
return;
}
var song = songs[index];
var saltedUrl = song.streamUrl + "&salt=" + Math.floor(Math.random()*100000);
currentStreamUrl = song.streamUrl;
updateCurrentImage();
var list = new Array();
list[0] = {
file:saltedUrl,
title:song.title,
provider:"sound"
};
if (song.duration != null) {
list[0].duration = song.duration;
}
if (song.format == "aac" || song.format == "m4a") {
list[0].provider = "video";
}
player.sendEvent("LOAD", list);
player.sendEvent("PLAY");
}
Hope this helps!