[mythtv-users] Re: m3u2myth.pl inserting empty playlists

m0j0.j0j0 m0j0 at foofus.net
Tue Aug 31 16:55:09 EDT 2004


On Tue, 2004-08-31 at 14:31, Grant Edwards wrote:
> I haven't been able to figure out is what the filenames are in
> the DB actually are.  I'm going to grab the MySQL module for
> Python sometime and see how much damage I can do with that.
> 
> I suppose I could to MySQL command-line stuff, but that's just
> a bit scary.

Not too scary...

Connect to DB: mysql -u mythtv mythconverg -p
Run: SELECT filename FROM musicmetadata;

This should give you an idea of what path info you have for the existing
files in the DB. All my script does is:

SELECT intid FROM musicmetadata WHERE filename='/path/to/file.mp3';

'/path/to/file.mp3' is whatever is listed in the m3u file. If it MySQL
finds a match, it returns the song id, which is appended to the new
playlist.

If the DB path varies slightly, I see a couple of options:
-Modify the m3u files to use the same paths
-Modify the script to search on a more appropriate filename

Either option shouldn't be too hard and are probably quicker than
starting over in Python. Of course, my script is pretty lame and could
be written better either in Perl or some other language.

Joe



More information about the mythtv-users mailing list