From 5127a770b59a941a51bae652ab239fafa77591b3 Mon Sep 17 00:00:00 2001 From: xnappo Date: Wed, 18 Mar 2015 10:08:26 -0500 Subject: [PATCH] throttle the progress bar --- resources/lib/LibrarySync.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index b6fb9246..cd1d7e2d 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -95,7 +95,8 @@ class LibrarySync(): # update progress bar if(pDialog != None): percentage = int(((float(count) / float(total)) * 100)) - pDialog.update(percentage, message=progMessage + " Movie: " + str(count)) + if count % 10 == 0: + pDialog.update(percentage, message=progMessage + " Movie: " + str(count)) count += 1 #process full tv shows sync @@ -135,7 +136,8 @@ class LibrarySync(): # update progress bar if(pDialog != None): percentage = int(((float(count) / float(total)) * 100)) - pDialog.update(percentage, message=progMessage + " Tv Show: " + str(count)) + if count % 10 == 0: + pDialog.update(percentage, message=progMessage + " Tv Show: " + str(count)) count += 1 @@ -186,7 +188,8 @@ class LibrarySync(): # update progress bar if(pDialog != None): percentage = int(((float(count) / float(total)) * 100)) - pDialog.update(percentage, message=progMessage + " Episode: " + str(count)) + if count % 10 == 0: + pDialog.update(percentage, message=progMessage + " Episode: " + str(count)) count += 1 @@ -289,7 +292,8 @@ class LibrarySync(): # update progress bar if(pDialog != None): percentage = int(((float(count) / float(totalCount)) * 100)) - pDialog.update(percentage, message="Updating Movie: " + str(count)) + if count % 10 == 0: + pDialog.update(percentage, message="Updating Movie: " + str(count)) count += 1 #process Tv shows @@ -332,7 +336,8 @@ class LibrarySync(): # update progress bar if(pDialog != None): percentage = int(((float(count) / float(totalCount)) * 100)) - pDialog.update(percentage, message="Updating Episode: " + str(count)) + if count % 10 == 0: + pDialog.update(percentage, message="Updating Episode: " + str(count)) count += 1 finally: