fix dupes

This commit is contained in:
Jesse Bannon 2022-09-07 10:59:24 -07:00
parent 68f2e768e7
commit 19c44cce5c
2 changed files with 17 additions and 43 deletions

View file

@ -112,16 +112,14 @@ class SharedNfoTagsValidator(
if not isinstance(tag_value, list): if not isinstance(tag_value, list):
tag_value = [tag_value] tag_value = [tag_value]
# iterate each list, validate accordingly if it is a string tag or attribute tag if isinstance(tag_value[0], str):
for tag_value_i in tag_value:
if isinstance(tag_value_i, str):
self._string_tags[key].extend( self._string_tags[key].extend(
self._validate_key( self._validate_key(
key=key, key=key,
validator=self._tags_validator, validator=self._tags_validator,
).list ).list
) )
elif isinstance(tag_value_i, dict): elif isinstance(tag_value[0], dict):
self._attribute_tags[key].extend( self._attribute_tags[key].extend(
self._validate_key( self._validate_key(
key=key, validator=self._tags_with_attributes_validator key=key, validator=self._tags_with_attributes_validator

View file

@ -11,8 +11,6 @@ Rick Beato - Can you hear the difference 🎸🔥 #shorts.nfo
kodi_safe_multi_title □: kodi_safe_multi_title □:
- value 1 □ - value 1 □
- value 2 □ - value 2 □
- value 1 □
- value 2 □
kodi_safe_multi_title_with_attrs: kodi_safe_multi_title_with_attrs:
- attributes: - attributes:
□?: 'value □?: 'value
@ -24,16 +22,6 @@ Rick Beato - Can you hear the difference 🎸🔥 #shorts.nfo
newlines □' newlines □'
tag: "the \n tag 2 □□" tag: "the \n tag 2 □□"
- attributes:
□?: 'value
newlines □'
tag: "the \n tag 1 □□"
- attributes:
□?: 'value
newlines □'
tag: "the \n tag 2 □□"
kodi_safe_title □: kodi_safe_value □ kodi_safe_title □: kodi_safe_value □
kodi_safe_title_with_attrs: kodi_safe_title_with_attrs:
attributes: attributes:
@ -49,8 +37,6 @@ test.nfo
kodi_safe_multi_title □: kodi_safe_multi_title □:
- value 1 □ - value 1 □
- value 2 □ - value 2 □
- value 1 □
- value 2 □
kodi_safe_multi_title_with_attrs: kodi_safe_multi_title_with_attrs:
- attributes: - attributes:
□?: 'value □?: 'value
@ -62,16 +48,6 @@ test.nfo
newlines □' newlines □'
tag: "the \n tag 2 □□" tag: "the \n tag 2 □□"
- attributes:
□?: 'value
newlines □'
tag: "the \n tag 1 □□"
- attributes:
□?: 'value
newlines □'
tag: "the \n tag 2 □□"
kodi_safe_title □: kodi_safe_value □ kodi_safe_title □: kodi_safe_value □
kodi_safe_title_with_attrs: kodi_safe_title_with_attrs:
attributes: attributes: