[mythtv-users] mythmusic - export playlist to m3u

Jeremy Jones jeremy.dwain.jones at gmail.com
Sat Jan 18 15:35:30 UTC 2014


On Jan 18, 2014 8:07 AM, "Paul Harrison" <mythtv at sky.com> wrote:
>
> On 17/01/14 04:15, Jeremy Jones wrote:
>>
>> Does anyone have a script that will export all mythmusic playlists to
m3u files? If not a script does anyone have some pointers on how one might
retrieve the info from the database to create such a script?
>>
>> Thanks,
>>
>> Jeremy
>>
>
> I'm not aware of any script to do that.
>
> It's something that would be trivial to do in the frontend since all the
information required is already in the music cache stored in memory. Doing
it using an external script will require a little more effort since it will
probably require at least two or three queries to get the required
information. Ideally you would use python and use the existing python
bindings to query the database extending them if required to get the
information you require.
>
> All the playlists are stored in the music_playlists table. Each record is
a playlist with a name and a comma separated list of song id's. Those
song_id's can be looked up in the music_songs table from which you can get
the song title and filename and a directory_id which you can lookup in
music_directories to get part of the files path. You have to prepend the
music start directory to get the full path. The music start directory is
currently stored in the settings table and is called 'MusicLocation' but
that will change once we switch to using storage groups.
>
> A long term goal is to create an API that would allow scripts to be run
from the FE to export tracks to various formats so you could have a script
to create a m3u file for a playlist or to create a music cd or export them
to an mp3 player or phone etc.
>
> Paul

Thanks.  I look forward to those additions.  For now you've given me enough
info to try and hammer out a python script that would do what I need. I'll
post back any success or failure.

Thanks again,

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140118/e0874915/attachment.html>


More information about the mythtv-users mailing list