1
0
This commit is contained in:
= 2024-11-23 01:29:24 -05:00
parent 538600380a
commit 80a239cb94
3 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,11 @@ WORKDIR /app
COPY sort.py . COPY sort.py .
COPY requirements.txt . COPY requirements.txt .
# Install ffmpeg
RUN apt-get update \
&& apt-get install -y ffmpeg \
&& apt-get clean
# Ensure pip # Ensure pip
RUN python -m ensurepip RUN python -m ensurepip

View File

@ -1 +1,2 @@
pillow pillow
ffmpeg-python

View File

@ -120,7 +120,7 @@ def sort_photos(photo_list: list[Path], ignore_list: list[str]) -> list[str]:
while new_name == previous_name: while new_name == previous_name:
index_count += 1 index_count += 1
new_name = f"{image_date_string}_{image_time_string}_{str(index_count).zfill(3)}.jpg" new_name = f"{image_date_string}_{image_time_string}_{str(index_count).zfill(3)}.jpg"
new_path: Path = photos_directory.joinpath(image_year, new_name).resolve() new_path: Path = photos_directory.joinpath(f"{image_year}-Photos", new_name).resolve()
# Ensure the parent year folder exists # Ensure the parent year folder exists
new_path.parent.mkdir(parents=True, exist_ok=True) new_path.parent.mkdir(parents=True, exist_ok=True)
# Move the file # Move the file