listitem.setProperty impacting listitem.setInfo for music
I have an addon which is displaying list items for video and music.  Up till now I didn't have a bookmark / resume time feature for music / songs passed to my Kodi addon, even though the bookmark information was available from the source.  I've always had it for video files and it's worked fine.  I decided to add the listitem.setProperty ResumeTime command for music and when I did it worked by adding a resume time option to the listitem context menu but it wiped out displaying the listitem.setInfo from being displayed in the skin.  I tested this for both Confluence and Estuary and both skins do the same thing so this looks more like a Kodi issue. 

Here's the code:
                elif mediaClass_text == 'music':
                    li.addContextMenuItems([ (addon.getLocalizedString(30347), 'Container.Refresh'), \
                    (addon.getLocalizedString(30346), 'Action(ParentDir)') ])
                    info = {
                        'duration': getSeconds(duration_text),
                        'genre': genre_text,
                        'year': release_year_text,
                        'title': title,
                        'artist': artist_text.split(','),
                        'rating': rating_val,
                        'discnumber': season_text,
                        'mediatype': 'song',
                        'tracknumber': episode_text,
                        'album': album_text,
                        'playcount': playcount,
                        'lastplayed': last_played_text,
                    li.setInfo(mediaClass_text, info)
                    li.setProperty('ResumeTime', dcmInfo_text)

With the li.setProperty('ResumeTime', dcmInfo_text) line commented out I get a normal view with all the info:


 If I uncomment the li.setProperty('ResumeTime', dcmInfo_text) line I get this:


You can see all of the setInfo data is now missing but the bookmark icons appear on the items.  I have tested this on both versions of my addon for Kodi 18 and Kodi 19.  The results are identical.

I've developed a workaround for this issue.  I added a context menu item if the bookmark for a music file is greater than 0 (i.e. bookmark is set).  This is equivalent of setting the ResumeTime.  Then if the user accesses the context menu and clicks on playing the music file with the bookmark value (i.e. Play From 00:03:00 etc.)  I then use the xbmc.Player().play(item=itemurl, listitem=lim) command to play the item and then use the bookmark value to seek with xbmc.Player().seekTime(mbookmark).  It works fine.  I had to set a short delay after starting the player before issuing the seek command otherwise seek would fail saying the player wasn't playing.  I now check to ensure the player is playing before doing the seek. 

The only downside of this approach is that since I am not setting the ResumeTIme (because it wipes out the display information) I don't see the icon letting me know there is a bookmark in the listitem display.  I am hoping one of the Kodi developers can look at why the li.setProperty command is wiping out the li.setInfo display for music files so long term I can avoid this workaround.  It works fine for video files.  For now this workaround is fine.


Logout Mark Read Team Forum Stats Members Help
listitem.setProperty impacting listitem.setInfo for music0
This forum uses Lukasz Tkacz MyBB addons.