Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty cast names #1664

Closed

Conversation

Falke-Design
Copy link
Contributor

Check if this PR fulfills these requirements:

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Feature change (non-breaking change which changes behaviour of an existing functionality)
  • Improvement (non-breaking change which improves functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (non-breaking performance or readability improvements)

Description

Fixes: #1655

"Error TypeError: Actor: name property must not be empty" occurs.

This happens if the Cast has some empty entries.
For example the movie Misfit:

{
   "Title":"Misfit",
   "Cast":[
      "Selina Mour",
      "Lion Wasczyk",
      "Lisa-Marie Koroll",
      "Jonathan Elias Weiske",
      "Vivien Wulf",
      "Meriel Hinsching",
      "",
      "Moritz Schirdewahn",
      "Simon Will",
      "Sylvie Meis"
   ],
...

@@ -167,7 +167,7 @@ def set_video_info_tag(info: Dict[str, str], video_info_tag: xbmc.InfoTagVideo):
# From Kodi v20 ListItem.setInfo is deprecated, we need to use the methods of InfoTagVideo object
# "Cast" and "Tag" keys need to be converted
cast_names = info.pop('Cast', [])
video_info_tag.setCast([xbmc.Actor(name) for name in cast_names])
video_info_tag.setCast([xbmc.Actor(name) for name in cast_names if name])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not do this here, wrapper must not change data
there is to check the json path response to verify why/when there is a empty value and act on the right place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, changed

@Falke-Design
Copy link
Contributor Author

Attention while testing: the cache needs to be cleared else the info data will be not parsed again. And then the error will still occur
grafik

@CastagnaIT
Copy link
Owner

take a look on my new PR solution opened, and take a look at the differences,
also take in account that the "person" list is not used by "cast" only but from each REFERENCE_MAPPINGS value,
so the change is more small and not require specifics additional for loop and data replacing as done here

@CastagnaIT CastagnaIT closed this Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watch list, "Next Page": "Error TypeError: Actor: name property must not be empty"
2 participants