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

InfoTagVideo.setArtists() expects string and raises a TypeError when given a list or tuple #22388

Closed
1 of 7 tasks
jurialmunkey opened this issue Jan 4, 2023 · 3 comments
Closed
1 of 7 tasks
Assignees

Comments

@jurialmunkey
Copy link

jurialmunkey commented Jan 4, 2023

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

The setArtists() method of InfoTagVideo expects a string despite being documented as expecting a list.
https://alwinesch.github.io/group__python___info_tag_video.html#gad35ce83f3d549079099e31d812735c31

It raises a TypeError when given a list

TypeError: argument "entry1" for method "setArtists" must be unicode or str

Expected Behavior

Here is a clear and concise description of what was expected to happen:

The method should expect a tuple or list as per the documentation.

Possible the documentation is incorrect but my initial assumption is that it would be expected to function the same as other similar methods such as setStudios or setDirectors. Additionally, the original setInfo() method accepted a list.

Actual Behavior

The method expects a string and raises a TypeError when given a list as per the documentation

Possible Fix

To Reproduce

Steps to reproduce the behavior:

info_tag.setArtists(['Artist1', 'Artist2'])

Debuglog

The debuglog can be found here:
https://paste.kodi.tv/evefezexaf.kodi

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • macOS

  • Windows

  • Windows UWP

  • Operating system version/name: Win 11

  • Kodi version: Nexus

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@jurialmunkey
Copy link
Author

@Montellese - Small issue I discovered with InfoTagVideo.setArtists() when adapting the YouTube plugin for Nexus.

@Montellese
Copy link
Member

The code looks correct to me: https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/legacy/InfoTagVideo.h#L2518
It expects a list or tuple of str or unicode. I also compared it to other methods like setTags() and they look exactly the same. I even checked the generated code which takes care of actually parsing the Python objects into C++ and it also looks correct and identical to the one for setTags().

If you neither pass a list nor a tuple to setArtists() you will get the following error message:

The parameter "artists" must be either a Tuple or a List.

This doesn't match with your error message. Your error message is displayed if one of the list / tuple elements is neither a str nor a unicode object. So it looks like something is wrong with the type of the elements you pass to setArtists().

@Montellese Montellese self-assigned this Jan 4, 2023
@jurialmunkey
Copy link
Author

Bizarelly can't reproduce the issue this morning. Even with my very rudimentary C++ understanding those methods look correct so must've been an issue on my end.

Struggling to figure out what might've been the cause. I was reliably able to recreate yesterday with dummy metadata as a test case. My code looks right and is working how I'd expect it to now with the same test case as yesterday. Looking at it for the last half an hour and only explanation I can think of is that I stumbled into some unusual reuselanguageinvoker behaviour.

Anyway, sorry for wasting your time looking into this.

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

No branches or pull requests

2 participants