Show File Transfer Size (#160)

adds file transfer size to progress bar - closes #157
This commit is contained in:
Rob
2019-12-10 15:16:54 -06:00
committed by GitHub
parent 23a14d67c4
commit 5d398836ba
5 changed files with 95 additions and 26 deletions

View File

@@ -53,3 +53,16 @@ def getRegionalTimestamp(date_time, dateformat=['dateshort']):
result = result + ("%s " % date_time.strftime(xbmc.getRegion(aFormat)))
return result.strip()
def diskString(fSize):
# convert a size in kilobytes to the best possible match and return as a string
fSize = float(fSize)
i = 0
sizeNames = ['KB', 'MB', 'GB', 'TB']
while(fSize > 1024):
fSize = fSize / 1024
i = i + 1
return "%0.2f%s" % (fSize, sizeNames[i])