throttle the progress bar

This commit is contained in:
xnappo 2015-03-18 10:08:26 -05:00
parent f77cef5aca
commit 5127a770b5

View file

@ -95,6 +95,7 @@ class LibrarySync():
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(total)) * 100)) percentage = int(((float(count) / float(total)) * 100))
if count % 10 == 0:
pDialog.update(percentage, message=progMessage + " Movie: " + str(count)) pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
count += 1 count += 1
@ -135,6 +136,7 @@ class LibrarySync():
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(total)) * 100)) percentage = int(((float(count) / float(total)) * 100))
if count % 10 == 0:
pDialog.update(percentage, message=progMessage + " Tv Show: " + str(count)) pDialog.update(percentage, message=progMessage + " Tv Show: " + str(count))
count += 1 count += 1
@ -186,6 +188,7 @@ class LibrarySync():
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(total)) * 100)) percentage = int(((float(count) / float(total)) * 100))
if count % 10 == 0:
pDialog.update(percentage, message=progMessage + " Episode: " + str(count)) pDialog.update(percentage, message=progMessage + " Episode: " + str(count))
count += 1 count += 1
@ -289,6 +292,7 @@ class LibrarySync():
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(totalCount)) * 100)) percentage = int(((float(count) / float(totalCount)) * 100))
if count % 10 == 0:
pDialog.update(percentage, message="Updating Movie: " + str(count)) pDialog.update(percentage, message="Updating Movie: " + str(count))
count += 1 count += 1
@ -332,6 +336,7 @@ class LibrarySync():
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(totalCount)) * 100)) percentage = int(((float(count) / float(totalCount)) * 100))
if count % 10 == 0:
pDialog.update(percentage, message="Updating Episode: " + str(count)) pDialog.update(percentage, message="Updating Episode: " + str(count))
count += 1 count += 1