fix progress inaccuracy
This commit is contained in:
parent
7fa0adbff9
commit
d5c1a787f7
@ -81,14 +81,14 @@ async def build_library(root_dir):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
track = mapping.next()
|
track = mapping.next()
|
||||||
if track:
|
tracks.append(track)
|
||||||
tracks.append(track)
|
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
break
|
break
|
||||||
percent = round(len(tracks) / len(filepaths) * 100, 2)
|
percent = round(len(tracks) / len(filepaths) * 100, 2)
|
||||||
if percent >= prev_percent + 2.5:
|
if percent >= prev_percent + 2.5:
|
||||||
print(f"{percent}%")
|
print(f"{percent}%")
|
||||||
prev_percent = percent
|
prev_percent = percent
|
||||||
|
tracks = [t for t in tracks if t]
|
||||||
if not tracks:
|
if not tracks:
|
||||||
print("No new tracks found!")
|
print("No new tracks found!")
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user