fix: slow folder track count

+ etc
This commit is contained in:
cwilvx
2024-06-27 00:02:08 +03:00
parent 54a1b85d8b
commit 1a66194c6c
13 changed files with 183 additions and 95 deletions
+12 -7
View File
@@ -45,6 +45,8 @@ class Populate:
"""
def __init__(self, instance_key: str) -> None:
return
global POPULATE_KEY
POPULATE_KEY = instance_key
@@ -152,15 +154,18 @@ class Populate:
@staticmethod
def tag_untagged(untagged: set[str], key: str):
for file in tqdm(untagged, desc="Reading files"):
if POPULATE_KEY != key:
log.warning("'Populate.tag_untagged': Populate key changed")
return
pass
# for file in tqdm(untagged, desc="Reading files"):
# if POPULATE_KEY != key:
# log.warning("'Populate.tag_untagged': Populate key changed")
# return
tags = get_tags(file)
# tags = get_tags(file)
if tags is not None:
TrackTable.insert_one(tags)
# if tags is not None:
# TrackTable.insert_one(tags)
# =============================================
# log.info("Found %s new tracks", len(untagged))
# # tagged_tracks: deque[dict] = deque()