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

Grant Edwards grante at visi.com
Tue Aug 31 17:24:26 EDT 2004


>> I suppose I could to MySQL command-line stuff, but that's just
>> a bit scary.
> 
> Not too scary...

Certainly not as scary as Perl. ;)

> 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.

Thanks, that answers one of my questions (what goes in the
songlist field).

On my system the filename in the DB appears to be relative to
the /data/music directory. I _swear_ I tried that style in the
m3u file and it didn't work.  At one point I had cr/lf line
endings in the m3u file, but that shouldn't matter since it got
chomped, right?

Now that I know what the filenames are in DB, I'm going to
change the m3u files back (I think they're absolute paths at
the moment) and try your program again.

> If the DB path varies slightly, I see a couple of options:
> -Modify the m3u files to use the same paths

That's the initial plan...

> -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.

Thanks for the help!

-- 
Grant Edwards
grante at visi.com


More information about the mythtv-users mailing list