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) 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 @property
def extractor(self: "BaseEntry") -> str: def extractor(self: "BaseEntry") -> str:
""" """

View file

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