|
@@ -152,7 +152,16 @@ function handleUserRequest(){
|
|
|
cachedList = JSON.parse(cachedList);
|
|
|
for (var j = 0; j < cachedList.length; j++){
|
|
|
var thisCachedSong = cachedList[j];
|
|
|
- allfilelist.push(thisCachedSong[0].replace("/media?file=", ""));
|
|
|
+ var thisFilepath = thisCachedSong[0].replace("/media?file=", "");
|
|
|
+ //Check if this file still exists. If not, get realtime list instead.
|
|
|
+ if (filelib.fileExists(thisFilepath)){
|
|
|
+ allfilelist.push(thisFilepath);
|
|
|
+ }else{
|
|
|
+ //Cache outdated. Rescanning now
|
|
|
+ allfilelist = getRealtimeAllFleList();
|
|
|
+ execd("buildCache.js")
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}catch(ex){
|
|
|
//Fallback
|