Skip to content

More granular date folders #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Randomblock1
Copy link

Fixes #238. You can now select to divide by year, year and month, year, month, and day, or nothing.

@ProPablo
Copy link

Thanks for this mate, works a treat, was gonna make my own change after the build from #264 went down. 💚

@Wacheee
Copy link

Wacheee commented Feb 10, 2025

This work great! I tested it in Windows with all options and it creates the folder and shortcuts withour problems.

@Wacheee
Copy link

Wacheee commented Mar 19, 2025

After reading #390 (comment) and testing, I found that there's an issue when running GPTH in non-interactive mode (using command-line arguments). It throws the following exception:

2025-03-19 05:58:05 [ERROR ] - Unhandled exception:
2025-03-19 05:58:05 [ERROR ] - type 'String' is not a subtype of type 'num'
2025-03-19 05:58:05 [ERROR ] - #0 main (file:///xxxx/GooglePhotosTakeoutHelper/GooglePhotosTakeoutHelper/bin/gpth.dart:423)

To fix this, it is required to implement logic that parses divideToDates as a number if it comes in as a string (when ussing command-line args). When calling the await moveFiles function, change from:

divideToDates: args['divide-to-dates']

to

divideToDates: args['divide-to-dates'] is num 
    ? args['divide-to-dates'] 
    : num.parse(args['divide-to-dates']),

It is also necessary to establish default value to prevent null:

..addOption('divide-to-dates',
        help: 'Divide output to folders by nothing/year/month/day',
        allowed: ['0', '1', '2', '3'],
        defaultsTo: '0',)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to divide output to folders by year/month/day
3 participants