jmathai / elodie

An EXIF-based photo assistant, organizer and workflow automation tool.
https://bit.ly/introducing-elodie
Apache License 2.0
1.26k stars 139 forks source link

Trouble configuring fallback folders with location #245

Open ethack opened 7 years ago

ethack commented 7 years ago

I'm trying to create a directory structure that uses location data when available and falls back to dates when it isn't. So if geocoordinates are available, then I want the path to be year/country/city, but if geocoordinates are not available I'd like the path to be year/month

However, if geocoordinates are not available it does not use my fallback directories. Instead it uses "Unknown Location" for any geo-related tag. It looks like this:

pic

My config file looks like this:

[MapQuest]
key=redacted

[Directory]
year=%Y
month=%m
country=%country
city=%city
state=%state
full_path=%year/%country|%month/%city|%state|"."

I couldn't tell from the documentation whether using multiple levels of fallback directories is supported like that, but if it is I'm assuming it's interpreted like this: %year/(%country|%month)/(%city|%state|".")

Is there something I should be doing differently?

jmathai commented 7 years ago

This seems to be an issue with how the path was determined before the option to configure them existed. The issue is that filesystem.parse_mask_for_location sets location value to the default of Unknown Location when nothing is found.

246 works but breaks tests which depend on the old behavior of locations falling back to Unknown Location. I think the way to fix this properly is to have a configuration variable that lets you turn off the Unknown Location default.

I'll leave #246 open until I can fix it more properly. But I think it should work for your use case.

ethack commented 7 years ago

That worked like a charm. Thank you!