INNER CODE UNIT · Python
ensure_index
yurijmikhalevich/rclip · rclip/main.py:266
def ensure_index(self, directory: str):
print(
"checking images in the current directory for changes;"
' use "--no-indexing" to skip this if no images were added, changed, or removed',
file=sys.stderr,
)
self._db.remove_indexing_flag_from_all_images(commit=False)
self._db.flag_images_in_a_dir_as_indexing(directory, commit=True)
# Excluded paths were not inspected, so leave their cached state alone.
for row in self._db.get_image_filepaths_by_dir_path(directory):
if self._is_excluded(row["filepath"], directory):
self._db.remove_indexing_flag(row["filepath"], commit=False)
with tqdm(total=None, unit="images") as pbar:
def update_total_images(count: int):
pbar.total = count