ivandokov / phockup

Media sorting tool to organize photos and videos from your camera in folders by year, month and day.
MIT License
820 stars 100 forks source link

add python_date parameter #193

Closed zowlverein closed 7 months ago

zowlverein commented 1 year ago

I'm still interested in the original use case as described in #146. I have photos stored in folder structure by Year/Album (ex. 2021/Hawaii) and I would like to autosort any photos that don't fit into an album in Year/Months/Month (ex. 2019/Months/August). It seems Python datetime format already has '%' prefix for all formats, so if we skip the Date.parse on the '--date' argument then we can use Python datetime format directly and any other text will be passed through literally to the OUTPUTDIR. I've added this as a new argument that takes precedence over '--date'. Wondering is this is an acceptable solution.

added --python_date argument to further address #146. Python datetime format is refixed with '%' so other text is treated as literal.

ivandokov commented 1 year ago

Thank you for this PR, @zowlverein. To be honest I do not like the fact we are adding nearly duplicate flat to support alternative behaviour. Also I don't like exposing language-specific feature to be exposed to the end user. The API should be as language independent as possible. It's most likely never going to happen but what if we decide to rewrite the tool in go or rust? This python specific flag is pretty useless in this case. Also it intends python knowledge and I don't like that. This is why I oped for IMO user-friendly syntax for the --date flag in the first place.

I think we should come up with a soltion that allows the --date flag to use literals but I don't have it off the top of my head.

ivandokov commented 7 months ago

I'll close this PR as it doesn't have any progress but I am more than happy to revisit it if someone comes up with a solution that meets the outlined requirements above.