TheLastGimbus / GooglePhotosTakeoutHelper

Script that organizes the Google Takeout archive into one big chronological folder
https://aur.archlinux.org/packages/gpth-bin
Apache License 2.0
3.52k stars 177 forks source link

Month folder on 2 digits when using --divide-to-dates option #167

Closed denouche closed 1 year ago

denouche commented 1 year ago

Hello,

I'm migrating on the v3 version (thank a lot for this great version!! :clap: )

On the v2 when using --divide-to-dates option generated month forlders on 2 digits, for example 2022/02/ thank to this line:

    new_path = f"{FIXED_DIR}/{date.year}/{date.month:02}/"

On the new v3 version the month folders are on 1 digit for the 9 first months of the year, for example 2022/2/ It's not a big problem but the folders are not well sorted when listing. :sweat_smile:

Is it possible to add a leading zero when the month representation is on 1 digit? Thanks!

denouche commented 1 year ago

I'm not familiar with Dart, but maybe something like this would do the job?

: p.join(output.path, '${date.year}', date.month.toString().padLeft(2, '0'))

here: https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/blob/919e2cf0e09b59943adb9e82acfc3b57508be6a9/bin/gpth.dart#L338 ?

denouche commented 1 year ago

Ok after playing on https://dartpad.dev/ it seems this works as expected. I will do the PR.

brock commented 1 year ago

Just getting caught up on the release, but would it be possible to make this configurable? I personally use YYYY/YYYY-MM for my folders.

TheLastGimbus commented 1 year ago

oh by the way i forgot to include this in release D: - next one with potential memory fixes will :pray:

make this configurable

Probably not, that would be too much options. but i remember this Polish rename tool called szyszka: https://github.com/qarmin/szyszka/releases