Kodi Community Forum
Party mode issues - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Party mode issues (/showthread.php?tid=340578)



Party mode issues - niceboy - 2019-02-09

Since I moved from MediaMonkey to Kodi (years ago) I have been missing MMConfused Auto-DJ function. When the last audio track in the queue starts playing, five new tracks are added at the end of the queue, so that the music never ends. These five (or n) tracks is chosen on special premises, exactly like a Smart playlist. 
For example: As the last track is starting, the five least played tracks from the music library is added at the end.
I'm looking for a way to implement this on my Kodi installation on OSMC (RPi2).

I have tried Party mode, but it only takes me half the way, unless it's not tweakable. The main issue with Party made is that when I turn it on, it immediately clears the playlist and start the new PM songs. It works as I want though, when I add an album to the current playlist (PM still switched on). As that chosen album is played, new songs are added at the end by PartyMode. Great.
I want Party mode to be always active, but in the background, not starting itself, but rather be triggered by the last song (or so) in the current playlist. 

If Party mode can't be tweaked the way I want, perhaps I can make use of the Kodi Callbacks addOn, using the onQueueNextItem event? 

It would be really nice to find a way forward on this. Seems I can grasp most of the components, but I'm a complete newbie when it comes to getting things together :-)


RE: Party mode issues - Karellen - 2019-02-09

Moved to music

And moved back to Development as you were told to post here... https://forum.kodi.tv/showthread.php?tid=340438


RE: Party mode issues - ronie - 2019-02-09

service addons get auto started when kodi starts and will run in the background:
https://kodi.wiki/view/Service_add-ons

not sure if i fully get the behavior you're after, but perhaps you can listen for the onPlayBackEnded() callback
and then start the partymode...
python:
def onPlayBackEnded(self):
    xbmc.executebuiltin('PlayerControl(Partymode(music))')



RE: Party mode issues - niceboy - 2019-02-10

Thanks Ronie, that gave me a big clue.

If I wanted to do this in a simple way, I guess I could just use Kodi Callbacks AddOn and evoke the builtin PlayerControl(Partymode(music)) on the onPlayBackEnded event. I'll give it a shot!


RE: Party mode issues - niceboy - 2019-02-10

It works! And it works exactly as I wanted!
Kodi Callbacks:
  • event: onPlayBackEnded
  • task: PlayerControl(Partymode(music))

Thanks for your help.


RE: Party mode issues - niceboy - 2019-02-13

...Except now I can't turn off the music, since onPlayBackEnded gets triggered again...


RE: Party mode issues - ronie - 2019-02-13

hmmm... pretty sure stopping playback will trigger onPlayBackStopped and not onPlayBackEnded