Author Topic: Can somebody create a playlist for me? (playlist editor- testing m3u support)  (Read 8491 times)

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Can somebody use a playlist creation utility to create a playlist (m3u) of a few songs stored on the core from a remote computer over samba, using full paths and email it to me? can you also attach a text file with a list of the full paths of the media files on the core?

I have *some* preliminary M3U inport/export functionallity going on in the new playlist editor for the web admin, but I need to test a few things (mainly converting full samba paths into internal LMCE paths)..

If you can supply this, please email it to me at jondecker76 at windstream dot com

Also, to clear up any confusion, playlists will be handled the same way by LMCE. This is just adding functionallity to save your LMCE playlist as an extended .m3u playlist for backup purposes, and to have a "synchronized" playlist on your computers. Similarly, playlist import will add files (if present on the core) from a .m3u playlist to a LMCE Playlist (at the beginning, at the current selection, or at the end).

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Not sure how much help I can be, Jon, but here is what I am doing. I created an m3u playlist using Windows Media Player from my laptop, using a mapped drive (drive letter) to my LMCE media share (on another Windows PC), and got:

#EXTM3U
#EXTINF:0,alien antfarm- smooth criminal.mp3
\\192.168.80.251\media\public\data\audio\Music\alien antfarm- smooth criminal.mp3

#EXTINF:0,alphaville - napoleon dynamite - forever young.mp3
\\192.168.80.251\media\public\data\audio\Music\alphaville - napoleon dynamite - forever young.mp3

#EXTINF:0,armand van helden - Spin Spin Sugar (remix).mp3
\\192.168.80.251\media\public\data\audio\Music\armand van helden - Spin Spin Sugar (remix).mp3

As you can see, it creates absolute paths based on UNC format even though it was from a drive mapped with a drive letter. I guess that makes sense to make the playlist more mobile on your LAN. That was by dragging and dropping the files into the playlist from a folder. When you do the same thing from Windows Media Player's own media library, it seems to create relative paths starting ../..

Either way, it is likely to cause problems reparsing the paths so they relate to LMCE, as you are obviously testing now. Not sure how you are going to know what root path to splice in at the top, as it won't always be obvious which share LMCE has linked in... for me it would be:

/home/public/data/audio/Windows Share media[30]/Music/etc...

I guess you can key the parsing on "public/data/audio" and replace, but then how do you know to put in "Windows Share media [30]" after this, as it could be any number of shares....? Search perhaps?

Also, this is just Windows Media Player, other playlist editors could use different path roots, or even more relative path roots.... Do we standardise on one playlist editor that has wide acceptance and broad platform implementation?

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Thats exactly what we should do. If we want playlist import support, we will just have to have some known variables like agreeing on an editor..

The other thing we can do is ignore the path and just search the database against only the filename. Most of the time the filename should be unique anyways, though this isn't always the case. But when the filename isn't unique, it needs to either make a decision on its own, or present choices to the user. Thanks though for posting, it confirmed that I really can't convert an external path into an internal one as there are just too many variables. (i got it working on *mine*, but thats with me knowing some of my variables.

The other option is to only use the web admin playlist creation, and use the extM3U comment to comment the path of each entry for re-importing.. But then you can't use external editors.

I'm all ears for any other suggestions.. For now its a decision of even keeping m3u import on the list... Export is staying for sure though.

thorsten

  • Regular Poster
  • **
  • Posts: 21
    • View Profile
Hi,

my playlist editor (MediaMonkey on windows) also generates absolute UNC paths.

Playlist editors that generate relative paths regularly generate them relative to the place where you save the playlist file.

I suggest to make the media crawler (updater) daemon read playlists that the user saves on the samba share. This should work for most windows users that work with Media Player, WinAMP etc...

I have dozens of playlists and I would not use a manual import function, I just would like to be able to edit an existing playlist or generate a new one from my desktop PC, then drink a cup of coffee, go to the living room, turn on the amplifier and listen to the stuff...

This is how it worked with TwonkyMedia (an Upnp server) before I set up my LMCE, and even my wife was able to start playlists I generated for her...

If I should provide testing, generate playlists in a certain manner or do something different to help, I would like to!

Regards
Thorsten

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Ok, i've committed changes to SVN (revision 21092) for anyone that wants to test the new playlist editor out. I removed all .m3u functionality however until I can figure out a sane way to do it.

To test it out, do a SVN update, then copy:
charon-merge/web/pluto-admin/operations/mediaBrowser/images to /var/www/pluto-admin/operations/mediaBrowser/images (Note: this directory does not exist prior to this revision, so it must be added)
charon-merge/web/pluto-admin/operations/mediaBrowser/editPlaylist.php to /var/www/pluto-admin/operations/mediaBrowser/editPlaylist.php

Please test it out and give some feedback. I feel that the system is quite usable now!

