Bug xbmcgui.ListItem().setInfo() prefixes IMDBNumber with "xx"
#1
As title states. On Leia v18.3

I create a listitem for a plugin path using xbmcgui.ListItem() and for some reason ListItem.IMDBNumber is always prefixed with "xx"
If I add an IMDBNumber with xbmcgui.ListItem().setInfo(video, {'imdbnumber': imdb_id}) I will get something like "xxtt123456" when it should be just "tt123456". If I leave the imdbnumber value blank or don't specify the key at all, I still get a imdbnumber "xx".

This is problematic from a skinning side of things as I can't even set a blank value to allow for String.IsEmpty(ListItem.IMDBNumber) and to use a property instead.

Has anyone encountered this issue?
I've checked my code so many times and I'm definitely not adding this "xx" afaict.

I also tried using setUniqueIDs method but that doesn't appear to do anything for Leia.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#2
Weird. I also set this value in my helper and info script and never faced that issue. Even if empty it doesn't get a "xx". What exactly do you mean with leaving it empty? Keeping the "imdb" var empty replacing the var with a empty string like ''? What happens if you strip the first two digits from the var with [2:] in the setInfo part?
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#3
So I set IMDBNumber by adding it to a dict containing all the infolabels and then adding the info using listitem().setInfo(video, dict)
https://github.com/jurialmunkey/plugin.v...py#L85-L86
https://github.com/jurialmunkey/plugin.v...em.py#L233

This code will give me:
xxtt123456

If I comment out these lines and don't even create an IMDBNumber key in the dict
https://github.com/jurialmunkey/plugin.v...py#L85-L86
Then I get:
xx

If I strip the first two characters:
python:
self.infolabels['imdbnumber'] = request_item.get('imdb_id')[2:]
Then I get:
xx123456


---


I even output the variables to the log immediately before setInfo to check it wasn't something I was doing.
In the log I got all the correct variables/key-values:
self.name = Scream
self.infolabels['imdbnumber'] = tt0117571
self.library = video

But still this puts xxtt0117571 as the imdbnumber. I'm completely stumped.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
Wtf. I cannot reproduce it on my end. In a property it gets correctly set?
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#5
(2019-08-12, 08:02)sualfred Wrote: Wtf. I cannot reproduce it on my end. In a property it gets correctly set?
Yep I can set it to ListItem.Property(imdb_id) perfectly fine. I can even set it to another infolabel like genre or plot etc.
Only imdbnumber does this and I have absolutely no idea why!
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#6
I've checked your code but I cannot see the issue. I've also crawled the xbmc code to see if somwhere "xx" is used for imdbnumber but there is nothing.

A last dumb question: What happens if you hardcode a value directly in setInfo without getting it from the dict? Same issue?

Since you already tried it without setting uniqueids (which I don't use), I'm running out of ideas.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#7
(2019-08-12, 11:59)sualfred Wrote: I've checked your code but I cannot see the issue. I've also crawled the xbmc code to see if somwhere "xx" is used for imdbnumber but there is nothing.

A last dumb question: What happens if you hardcode a value directly in setInfo without getting it from the dict? Same issue?

Since you already tried it without setting uniqueids (which I don't use), I'm running out of ideas.

Yep. Tried direct values with same result:
self.listitem.setInfo('video', {'imdbnumber': 'tt12345678'})
ListItem.IMDBNumber = "xxtt12345678"

How are you setting IMDBNumber?
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
Exactly like you.

Helper script: https://github.com/sualfred/script.embua...ry.py#L126
Info script: https://github.com/sualfred/script.embua...ls.py#L369
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#9
Okay I am completely stumped about this. I just checked with your script and I'm not getting this error there, so there is definitely something that I'm doing which is causing this.

EDIT: I've just found it only happens in info dialog. When I'm in a normal list view it shows correct imdbnumber, but as soon as I open info dialog kodi adds "xx" to the start of imdbnumber.

I just tested with some other add-ons and it happens with every single one in info dialog (but not with library items, only add-on items), so it appears to be a kodi bug.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
I do have a lot of widgets in the infodialog that is using my helper script and the imdbnumber gets correctly set for them.

Edit:
But maybe this is different, because the path of the item exists in the videodb.

Edit2:
Have you tried to set the mediatype? To "tvshow" or "movie"?
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#11
I've tested it with Kodi 17, 18 and 19 and the Info Dialog is always adding "xx" to the original IMDBNumber (the other Dialogs aren't adding the "xx"), so it's imposible add a button in DialogVideoInfo to run a ExtendedInfo script because the IMDBNumber is incorrect and it's necessary to use a custom window to get the correct IMDBNumber without "xx".

Aparently, those "xx" are added in the GUIWindowVideoBase.cpp file:
Code:
movieDetails.SetUniqueID("xx"+movieDetails.GetUniqueID());
movie.SetUniqueID(StringUtils::Format("xx%08i", idMovie));

This diff shows clearly the relation between the "xx" and IMDBNumber:
Code:
movieDetails.m_strIMDBNumber = "xx"+movieDetails.m_strIMDBNumber;
movie.m_strIMDBNumber = StringUtils::Format("xx%08i", idMovie);

What is the reason for adding those "xx" to the IMDBNumber only in the Info Dialog?
Reply
#12
this looks like a very very old hack, i can't even find its origin in git (ie it's from the pre-git svn days). fairly certain this can be removed with no negative consequences.
Reply
#13
(2019-10-23, 10:04)spiff Wrote: this looks like a very very old hack, i can't even find its origin in git (ie it's from the pre-git svn days). fairly certain this can be removed with no negative consequences.

Thanks, although those "xx" are checked in GUIDialogVideoInfo.cpp to enable the refresh button:
Code:
CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_REFRESH, (profileManager->GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !StringUtils::StartsWithNoCase(m_movieItem->GetVideoInfoTag()->GetUniqueID(), "xx"));
Reply
#14
this issue has now been fixed.
https://github.com/xbmc/xbmc/pull/18186
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmcgui.ListItem().setInfo() prefixes IMDBNumber with "xx"0