make the progres bar for scanning always go to the full 100%
This commit is contained in:
parent
02ebc4879a
commit
900adb35d8
|
@ -1,6 +1,7 @@
|
||||||
Scanner={
|
Scanner={
|
||||||
songsFound:0,
|
songsFound:0,
|
||||||
songsScanned:0,
|
songsScanned:0,
|
||||||
|
songsChecked:0,
|
||||||
startTime:null,
|
startTime:null,
|
||||||
endTime:null,
|
endTime:null,
|
||||||
stopScanning:false,
|
stopScanning:false,
|
||||||
|
@ -18,6 +19,7 @@ Scanner={
|
||||||
scanFile:function(path,ready){
|
scanFile:function(path,ready){
|
||||||
path=encodeURIComponent(path);
|
path=encodeURIComponent(path);
|
||||||
$.getJSON(OC.linkTo('media','ajax/api.php')+'?action=get_path_info&path='+path,function(song){
|
$.getJSON(OC.linkTo('media','ajax/api.php')+'?action=get_path_info&path='+path,function(song){
|
||||||
|
Scanner.songsChecked++;
|
||||||
if(ready){
|
if(ready){
|
||||||
ready(song);
|
ready(song);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +27,7 @@ Scanner={
|
||||||
var artistId=song.song_artist;
|
var artistId=song.song_artist;
|
||||||
Scanner.songsScanned++;
|
Scanner.songsScanned++;
|
||||||
$('#scan span.songCount').text(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)
|
$('#scanprogressbar').progressbar('value',progress)
|
||||||
Collection.addSong(song);
|
Collection.addSong(song);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +37,8 @@ Scanner={
|
||||||
$('#scanprogressbar').progressbar({
|
$('#scanprogressbar').progressbar({
|
||||||
value:0,
|
value:0,
|
||||||
});
|
});
|
||||||
|
Scanner.songsChecked=0;
|
||||||
|
Scanner.songsScanned=0;
|
||||||
Scanner.startTime=new Date().getTime()/1000;
|
Scanner.startTime=new Date().getTime()/1000;
|
||||||
Scanner.findSongs(function(songs){
|
Scanner.findSongs(function(songs){
|
||||||
Scanner.songs=songs;
|
Scanner.songs=songs;
|
||||||
|
|
Loading…
Reference in New Issue