Changelog
-Added Vertical layout option (still defaults to horizontal layout) This can be toggled even in the middle of editing a playlist.
-Graphics added to make a more intuitive UI (vertical layout only) (placeholder graphics at this time)
-Reworked Horizontal layout to allow more room for long filenames
-Removed ability to filter by sub-media type, as it isn't very useful and just not worth it for how much it complicated the SQL queries
-Choosing media type "All" no longer shows unsupported media types (i.e. .jpg and other types not supported by the playlist system). This shortened my list from over 4000 to under 1000! Bottom line is that you are only presented with a list of media that will work if added to the playlist.
-Changed "Order By" filename/title to "Display As" filename/title. This is much more user-friendly, as there may be some files where you are more familiar with the title, and other files you are more familiar with the filename.
-Added feature to gracefully handle files that have no Title attribute set if the user sets to display as title.
-Fixed filter by genre bug
-Fixed bug where a file removed from the playlist didn't re-appear in the media files list
-Changes are now automatically saved if you change pages while editing a playlist
-Fixed a bunch of improper SQL join operations
-added option for user to select records per page (default is still 1000)
-Fixed layout bug where a large number of pages would break up the screen layout
-Moved general properties such as Playlist Name and Image to the bottom of the page as they are more of a secondary function of the playlist editor.
-Fixed bug that would delete all entries of the playlist if an option on the left main menu pane was clicked while editing a playlist
-Changed how Filenames and Titles are displayed, taking up much less space and being more intuitive
-fixed bug that would reset the page to 1 after saving changes
-User privacy is now respected. Only media files that are public or owned by the user currently logged into the web admin are presented to the user for inclusion into their playlist.
-Playlist changes now auto-save when changing  media file pages
-various other sorting/filtering bugs fixed.
« Last Edit: July 03, 2008, 02:49:37 pm by jondecker76 »

freymann

  • Douchebag
  • Guru
  • *
  • Posts: 380
    • View Profile
To test it out, do a SVN update, then copy:
charon-merge/web/pluto-admin/operations/mediaBrowser/Images to /var/www/pluto-admin/operations/mediaBrowser/Images
charon-merge/web/pluto-admin/operations/mediaBrowser/editPlaylist.php to /var/www/pluto-admin/operations/mediaBrowser/editPlaylist.php

 After the svn update, I don't have:

charon-merge/web/pluto-admin/operations/mediaBrowser/Images

 but I do have:

charon-merge/web/pluto-admin/operations/mediaBrowser/images (lower case i)

 And the destination directory:

/var/www/pluto-admin/operations/mediaBrowser/Images

 doesn't exist yet, so you should create the "images" (lower case letters) directory first, then copy the png files over.



jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
yes, please use 'images' (lower case). Also correct that you will have to create the new directory in /var/www/pluto-admin/operations/mediaBrowser

Thanks for pointing that out, I will update the post to reflect this.


colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
jon

Was just playing with a bit of SQL:
SELECT * FROM `pluto_media`.`File` where path like '/home/public/data/videos/%/misc%'

This successfully ignores the "Windows Share - media[30]" bit that is in the path between "videos" and "misc" so that you don't need to know the share name, and returns all rows that match. You can just put a second criteria in there that is something like "and where filename like '<filename>'".

Although the first term could match rows that happen to have "misc" as a parent folder much deeper in the structure - in other words, strip out more than the /Windows Share - media[30]/ bit, in conjunction with the second criteria of filename, this should make it very specific - far moreso than just searching on the filename.

I'm not good with SQL, but I'm assuming that there are much better string slicing ways of doing this - the first part of the path(s) (/home/public/data/audio|video|etc) is predictable - search for the 5th "/" character and slice out uptil the 6th, to remove the share name part only. Then the only instances where an input line from the m3u file matches more than one media file in the database would be if you happened to have more than one share, with exactly the same folder structure, and exactly the same media file in the same location - that's gotta be pretty rare....

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Looks fantastic Jon! Especially in Vertical mode. Any chance you could add the "Artist" in a column to the right when viewing music?

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Yes, I'll look into improving it soon.
I haven't been around for a while (kids played sports all summer, my job has been busy as hell and I took on a second job designing a PLC to control grid connected wind turbines. I'm looking forward to catching back up with LMCE over the next week or so now that things are slowing down a bit!

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
I wondered where you were - I could see you recently online, but didn't see many posts from you!

BTW - where did your import/export get up to? Do you think we can extend UpdateMedia's functionality to add a new media type of playlist and a new standard folder under public/data, using the functionality you created? I know its really just the metadata and no media at all, but conceptually the sync works the same, and eliminates the problem of loosing playlists on rebuild. And there are several other advantages I can think of, too.
« Last Edit: October 19, 2008, 10:05:31 pm by colinjones »