Merge branch 'jesse/sanitized-uid' into jesse/prebuild-presets

This commit is contained in:
Jesse Bannon 2022-09-29 00:13:10 -07:00
commit 7aab2315c0
2 changed files with 11 additions and 0 deletions

View file

@ -40,6 +40,16 @@ class BaseEntryVariables:
"""
return self.kwargs(UID)
@property
def uid_sanitized(self: "BaseEntry") -> str:
"""
Returns
-------
str
The sanitized uid of the entry, which is safe to use for Unix and Windows file names.
"""
return sanitize_filename(self.uid)
@property
def extractor(self: "BaseEntry") -> str:
"""

View file

@ -61,6 +61,7 @@ def mock_entry_to_dict(
):
return {
"uid": uid,
"uid_sanitized": uid,
"title": "entry title",
"title_sanitized": "entry title",
"ext": ext,