added {place.country_code} to template system

This commit is contained in:
Rhet Turnbull
2020-03-28 10:18:58 -07:00
parent b0456dc8e6
commit be2e16769d
4 changed files with 7 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
""" version info """
__version__ = "0.24.1"
__version__ = "0.24.2"

View File

@@ -25,6 +25,7 @@ TEMPLATE_SUBSTITUTIONS = {
"{modified.mon}": "Month abbreviation in the user's locale of the file modification time",
"{modified.doy}": "3-digit day of year (e.g Julian day) of file modification time, starting from 1 (zero padded)",
"{place.name}": "Place name from the photo's reverse geolocation data, as displayed in Photos",
"{place.country_code}": "The ISO country code from the photo's reverse geolocationo data",
"{place.name.country}": "Country name from the photo's reverse geolocation data",
"{place.name.state_province}": "State or province name from the photo's reverse geolocation data",
"{place.name.city}": "City or locality name from the photo's reverse geolocation data",
@@ -119,6 +120,9 @@ def get_template_value(lookup, photo):
if lookup == "place.name":
return photo.place.name if photo.place else None
if lookup == "place.country_code":
return photo.place.country_code if photo.place else None
if lookup == "place.name.country":
return (
photo.place.names.country[0]