v20 "Please use the respective setter in InfoTagMusic." - But it doesn't work?
#1
I'm currently using Player.updateInfoTag() to update the song metadata and artwork in the player. Since v20, I'm seeing this message in the logs a lot:
Quote:Setting most music properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagMusic.
According to the documentation, this should work (at least for the song metadata):
Quote:tag = xbmc.Player().getMusicInfoTag()
tag.setArtist('Foo')
tag.setTitle('Bar')
Unfortunately it doesn't. Did I miss something really obvious?
Reply
#2
(2023-03-11, 00:16)alxndr Wrote: I'm currently using Player.updateInfoTag() to update the song metadata and artwork in the player. Since v20, I'm seeing this message in the logs a lot:
Quote:Setting most music properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagMusic.
According to the documentation, this should work (at least for the song metadata):
Quote:tag = xbmc.Player().getMusicInfoTag()
tag.setArtist('Foo')
tag.setTitle('Bar')
Unfortunately it doesn't. Did I miss something really obvious?

This thread should help.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#3
Thanks, I did see that thread, but unfortunately it didn't contain any helpful information. It's also about InfoTagVideo, while I'm using InfoTagMusic, and maybe there are different issues in the implementation? Hence this thread.
Reply
#4
(2023-03-11, 14:38)alxndr Wrote: Thanks, I did see that thread, but unfortunately it didn't contain any helpful information. It's also about InfoTagVideo, while I'm using InfoTagMusic, and maybe there are different issues in the implementation? Hence this thread.

It's all part of the same, new setters were introduced in Nexus for videos, music and pictures. Artists and title have new setters, hence the delrecation messages. The old methods still work but only for so long. You can see an example of how I handled it here beginning on line 795.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
Thanks for the link! If I understand your code correctly, you are calling xbmcplugin.addDirectoryItem() after modifying i.e. a MusicInfoTag, which I guess adds or overwrites the metadata in a location that is relevant to your add-on.

I'm not trying to manage directory entries, though, I just need to update the metadata that is being displayed by the Player. This works perfectly fine right now by calling Player.updateInfoTag(). The error message seems to imply that I need to call Player.getMusicInfoTag(), which "Returns the MusicInfoTag of the current playing 'Song'" and use its setters, which doesn't seem to have any effect.

I wonder if this is a code or a documentation issue? If Kodi is going to remove Player.updateInfoTag() without providing a sufficient alternative, that's going to kill my add-on.
Reply
#6
(2023-03-12, 15:11)alxndr Wrote: Thanks for the link! If I understand your code correctly, you are calling xbmcplugin.addDirectoryItem() after modifying i.e. a MusicInfoTag, which I guess adds or overwrites the metadata in a location that is relevant to your add-on.

I'm not trying to manage directory entries, though, I just need to update the metadata that is being displayed by the Player. This works perfectly fine right now by calling Player.updateInfoTag(). The error message seems to imply that I need to call Player.getMusicInfoTag(), which "Returns the MusicInfoTag of the current playing 'Song'" and use its setters, which doesn't seem to have any effect.

I wonder if this is a code or a documentation issue? If Kodi is going to remove Player.updateInfoTag() without providing a sufficient alternative, that's going to kill my add-on.

Ok.  I understand now.  It is still the same issue but after what you posted I see I have a similar issue in my play trailer function.   I hadn't noticed it before.  My current code is:


        lititle = "Trailer  #" + trselect + " - " + mtitle
        li = xbmcgui.ListItem(lititle)
        li.setInfo('video', {'Title': lititle})
        li.setArt({'thumb': icon, 'poster': icon})
        xbmc.Player().play(itemurl, li)

I'll play with it today and post an answer.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#7
(2023-03-12, 15:11)alxndr Wrote: Thanks for the link! If I understand your code correctly, you are calling xbmcplugin.addDirectoryItem() after modifying i.e. a MusicInfoTag, which I guess adds or overwrites the metadata in a location that is relevant to your add-on.

I'm not trying to manage directory entries, though, I just need to update the metadata that is being displayed by the Player. This works perfectly fine right now by calling Player.updateInfoTag(). The error message seems to imply that I need to call Player.getMusicInfoTag(), which "Returns the MusicInfoTag of the current playing 'Song'" and use its setters, which doesn't seem to have any effect.

I wonder if this is a code or a documentation issue? If Kodi is going to remove Player.updateInfoTag() without providing a sufficient alternative, that's going to kill my add-on.

Ok, here's how i have modified mine code and it works:

        lititle = "Trailer  #" + trselect + " - " + mtitle
        li = xbmcgui.ListItem(lititle)
        if int(get_installedversion()) == 19:
            li.setInfo('video', {'Title': lititle})
        else:
            linfo = li.getVideoInfoTag()
            linfo.setTitle(lititle)
        li.setArt({'thumb': icon, 'poster': icon})
        xbmc.Player().play(itemurl, li)

If you are changing the title to something already playing then the two lines become:


    linfo = xbmc.Player().getVideoInfoTag()
    linfo.setTitle(lititle)

In my case I set it ahead of calling the player.  So for you it would be:

minfo = Player.getMusicInfoTag()
minfo.setTitle(yourTitleVariable)



Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#8
(2023-03-12, 16:45)jbinkley60 Wrote: In my case I set it ahead of calling the player.  So for you it would be:

minfo = Player.getMusicInfoTag()
minfo.setTitle(yourTitleVariable)
That's pretty much what I tried (unsuccessfully) after reading the documentation. It eventually occurred to me that I might have misunderstood the setters to be a direct interface to the Player, so I tried this:

            player = xbmc.Player()
            item = player.getPlayingItem()
            tag = item.getMusicInfoTag()
            tag.setArtist('Foo')
            tag.setTitle('Bar')
            player.updateInfoTag(item)
And that finally worked. So you basically replace the Item.setInfo('music', xyz) call with Item.getMusicInfoTag() and modifying that.

Thanks for your replies, they did push me in the right direction!
Reply
#9
(2023-03-13, 00:22)alxndr Wrote: That's pretty much what I tried (unsuccessfully) after reading the documentation. It eventually occurred to me that I might have misunderstood the setters to be a direct interface to the Player, so I tried this:

            player = xbmc.Player()
            item = player.getPlayingItem()
            tag = item.getMusicInfoTag()
            tag.setArtist('Foo')
            tag.setTitle('Bar')
            player.updateInfoTag(item)
And that finally worked. So you basically replace the Item.setInfo('music', xyz) call with Item.getMusicInfoTag() and modifying that.

Thanks for your replies, they did push me in the right direction!

Great.  Glad you got it working and provided a solution.

Nice job,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply



Logout Mark Read Team Forum Stats Members Help
"Please use the respective setter in InfoTagMusic." - But it doesn't work?0
This forum uses Lukasz Tkacz MyBB addons.