move folder

This commit is contained in:
Antonio J. Delgado 2022-05-30 11:52:05 +03:00
parent d983df1815
commit 5d2872c3a7

View file

@ -152,7 +152,6 @@ class image_classifier:
self._log.warning(f"Date not found in file's name '{filename}'.") self._log.warning(f"Date not found in file's name '{filename}'.")
else: else:
self._log.debug(f"The file '{file}' doesn't seem to be an image for PIL.") self._log.debug(f"The file '{file}' doesn't seem to be an image for PIL.")
folder = os.path.join(dirname, file_date, filename)
self._log.debug(f"Time based folder name section '{file_date}'") self._log.debug(f"Time based folder name section '{file_date}'")
return file_date return file_date
@ -176,6 +175,7 @@ class image_classifier:
self._log.debug(json.dumps(people, indent=2)) self._log.debug(json.dumps(people, indent=2))
self.append_people(file, people) self.append_people(file, people)
folder = os.path.join(dirname, folder_date, filename)
new_path = os.path.dirname(folder) new_path = os.path.dirname(folder)
if not os.path.exists(new_path): if not os.path.exists(new_path):
os.makedirs(new_path) os.makedirs(new_path)