[BACKEND] Preserve dict formatter value (#1416)
Do not modify the original definition of dict validators.
This commit is contained in:
parent
942c983f60
commit
97df4dac1d
5 changed files with 9 additions and 8 deletions
|
|
@ -183,12 +183,13 @@ class DictFormatterValidator(LiteralDictValidator):
|
||||||
super().__init__(name, value)
|
super().__init__(name, value)
|
||||||
|
|
||||||
for key in self._keys:
|
for key in self._keys:
|
||||||
self._value[key] = self._validate_key(key=key, validator=self._key_validator)
|
# Gets stored in __validator_dict
|
||||||
|
_ = self._validate_key(key=key, validator=self._key_validator)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dict(self) -> Dict[str, StringFormatterValidator]:
|
def dict(self) -> Dict[str, StringFormatterValidator]:
|
||||||
"""Returns dict with string formatter values"""
|
"""Returns dict with string formatter values"""
|
||||||
return self._value
|
return self._validator_dict
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dict_with_format_strings(self) -> Dict[str, str]:
|
def dict_with_format_strings(self) -> Dict[str, str]:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"file_uid": "{ %sanitize_plex_episode( %map_get( entry_metadata, \"id\" ) ) }",
|
"file_uid": "{ %sanitize_plex_episode( %map_get( entry_metadata, \"id\" ) ) }",
|
||||||
"include_sibling_metadata": "{ %bool(False) }",
|
"include_sibling_metadata": "{ %bool(False) }",
|
||||||
"modified_webpage_url": "{ %map_get( entry_metadata, \"webpage_url\" ) }",
|
"modified_webpage_url": "{ %map_get( entry_metadata, \"webpage_url\" ) }",
|
||||||
"music_video_album": "{ %get_url_field( \"category\", music_video_album_default ) }",
|
"music_video_album": "Music Videos",
|
||||||
"music_video_album_default": "Music Videos",
|
"music_video_album_default": "Music Videos",
|
||||||
"music_video_artist": "Rick Astley",
|
"music_video_artist": "Rick Astley",
|
||||||
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@
|
||||||
"info_json_ext_sanitized": "info.json",
|
"info_json_ext_sanitized": "info.json",
|
||||||
"modified_webpage_url": "{ %map_get( entry_metadata, \"webpage_url\" ) }",
|
"modified_webpage_url": "{ %map_get( entry_metadata, \"webpage_url\" ) }",
|
||||||
"modified_webpage_url_sanitized": "{ %sanitize( %map_get( entry_metadata, \"webpage_url\" ) ) }",
|
"modified_webpage_url_sanitized": "{ %sanitize( %map_get( entry_metadata, \"webpage_url\" ) ) }",
|
||||||
"music_video_album": "{ %get_url_field( \"category\", music_video_album_default ) }",
|
"music_video_album": "Music Videos",
|
||||||
"music_video_album_default": "Music Videos",
|
"music_video_album_default": "Music Videos",
|
||||||
"music_video_album_default_sanitized": "Music Videos",
|
"music_video_album_default_sanitized": "Music Videos",
|
||||||
"music_video_album_sanitized": "{ %sanitize( %get_url_field( \"category\", music_video_album_default ) ) }",
|
"music_video_album_sanitized": "Music Videos",
|
||||||
"music_video_artist": "Rick Astley",
|
"music_video_artist": "Rick Astley",
|
||||||
"music_video_artist_sanitized": "Rick Astley",
|
"music_video_artist_sanitized": "Rick Astley",
|
||||||
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"file_uid": "{ uid_sanitized_plex }",
|
"file_uid": "{ uid_sanitized_plex }",
|
||||||
"include_sibling_metadata": "{ %bool(False) }",
|
"include_sibling_metadata": "{ %bool(False) }",
|
||||||
"modified_webpage_url": "{ webpage_url }",
|
"modified_webpage_url": "{ webpage_url }",
|
||||||
"music_video_album": "{ %get_url_field( \"category\", music_video_album_default ) }",
|
"music_video_album": "{ %get_url_field( \"category\", \"Music Videos\" ) }",
|
||||||
"music_video_album_default": "Music Videos",
|
"music_video_album_default": "Music Videos",
|
||||||
"music_video_artist": "Rick Astley",
|
"music_video_artist": "Rick Astley",
|
||||||
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@
|
||||||
"info_json_ext_sanitized": "info.json",
|
"info_json_ext_sanitized": "info.json",
|
||||||
"modified_webpage_url": "{ webpage_url }",
|
"modified_webpage_url": "{ webpage_url }",
|
||||||
"modified_webpage_url_sanitized": "{ %sanitize( webpage_url ) }",
|
"modified_webpage_url_sanitized": "{ %sanitize( webpage_url ) }",
|
||||||
"music_video_album": "{ %get_url_field( \"category\", music_video_album_default ) }",
|
"music_video_album": "{ %get_url_field( \"category\", \"Music Videos\" ) }",
|
||||||
"music_video_album_default": "Music Videos",
|
"music_video_album_default": "Music Videos",
|
||||||
"music_video_album_default_sanitized": "Music Videos",
|
"music_video_album_default_sanitized": "Music Videos",
|
||||||
"music_video_album_sanitized": "{ %sanitize( %get_url_field( \"category\", music_video_album_default ) ) }",
|
"music_video_album_sanitized": "{ %sanitize( %get_url_field( \"category\", \"Music Videos\" ) ) }",
|
||||||
"music_video_artist": "Rick Astley",
|
"music_video_artist": "Rick Astley",
|
||||||
"music_video_artist_sanitized": "Rick Astley",
|
"music_video_artist_sanitized": "Rick Astley",
|
||||||
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
"music_video_date": "{ %elif( %contains_url_field( \"date\" ), %get_url_field( \"date\", upload_date_standardized ), %contains_url_field( \"year\" ), %concat( %get_url_field( \"date\", upload_year ), \"-01-01\" ), upload_date_standardized ) }",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue