Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions resources/lib/item_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
elif item_type == 'musicvideo':
mediatype = 'musicvideo'

if hasattr(list_item, "setMediaType"):
if hasattr(video_tag, "setMediaType"):
# Kodi 20 and newer
video_tag.setMediaType(mediatype)

Expand Down Expand Up @@ -577,13 +577,15 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
if is_video:

video_tag.setTagLine(item_details.tagline)
video_tag.setStudios(item_details.studio)
if item_details.studio:
video_tag.setStudios(item_details.studio)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious, why are only studio and production_location treated specially? Is it documented somewhere that these specific fields are optional or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Those functions accept lists, but if you hand them an empty list they explode. I didn't see that behavior with the ones that accept strings, or at least none of my media triggered errors.

video_tag.setPremiered(item_details.premiere_date)
video_tag.setPlot(item_details.plot)
video_tag.setDirectors(item_details.director)
video_tag.setWriters(item_details.writer)
video_tag.setDateAdded(item_details.date_added)
video_tag.setCountries(item_details.production_location)
if item_details.production_location:
video_tag.setCountries(item_details.production_location)
video_tag.setMpaa(item_details.mpaa)
video_tag.setTags(item_details.tags)

Expand Down
Loading