playlistSongOrder

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

serjan
Posts: 3
Joined: Wed Jun 30, 2021 4:12 pm

playlistSongOrder

Post by serjan »

Hi I am rather new here and trying to find my ways trough some documentations and the API.
I am using the MediaMonkeyNet with C#
I found some information on https://www.mediamonkey.com/docs/api/fi ... etSongList
Pointing out that using app.player.getSongList().getTracklist() I should get the current NowPlaying playlist.

Where can I find what playlistSongOrder means?
I expect see some indexing in this am I right?

So first song = 1, 2nd song 2 etc ? Or is it just having -1 sorted ASC and 0 sorted DESC or vise versa?
From my perspective the numbers seems to get lost sometimes when other songs are added to the list but that's unclear to me.

Thanks in advance for your help.
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: playlistSongOrder

Post by TIV73 »

The playlistSongOrder property refers to the location of a track in a playlist, not in the list of currently playing tracks. Try this:
- Create a playlist
- Add 3 tracks
- Double click the first track to start playing the playlist
- Go to the list of currently playing tracks and drag the bottommost track to the top
- Run app.player.getSongList().getTracklist()

If you now check the playlistSongOrder property of each song from top to bottom, you should get 2,0,1 because the order of the playlist is still the same as before, you just reorganized the order of the currently playing tracks.
serjan
Posts: 3
Joined: Wed Jun 30, 2021 4:12 pm

Re: playlistSongOrder

Post by serjan »

Hi thank you for your reply.

But isn't that a bit weird if the list of currently playing tracks is composed of tracks from multiple playlists?
using app.player.getSongList().getTracklist() you get the current playlist (also refered to as nowplaying) right? So I expected also the numbers to match. But apparently I need to use the index of the array instead?
Part of my problem/confusion started when I have for example 3x the same song in the list. And I want to identify which is the one that plays is it the first the second or the last one?

Defined in native\FullPlayer.js:989
Gets nowplaying list position, -1 = undefined, 0...n current track order.

Isn't nowplaying sort of a playlist?
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: playlistSongOrder

Post by TIV73 »

I'm afraid the rationale behind those properties is something only the developers can explain. I just stumbled over that same property in the past, that's why I still remembered it.
serjan
Posts: 3
Joined: Wed Jun 30, 2021 4:12 pm

Re: playlistSongOrder

Post by serjan »

Ok great I've found a way to work around it for now.
Thanks for your kind cooperation.
app.player.playlistPos helped me out here. I didn't use that before.
Post Reply