Bug fix for null title, #512
This commit is contained in:
@@ -1702,7 +1702,7 @@ Substitution Description
|
|||||||
{lf} A line feed: '\n', alias for {newline}
|
{lf} A line feed: '\n', alias for {newline}
|
||||||
{cr} A carriage return: '\r'
|
{cr} A carriage return: '\r'
|
||||||
{crlf} a carriage return + line feed: '\r\n'
|
{crlf} a carriage return + line feed: '\r\n'
|
||||||
{osxphotos_version} The osxphotos version, e.g. '0.42.78'
|
{osxphotos_version} The osxphotos version, e.g. '0.42.79'
|
||||||
{osxphotos_cmd_line} The full command line used to run osxphotos
|
{osxphotos_cmd_line} The full command line used to run osxphotos
|
||||||
|
|
||||||
The following substitutions may result in multiple values. Thus if specified for
|
The following substitutions may result in multiple values. Thus if specified for
|
||||||
@@ -3561,7 +3561,7 @@ The following template field substitutions are availabe for use the templating s
|
|||||||
|{lf}|A line feed: '\n', alias for {newline}|
|
|{lf}|A line feed: '\n', alias for {newline}|
|
||||||
|{cr}|A carriage return: '\r'|
|
|{cr}|A carriage return: '\r'|
|
||||||
|{crlf}|a carriage return + line feed: '\r\n'|
|
|{crlf}|a carriage return + line feed: '\r\n'|
|
||||||
|{osxphotos_version}|The osxphotos version, e.g. '0.42.78'|
|
|{osxphotos_version}|The osxphotos version, e.g. '0.42.79'|
|
||||||
|{osxphotos_cmd_line}|The full command line used to run osxphotos|
|
|{osxphotos_cmd_line}|The full command line used to run osxphotos|
|
||||||
|{album}|Album(s) photo is contained in|
|
|{album}|Album(s) photo is contained in|
|
||||||
|{folder_album}|Folder path + album photo is contained in. e.g. 'Folder/Subfolder/Album' or just 'Album' if no enclosing folder|
|
|{folder_album}|Folder path + album photo is contained in. e.g. 'Folder/Subfolder/Album' or just 'Album' if no enclosing folder|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.42.78"
|
__version__ = "0.42.79"
|
||||||
|
|||||||
@@ -564,7 +564,12 @@ class PhotoInfo:
|
|||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
"""name / title of picture"""
|
"""name / title of picture"""
|
||||||
return self._info["name"]
|
# if user sets then deletes title, Photos sets it to empty string in DB instead of NULL
|
||||||
|
# in this case, return None so result is the same as if title had never been set (which returns NULL)
|
||||||
|
# issue #512
|
||||||
|
title = self._info["name"]
|
||||||
|
title = None if title == "" else title
|
||||||
|
return title
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uuid(self):
|
def uuid(self):
|
||||||
|
|||||||
@@ -1004,6 +1004,9 @@ class PhotoTemplate:
|
|||||||
elif self.dirname:
|
elif self.dirname:
|
||||||
value = sanitize_dirname(value)
|
value = sanitize_dirname(value)
|
||||||
|
|
||||||
|
# ensure no empty strings in value (see #512)
|
||||||
|
value = None if value == "" else value
|
||||||
|
|
||||||
return [value]
|
return [value]
|
||||||
|
|
||||||
def get_template_value_pathlib(self, field):
|
def get_template_value_pathlib(self, field):
|
||||||
|
|||||||
Reference in New Issue
Block a user