Skip to content
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

Trouble configuring fallback folders with location #245

Open
ethack opened this issue Sep 7, 2017 · 2 comments · May be fixed by #246
Open

Trouble configuring fallback folders with location #245

ethack opened this issue Sep 7, 2017 · 2 comments · May be fixed by #246
Labels

Comments

@ethack
Copy link

ethack commented Sep 7, 2017

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?

@ethack ethack changed the title Trouble with location in fallback folders Trouble configuring fallback folders with location Sep 7, 2017
@jmathai
Copy link
Owner

jmathai commented Sep 7, 2017

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
Copy link
Author

ethack commented Sep 8, 2017

That worked like a charm. Thank you!

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

Successfully merging a pull request may close this issue.

2 participants