MythMusic Playlist import?

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

MythMusic Playlist import?

Post by mtrax »

Is it possible to import a playlist from another system ie I have all my favorite playlists set on WinAmp can I some how import this to MythMusic as I don't really want to repeat this process every time I update it .
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: MythMusic Playlist import?

Post by paulh »

There is nothing built into MythMusic to do this. There are a few scripts around that can import playlists from iTunes not sure about WinAmp though. How does WinAmp store the playlist?
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: MythMusic Playlist import?

Post by mtrax »

I think WinAmp can same playlist in the following formats: M3U, PLS, M3U8, but can you point to those iTunes scripts perhaps I can hack those to suit ..
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: MythMusic Playlist import?

Post by paulh »

This is one linked to from the MythMusic wiki page I've no idea if it still works or if it ever worked :)
http://www.weezey.com/2008/05/itunes-pl ... in-mythtv/

Importing playlists from M3U or PLS files should be possible but wont be straight forward. The playlists in MythMusic are just a comma separated list of track id's stored in a row in the music_playlists table. The id's match the song_id stored in the music_songs table. You would have to read the playlist file and lookup the song_id for each track based on the title and/or the filename stored in the playlist file to construct the comma separated list of id's.
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: MythMusic Playlist import?

Post by mtrax »

hmm perhaps there needs to be a exposed API for MythMusic for this situation..

So now looks like need to build one from scratch as that script is syncing files as well..
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: MythMusic Playlist import?

Post by mtrax »

Before I start any advice on how this script should read or write to the mythtv database?
Ie if I use perl do i need to use api or just use raw SQL?
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: MythMusic Playlist import?

Post by mtrax »

ok I have created a row in the db table music_playlists but it doesn't show in the mythtv Frontend?
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: MythMusic Playlist import?

Post by paulh »

mtrax wrote:Before I start any advice on how this script should read or write to the mythtv database?
Ie if I use perl do i need to use api or just use raw SQL?
We generally advise against using raw SQL, there are plans to use an embedded database that would likely remove direct DB access anyway. Having said that there is no built in API to do what you want. The python bindings would be one way to go since they are the most complete and can be easily extended but you would have to speak to Raymond about that.

If I was doing it I would probably add something to the MythMusic plugin directly to import the playlists using the existing classes. There is stuff in there to parse the PLS and M3U playlists as well as create playlists and reload them etc the only bit missing is finding the song_id from the info in the playlist file.
mtrax wrote:
ok I have created a row in the db table music_playlists but it doesn't show in the mythtv Frontend?
At the moment if you change the playlist externally you would have to restart the frontend for the playlists to be reloaded.
User avatar
stuartm
Developer
Posts: 129
Joined: Wed Feb 05, 2014 5:17 pm
Great Britain

Re: MythMusic Playlist import?

Post by stuartm »

At some point I'm going to be expanding the Services API to include options for MythMusic. However I don't have a timeframe in mind.
mtrax
Junior
Posts: 51
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: MythMusic Playlist import?

Post by mtrax »

Great, I've completed my script and works well albeit using direct SQL to create playlist. So this will do me for now.

Just on a side note switching playlist is a bit non intuitive but I eventually found out how
Thanks
Paul
timblayd
Newcomer
Posts: 2
Joined: Fri Aug 03, 2018 8:21 am
Bangladesh

Re: MythMusic Playlist import?

Post by timblayd »

I would suggest to try "MusConv" tool.
Post Reply