If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Music Playlist

cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass

Hi,

 

I have started development for a new music channel plugin that provides music playlists based on the music collection of your local PMS.

 

The project is on github: https://github.com/cp9999/MusicPlaylist.bundle

 

Basic idea is to create playlists within the plug-in, and populate them with tracks by browsing the music sections on your server.

Maintenance of the playlists is a bit cumbersome but that is mainly due to the GUI input limitations in channels (or ther are other opttions available that i am not aware of)

 

 

There is no release avaialble yet, but the current version is already capable of creating playlists and playing them.

There are currently two modes available when opening a playlist for playback: Normal and Shuffled

 

Notes:

    = This is still under development so there are no guarantees that files created with this version will be compatible with future versions

    = The IP address and Port for PMS serer must be set in the Prefences

         

 

Chrisjan

Tagged:
«13456

Comments

  • sa2000sa2000 Posts: 28,867Members, Plex Pass, Plex Ninja, Plex Team Member Plex Team Member
    Chrisjan wrote on October 5 2013, 5:15 PM: »

    Hi,

    I have started development for a new music channel plugin that provides music playlists based on the music collection of your local PMS.

    The project is on github: https://github.com/cp9999/MusicPlaylist.bundle

    Basic idea is to create playlists within the plug-in, and populate them with tracks by browsing the music sections on your server.

    Maintenance of the playlists is a bit cumbersome but that is mainly due to the GUI input limitations in channels (or ther are other opttions available that i am not aware of)

    There is no release avaialble yet, but the current version is already capable of creating playlists and playing them.

    There are currently two modes available when opening a playlist for playback: Normal and Shuffled

    Notes:

        = This is still under development so there are no guarantees that files created with this version will be compatible with future versions

        = The IP address and Port for PMS serer must be set in the Prefences

             

    Chrisjan

    Thanks for doing this tactical solution. Would it be possible to extend this beyond music? so could be list of home video folders and / or files?

    Also photo folders ? 

    And could we have more complex playlists combining music and photo slideshows ?

    Can you manage shuffle of thousands of items?  My library has 50,000+ photos and 10,000+ music tracks and i like to have slideshows and music combined and shuffled sometimes and ability to pause and restart later. At the moment I can only achieve this bit through use of roku because on plex for samsung, the minute you switch away from plex to tv you lose the app and have to start again. OK with shuffle you would restart with different order but still would be nice to be able to pause/continue

    Also if playing a playlist of just music, would a channel be able to add visualisation or screen saver to kick in to avoid screen burn

    Help given free on forums.            Fee-Based Personal Support & Help.        

    _______________________________________________________________________________________

    Plex Support Information              Troubleshooting               FAQs

    Plex Media Server:   Reporting Issues        Plex Web App: Debug Log    Plex Apps: Support pages and Logs    Logs: All Logs

    For list of 3rd party programs and malware / adware crashing Plex Media Server and mswsock.dll on windows, see Repeated crashing of Plex Media Server on Windows
     
  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass

    Just did a performance test.Created a playlist containing 2500 tracks.

    The playlist loads in approx. 5 seconds (Windows 8 mobile and Windows client). I noticed almost no difference when loading shuffled.

    Performance obviously depends on the system running PMS. I am running PMS in a virtual machine on an Intel Xeon 1230V2 with 2 cores assigned to the VM.

  • sa2000sa2000 Posts: 28,867Members, Plex Pass, Plex Ninja, Plex Team Member Plex Team Member
    Chrisjan wrote on October 6 2013, 3:57 PM: »

    Just did a performance test.Created a playlist containing 2500 tracks.

    The playlist loads in approx. 5 seconds (Windows 8 mobile and Windows client). I noticed almost no difference when loading shuffled.

    Performance obviously depends on the system running PMS. I am running PMS in a virtual machine on an Intel Xeon 1230V2 with 2 cores assigned to the VM.

    That is good. I will have a go 

    Is what I was talking about above viable - reference to groupings of audio, visual combinations utilising the playlist functionality or does it have to be just audio?

    Help given free on forums.            Fee-Based Personal Support & Help.        

    _______________________________________________________________________________________

    Plex Support Information              Troubleshooting               FAQs

    Plex Media Server:   Reporting Issues        Plex Web App: Debug Log    Plex Apps: Support pages and Logs    Logs: All Logs

    For list of 3rd party programs and malware / adware crashing Plex Media Server and mswsock.dll on windows, see Repeated crashing of Plex Media Server on Windows
     
  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass

    I have been thinking about some sort of pause / resume functionality (kind of 'On deck') for playlists.

    It is possible to keep record of the songs that are started in the channel plugin.

    Problem as I see it right now is that I think it is not possible to generate a tracklist and tell PMS to auto select a specific entry in the list (e.g. the one started last before pause) in stead of the first one.

    Maybe there is some way of doing so that I am not aware off (which is fairly possible since I am completely new to Plex Plugin development). If  any of the more experienced Plex plugin developers does know how to do that, I would very much like to hear about it .

    As an alternative I think it is possible to load only the songs not played yet upon resuming a previous paused list (e.g. the playlist gets shorter upon every resume).

    Does that sound like a working alternative?

  • RoendiRoendi Posts: 130Members, Plex Pass Plex Pass

    Hi

    I was able to install the Channel and create new Playlist un my Synology NAS

    But I was not able to rename it to a wished Name.

    My Music Libary has about 1600 CD and when I wish to ad Music by Album the Website say Channel not available. The same is with Artist.

    When I take recently added. It works fine.

    That for you as information

    Thank your for this very helpful Plugin.

    Best Regards

    Röndi

  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass

    The rename option does not work on all platforms. I know it does not work in the browser.

    In my tests adding music from both Album and Artist works fine, but I only have 3 platforms available for testing:

    1. Web

    2. Plex Media Client for windows

    3. Plex App on Windows 8 phone

    I have created a standalone application for managing the playlists.

    This is a Windows application that requires .NET framework version 4.0.

    It is available at: https://github.com/cp9999/MusicPlaylistManager.git

    You only need the executable which is available at the path: .\PlexMusicPlaylists\bin\Debug

    I also updated the plugin itself. You need this latest version of the plugin for working with the standalone manager.

  • RoendiRoendi Posts: 130Members, Plex Pass Plex Pass
    Hi Chrisjan Now with the Manager it works. The Search is not always easy to use. But now I have my saved Playlists. Thank you very much
  • lesliebonnerlesliebonner Posts: 151Members, Plex Pass Plex Pass

    Hi,

    Just did a quick test and need to report a problem - the current version of your plugin breaks "channels" in the Windows PMS version 0.9.728.33.

    Once installed and PMS is restarted, all installed channels are missing, and just the option to add new channels is present - however, when you click the option to add channels, the add channels page shows an error saying "The channel directory is currently unavailable.".

    An update to latest the Windows PMS version 0.9.806.175 has fixed the problem.

    Cheers.

  • bstobbebstobbe Posts: 22Members, Plex Pass Plex Pass

    First of all, thank you so much for taking this on.  Music playlists imo have been sorely missing from Plex for way too long.

    I'm having just one issue.  When I click on Append to playlist in the Music playlist configurator nothing happens.  I assume its supposed to add the track to the playlist I created.  Not seeing that happen.  Any idea?

  • bstobbebstobbe Posts: 22Members, Plex Pass Plex Pass

    Figured out what that issue was... I wasn't using the external IP and port. 

    Once I entered that then the playlist creation works if I'm running the music playlist configurator from a computer other than the one hosting my PMS.  I assume there is some networking reason to this I'm missing.  What happens when I run the music playlist configurator from my PMS box is I can't browse into my music folder.  Seems to go off into la la land.  Timing out perhaps?  Doesn't make sense that it works from different pc on my network though.  Anyway, minor inconvenience for now but at least I successfully created a playlist and played it from my Nokia 928 (Windows 8) phone.  One issue I'm seeing so far with that... if I hit next track on the phone it does not play the next track.  Is that not supposed to work yet or does this have something to do with that on deck setting?  I could use some more info on what On deck means.  Thanks again for all your help.  I'm a software developer so feel free to get techy.  I'm soooo pumped to be able to stream playlists now!!!

  • bstobbebstobbe Posts: 22Members, Plex Pass Plex Pass

    Clarification... next track buttons within the channel screen on my phone do not work.  However, if I turn off my phone screen, then turn back on, the next track buttons that drop down from the top over my lock screen DO work. 

    I played around a little with creating a playlist from my phone.  Didn't have any luck adding songs.  Seems no matter which approach I use, By artist, album, folder, etc.. times out or something.  Get a not found error or something.  I'll try and narrow that down a bit more for ya.

    Another question... Does it matter what I enter for the user under settings?  Is that supposed to be my My Plex User or something?  Mine just has the default, "me", right now.  Not sure if that is messing anything up.

  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass
    bstobbe wrote on October 17 2013, 2:41 AM: »

    Figured out what that issue was... I wasn't using the external IP and port. 

    Once I entered that then the playlist creation works if I'm running the music playlist configurator from a computer other than the one hosting my PMS.  I assume there is some networking reason to this I'm missing.  What happens when I run the music playlist configurator from my PMS box is I can't browse into my music folder.  Seems to go off into la la land.  Timing out perhaps?  Doesn't make sense that it works from different pc on my network though.  Anyway, minor inconvenience for now but at least I successfully created a playlist and played it from my Nokia 928 (Windows 8) phone.  One issue I'm seeing so far with that... if I hit next track on the phone it does not play the next track.  Is that not supposed to work yet or does this have something to do with that on deck setting?  I could use some more info on what On deck means.  Thanks again for all your help.  I'm a software developer so feel free to get techy.  I'm soooo pumped to be able to stream playlists now!!!

    I cannot reproduce the IP issue. I am  using two Plex servers (one running on Windows for development, which is the same box I am using for developping the playlist configurator) and my normal Plex server (running on an Ubuntu server).

    I can connect two both Plex servers with the playlist configurator without any problems. Connection to the local server is possible with both the 127.0.0.1 IP and also with the real IP.

    It is important to set the correct IP address within the channel preferences (cannot be done with the configurator).

    About the playback:

    I am using a Nokia 920 with Win8 myself. I experienced the same problem with music not playing the next track. I found out that this is a general problem with music playback in the Plex app on my phone (e.g. I get exactly the same behavior when i start playback of any music album using the normal music library), so I did not investigate any further. I am using "plex for windows phone 1.4" but I have not bought the app so  I just thought that this might be due to limited functionality.

    bstobbe wrote on October 17 2013, 1:35 PM: »

    Clarification... next track buttons within the channel screen on my phone do not work.  However, if I turn off my phone screen, then turn back on, the next track buttons that drop down from the top over my lock screen DO work. 

    I played around a little with creating a playlist from my phone.  Didn't have any luck adding songs.  Seems no matter which approach I use, By artist, album, folder, etc.. times out or something.  Get a not found error or something.  I'll try and narrow that down a bit more for ya.

    Another question... Does it matter what I enter for the user under settings?  Is that supposed to be my My Plex User or something?  Mine just has the default, "me", right now.  Not sure if that is messing anything up.

    About the user setting:

    This is not related to My Plex. I was just thinking about adding some sort of multi user support. It was actually not implemented (only put it in the preferences already).

    I have added it now. It is now possible to create a set of playlists per user. A default user can be set per client device (through the playlist maintenance menu). If no default user is set for a client device, then the default user from the general preferences is used for that client device.

    New users can only be created on clients that support the Input dialog (e.g. the InputDirectoryObject().

  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass
    bstobbe wrote on October 17 2013, 2:41 AM: »

    Figured out what that issue was... I wasn't using the external IP and port. 

    Once I entered that then the playlist creation works if I'm running the music playlist configurator from a computer other than the one hosting my PMS.  I assume there is some networking reason to this I'm missing.  What happens when I run the music playlist configurator from my PMS box is I can't browse into my music folder.  Seems to go off into la la land.  Timing out perhaps?  Doesn't make sense that it works from different pc on my network though.  Anyway, minor inconvenience for now but at least I successfully created a playlist and played it from my Nokia 928 (Windows 8) phone.  One issue I'm seeing so far with that... if I hit next track on the phone it does not play the next track.  Is that not supposed to work yet or does this have something to do with that on deck setting?  I could use some more info on what On deck means.  Thanks again for all your help.  I'm a software developer so feel free to get techy.  I'm soooo pumped to be able to stream playlists now!!!

    On deck functionality :

    1. Whenever a playlist is loaded (either normal or shuffled), a copy of the playlist is saved with extension [Started] added to the file name (e.g. <playlist-name>[Started].xml).
    2. When playback of a track is started, the track is added to an internal 'now playing' list, together with the calculated 'expire time' for the track (e.g. Datetime.now() + <Prefence.Percentage> * track-duration)
    3. A separate thread is running that periodically checks the internal 'now playing' list. When a track is detected that is expired (e.g. playing long enough to have it removed from the 'on deck' playlist ), the thread will remove that track from the 'on deck' playlist.
      The first expired track in a newly started playlist (ad 1.) will cause the <playlist-name>[Started].xml file to be renamed into  <playlist-name>[On deck].xml
    4. If an <playlist-name>[On deck].xml file exists, a third menu option called "Resume On deck" is automatically added to the "Play mode" menu when a playlist is selected

    Notes/limitations:

    1. The channel does NOT get any notification of tracks started on the Plex Windows Client. This means that On deck does not work in combination with this client (Playlists that have an 'On deck' file can be selected for playback on the Plex Meia Client for windows but they will not be updated while being played on this client)
    2. The channel does NOT get any player information from the clients (except for a callback when the track starts playing). This means that the channel will not know if playback of a track is stopped and will therefore still remove the track from the On Deck
  • bstobbebstobbe Posts: 22Members, Plex Pass Plex Pass

    OK, as far as using the standalone app for creating playlists, I think I have that figured out.  For whatever reason, if I'm running it from my PMS machine I need to connect to 127.0.0.1, port 32400.  If I run it from a machine other than my PMS box, I need to use my external IP and port... 32976. 

    My biggest dilemma now is that playlists are only playing on my phone when I am on my wifi.  If I turn wifi on my phone off the track length shows 0:00 and does not play the song.  The playlist is there and so is the album art.  Playing music the traditional way with Plex works fine in that case too so I'm assuming I have something not configured right for your plugin.  I have in the plugin settings my external IP and port... 32976.  Does that sound correct?  Also, attempting to play the playlist from PMS is not working either.  Seems to go off into la la land when I try and start playing first track.  (Essentially same behavior as on the phone... track length is 0:00 but track names are all there).

    Any chance you'd be willing to remote in to my pc sometime and help me get this working?  Just name the time and I'll let ya on.

  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass
    bstobbe wrote on October 18 2013, 2:03 AM: »

    OK, as far as using the standalone app for creating playlists, I think I have that figured out.  For whatever reason, if I'm running it from my PMS machine I need to connect to 127.0.0.1, port 32400.  If I run it from a machine other than my PMS box, I need to use my external IP and port... 32976. 

    My biggest dilemma now is that playlists are only playing on my phone when I am on my wifi.  If I turn wifi on my phone off the track length shows 0:00 and does not play the song.  The playlist is there and so is the album art.  Playing music the traditional way with Plex works fine in that case too so I'm assuming I have something not configured right for your plugin.  I have in the plugin settings my external IP and port... 32976.  Does that sound correct?  Also, attempting to play the playlist from PMS is not working either.  Seems to go off into la la land when I try and start playing first track.  (Essentially same behavior as on the phone... track length is 0:00 but track names are all there).

    Any chance you'd be willing to remote in to my pc sometime and help me get this working?  Just name the time and I'll let ya on.

    I have found the problem.

    When opening the playlist, the channel constructs an ObjectContainer with a list of TrackObjects. The MediaObjects of those track objects (actually the PartObject within the MediaObject) was constructed to do a Callback when started and the callback function simply executed a Redirect (after updating the 'On deck' list). This works fine when  used on the local network (except for the Plex Windows desktop client), but apparantly it doesn't work when used through the external Ip/port.

    I have only been using Plex on my local network until now (and testing  the channel) so I haven't noticed that before.

    I made a fix for this. As a result, the 'On deck' functionality does not work when doing play back through external IP.

    Note:

    It is best to set the IP address and Port in the channel preferences to the server IP address on your local network.

  • bstobbebstobbe Posts: 22Members, Plex Pass Plex Pass

    Thanks, that solved it alright!  Also, I see what you mean about the Next Track buttons not working within standard plex music playback on the phone.  I somehow have never noticed that.  I must always use the skip track on the lock screen.  OK, excuse me while I go make a zillion playlists now!  I'll keep ya posted on any other bugs I notice but for the time being I'm SUPER EXCITED about this new functionality! 

    The obvious next thing development-wise to think about would be is there a way your standalone app can just import an m3u or some other common (non-itunes) format playlist and create your channel playlist off of that seeing as how people probably already may have a large number of playlists in other formats they aren't super excited about replicating track by track for Plex.  That and an easier way to make a playlist from the phone client would be top of my wishlist although I realize the latter is a bit difficult.

  • cp9999cp9999 Posts: 32Members, Plex Pass Plex Pass

    Added search functionality to the standalone playlist configurator.

    Search is available when the a music section node is selected in the tree.

  • RoendiRoendi Posts: 130Members, Plex Pass Plex Pass

    Hi Chrisjan

    The new Search is very helpful.  Thanks for your great Works.

    Have a great day

  • MichaelVerbeekMichaelVerbeek Posts: 9Members, Plex Pass Plex Pass

    Chrisjan,

    This plugin is brilliant, with the Manager it works perfect. If it was possible to use Sync with plugins my day would be complete

    Thanks.

  • - NaDs- NaDs Posts: 542Members, Plex Pass Plex Pass
    edited November 2013

    thanks for the plugin

    is this possible???

    to create the same for movies,tv shows or home movies

    this would be great for shuffled music videos

    is this possible???

«13456
Sign In or Register to comment.