Add support for playlists

Thanks for the reply. I’m not seeing the real issue here… I was able to return all music lists using the json call below in powershell. I don’t know how you’re doing it in Yatse, but if you’re needing the id type (i.e. 0= audio 1=video) etc. Can’t you add this value for each returned item in the call listed below?

$data = @{
‘jsonrpc’ = ‘2.0’
‘method’ = ‘Files.GetDirectory’
‘id’ = 6
‘params’ = @{
‘directory’ = ‘special://musicplaylists’
}
}

$json = $data | ConvertTo-Json -Depth 100

$url = ‘http://’+$hostname+‘:’+$port+‘/jsonrpc’
$mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpwd)
$webreq = Invoke-WebRequest -Uri $url -Credential $mycreds -Body $json -ContentType application/json -Method POST -AllowUnencryptedAuthentication
$webreq

returns
file filetype label type


special://profile/playlists/music/Acoustic Mix.xsp directory Acoustic Mix unknown
special://profile/playlists/music/Christmas Playlist.xsp directory Christmas Playlist unknown
special://profile/playlists/music/Dinner Mix.xsp directory Dinner Mix unknown
special://profile/playlists/music/Metal Mix.xsp directory Metal Mix unknown
special://profile/playlists/music/Songs from 2022.xsp directory Metal Songs from 2022 unknown
special://profile/playlists/music/Party Mix.xsp directory Party Mix unknown
special://profile/playlists/music/Slideshow Music.xsp directory Slideshow Music unknown
special://profile/playlists/music/Video Game Music.xsp directory Video Game Music unknown

Also, Understand that i am not by any means shi*ting on this tool, I think it’s probably the best thing since sliced bread. But i would really like to see this working. I have 5 instances of Kodi in my home and i am not going to create the same playlist 5 times, each time i want to change/update a playlist.

Can you please imagine that I have contributed to Kodi code and that I’m using Kodi API since now nearly 12 years and have some idea about what it can and can’t do ? :slight_smile:

Those playlists have no ID so if you rename them I can’t figure out the new name, the definition of the XSP is not accessible so I can’t reproduce the smart playlist as smart playlists inside Yatse and to finish requesting the content of those playlist and the m3u ones does not return enough meta data to properly match with the data Yatse have. (Not talking about how slow it would be to sync a smart playlist with 150 000 songs in it …)

I don’t know you or your body of work so it’s all the same to me. Help me understand. Why are you wanting to look inside the list? The list is already pre-defined from parameters that would have been set inside kodi. I only care about the list itself and telling kodi to play it, not reading inside the list and building a completely new list of values in Yatse to tell kodi to play that list (I imagine that you’re thinking of it this way, which is a little strange to me).
All you would need to do is get the list as a file and open it in the player. From my perspective, it doesn’t matter (programmatically speaking) what is inside the list to simply retrieve the list itself and select it in Yatse to open in Kodi. Even if Kodi has path substitution in place, any updates or changes made within kodi could be reflective within yatse upon syncing those files via json call.

Here is roughly what that process would look like in addition to what’s already previously mentioned to send the playlist to kodi and play it.

[{“jsonrpc”: “2.0”, “id”: 0, “method”: “Playlist.Clear”, “params”: {“playlistid”: 0}},
{“jsonrpc”:“2.0”,“id”:0,“method”:“Playlist.Add”,“params”:{“playlistid”:0,“item”:{“recursive”:true, “directory”:“special://profile/playlists/music/Acoustic Mix.xsp”}}}
{“jsonrpc”:“2.0”,“id”:0,“method”:“Player.Open”,“params”:{“item”:{“playlistid”:0,“position”:0}}}

sidenote: Why were you banned from the Kodi Forum?
2022-11-19 09_03_50-Play a playlist like with HTTP API_ PlayFile(filename;playlist) - Vivaldi

Your issue have nothing to do with this issue then … This one is about importing and syncing the playlists.

Playing playlist is supported since the start, go to file mode then playlists then play it …

For the ban it’s all public on the forum :wink: (Well except the part that he did not assumed and hide after ;))

https://forum.kodi.tv/showthread.php?tid=117885&pid=2632629#pid2632629

oh wow. yes, that is the function that i am seeking, thank you! IMO this is a misplaced function and should be what “playlists” does in music/videos playlists section of the those libraries combined with the function of being able to create playlists in Yatse.
I interpret “Importing and syncing” playlists as any playlist created in Kodi…or plex…or emby for that matter, populates in the playlists section, just as you have in the files section (while removing the file extension piece for cleanliness). If i interpret it this way, I can imagine that other users do as well.
I would tend to agree that creating a new playlist in yatse and saving it as an xsp or m3u file is probably not be feesible as you would get into write permissions and things like that, which could be a pain. Reading already existing playlists is all I’m concerned with serves me well enough as a workaround. Thank you for pointing that solution out.

As explained I can’t get the necessary data.

Everything that is in the library views works offline. Since those can’t due to Kodi limitations they are not here.

BTW there’s a complete wiki that explains everything.

Hello :wave:

I’m a new user of Kodi & Yatse (after trying various other solutions I am hopeful that I’ve finally found my favorite combo :slight_smile: ). However I have a few troubles with playlists, so I stumbled upon this thread. When reading this:

Playing playlist is supported since the start, go to file mode then playlists then play it …

I believe what I want to do should be supported (this is quite simple) : I’ve saved from Kodi UI the current list being played, which then appears in the playlist section (in Kodi). So my understanding of the quote above is that it should be accessible under yatse’s “Files > Audio files > Playlists” ? But this section remains empty. I’ve searched in other menus but couldn’t find it. Am I missing something? Do I need to sync something manually? Maybe on kodi side?

Thanks! (and sorry if that’s a dumb question already documented but I could not find an answer)

The playlist should be here. Open your own issue with logs.

My bad, that’s ok, not a yatse problem but me being confused with how playlists work in kodi web UI. Actually I saved the playlist from kodi’s web UI (chorus2), but this was NOT actually saved in kodi’s files (after a quick look it seems to be stored just in browser local storage, which is pretty confusing). Anyway I manually copied the m3u into kodi’s files (userdata/playlists/music) and now it shows up in yatse.