For those interested, I have created a little PERL shell script to create the playlist SQL insert statement automatically.
Here u go. You do need to know PERL to run it
Code:
1. Create the file list
LIST.txt needs to be in this format
file1.mp3
file2.mp3
file3.mp3
you can do a dir or ls (in unix) and save the list to LIST.txt (or whatever)
2. Create a Perl script . Name it what you like i.e. list.pl
------------ cut here ------------------
#!D:/xampp/perl/bin/perl.exe #update this to the location of your perl executable #!/usr/bin/perl or whatever
# Open file
$data_file="LIST.txt";
my $url = "http://yourmp3_files_URL/";
open(FILE, $data_file) || die("Could not open file!");
@raw_data=<FILE>;
close (FILE);
# Data stored in VB this way
#Playlist 1 = 'vb_mp3playlist'
#Playlist 2 = 'vb_mp3playlist1'
#Playlist 3 = 'vb_mp3playlist2'
#Playlist 4 = 'vb_mp3playlist3'
#Playlist 5 = 'vb_mp3playlist4'
# Insert rows like this
#INSERT INTO `vb_mp3playlist` VALUES (1, 'mp3 1 url goes here', 'true', 1, 'artist and song number 1 goes here', 1);
#INSERT INTO `vb_mp3playlist` VALUES (2, 'mp3 2 url goes here', 'true', 1, 'artist and song number 2 goes here', 1);
#INSERT INTO `vb_mp3playlist` VALUES (3, 'mp3 3 url goes here', 'true', 1, 'artist and song number 3 goes here', 1);
my $i = 0; # or whatever you want the list to start at
foreach $line (@raw_data)
{
chop($line);
#Split name and extension
($w_name,$temp)=split(/\./,$line);
#build full url
my $mp3url= $url . $line;
#build songname
my $songname = $w_name;
#insert statement
print "INSERT INTO vb_mp3playlist VALUES ($i, '$mp3url', 'true', 1, '$songname', 1);\n";
$i++;
}
exit (0);
--------------------- cut here ---------------
3. Run scrit and pipe the results
list.pl > list.txt
4. Run the the SQL
5. Voila!