diff --git a/upload-sorter/DOCKERFILE b/upload-sorter/DOCKERFILE index 613fde2..ed19db6 100644 --- a/upload-sorter/DOCKERFILE +++ b/upload-sorter/DOCKERFILE @@ -7,6 +7,11 @@ WORKDIR /app COPY sort.py . COPY requirements.txt . +# Install ffmpeg +RUN apt-get update \ + && apt-get install -y ffmpeg \ + && apt-get clean + # Ensure pip RUN python -m ensurepip diff --git a/upload-sorter/requirements.txt b/upload-sorter/requirements.txt index 037103e..64d521a 100644 --- a/upload-sorter/requirements.txt +++ b/upload-sorter/requirements.txt @@ -1 +1,2 @@ -pillow \ No newline at end of file +pillow +ffmpeg-python \ No newline at end of file diff --git a/upload-sorter/sort.py b/upload-sorter/sort.py index ab76b00..250f721 100755 --- a/upload-sorter/sort.py +++ b/upload-sorter/sort.py @@ -120,7 +120,7 @@ def sort_photos(photo_list: list[Path], ignore_list: list[str]) -> list[str]: while new_name == previous_name: index_count += 1 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 new_path.parent.mkdir(parents=True, exist_ok=True) # Move the file