make the progres bar for scanning always go to the full 100%

This commit is contained in:
Robin Appelman 2011-08-02 04:43:08 +02:00
parent 02ebc4879a
commit 900adb35d8
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
Scanner={
songsFound:0,
songsScanned:0,
songsChecked:0,
startTime:null,
endTime:null,
stopScanning:false,
@ -18,6 +19,7 @@ Scanner={
scanFile:function(path,ready){
path=encodeURIComponent(path);
$.getJSON(OC.linkTo('media','ajax/api.php')+'?action=get_path_info&path='+path,function(song){
Scanner.songsChecked++;
if(ready){
ready(song);
}
@ -25,7 +27,7 @@ Scanner={
var artistId=song.song_artist;
Scanner.songsScanned++;
$('#scan span.songCount').text(Scanner.songsScanned);
var progress=(Scanner.songsScanned/Scanner.songsFound)*100;
var progress=(Scanner.songsChecked/Scanner.songsFound)*100;
$('#scanprogressbar').progressbar('value',progress)
Collection.addSong(song);
}
@ -35,6 +37,8 @@ Scanner={
$('#scanprogressbar').progressbar({
value:0,
});
Scanner.songsChecked=0;
Scanner.songsScanned=0;
Scanner.startTime=new Date().getTime()/1000;
Scanner.findSongs(function(songs){
Scanner.songs=songs;