CODE
// Artistin ja kappaleen esitystapa
$puts(artisti,[$if2(%artist%,%artist%) - ]$if(%title%,%title%,%_filename%))
// Mikä formaatti?
$puts(Koodekki,$caps2($codec() ))
$if($strcmp(%__codec%,CDDA),$puts(Koodekki,'Audio CD' ))
// Tiedonsiirto nopeus
$puts(TSN,[[%__bitrate%] 'kbps'] )
// Tulostetaan tiedoston koko
$puts(Tkoko,'<>' $if($greater(%_filesize%,1048576),$num($left($num($muldiv(%_filesize%,100,1048576),6),4),1).$right($muldiv(%_filesize%,100,1048576),2) MB,$num($left($num($muldiv(%_filesize%,100,1024),6),4),1).$right($muldiv(%_filesize%,100,1024),2) kB))
$if($not(%_filesize%),$puts(Tkoko,))
// Extrainfon käsittely
$puts(text_extrainfo,[%__extrainfo%] )
$if($and($strcmp(%__codec%,WavPack),%__compression%),$puts(text_extrainfo,%__compression% ))
$if($and($strcmp(%__codec%,Musepack),%quality%),$puts(text_extrainfo,'Quality' %quality% ))
$if($and($not(%quality%),$strcmp(%__codec%,Musepack)),$puts(text_extrainfo,))
$if($and($strcmp(%__codec%,Vorbis),%quality%),$puts(text_extrainfo,'Quality' %quality% ))
$if($and($not(%quality%),$strcmp(%__codec%,Vorbis)),$puts(text_extrainfo,))
$if($and($strcmp(%__codec%,Monkey''s Audio),%__compression%),$puts(text_extrainfo,%__compression% ))
$if(%__mod_samples%,$puts(text_extrainfo,%__mod_samples% 'Module Samples' ))
$if($and($strcmp(%__codec%,OptimFROG),%__mode%),$puts(text_extrainfo,%__mode% ))
$if($and($strcmp(%__codec%,DualStream),%__mode%),$puts(text_extrainfo,%__mode% ))
$if($and($not(%__extrainfo%),$strcmp(%__codec%,MP3)),$puts(text_extrainfo,))
$if($and($not(%__extrainfo%),$strcmp(%__codec%,MP2)),$puts(text_extrainfo,))
// Tarkistetaan onko tiedosto Matroska tai MP4 tiedoston sisällä
$if($strcmp($ext(%_filename_ext%),mka),$puts(container, 'Matroska Container' ))
$if($strcmp($ext(%_filename_ext%),mp4),$puts(container, 'MP4 Container' ))
// HTML koodin alkuosat
'<html>'$crlf()
'<head>'$crlf()
$crlf()
' <title>Soittolista</title>'$crlf()
$crlf()
'<body bgcolor="#F5F5E6" text="#000000">'$crlf()
$crlf()
'<H1>Soittolista</H1>'$crlf()
$crlf()
'<p>'$crlf()
$num(%_playlist_number%,$len(%_playlist_total%)).
[$get(artisti) '<>' ]
[$get(Koodekki)]
[$get(TSN)]
[$caps2($get(text_extrainfo))]
[$get(container)]
['<>' %_length% ]
[$get(Tkoko)]$crlf()
'</p>'$crlf()
$crlf()
'<FONT SIZE="+2" COLOR=blue>© cyborg</FONT>'$crlf()
$crlf()
'</body>'$crlf()
$crlf()
'</html>'$crlf()
$puts(artisti,[$if2(%artist%,%artist%) - ]$if(%title%,%title%,%_filename%))
// Mikä formaatti?
$puts(Koodekki,$caps2($codec() ))
$if($strcmp(%__codec%,CDDA),$puts(Koodekki,'Audio CD' ))
// Tiedonsiirto nopeus
$puts(TSN,[[%__bitrate%] 'kbps'] )
// Tulostetaan tiedoston koko
$puts(Tkoko,'<>' $if($greater(%_filesize%,1048576),$num($left($num($muldiv(%_filesize%,100,1048576),6),4),1).$right($muldiv(%_filesize%,100,1048576),2) MB,$num($left($num($muldiv(%_filesize%,100,1024),6),4),1).$right($muldiv(%_filesize%,100,1024),2) kB))
$if($not(%_filesize%),$puts(Tkoko,))
// Extrainfon käsittely
$puts(text_extrainfo,[%__extrainfo%] )
$if($and($strcmp(%__codec%,WavPack),%__compression%),$puts(text_extrainfo,%__compression% ))
$if($and($strcmp(%__codec%,Musepack),%quality%),$puts(text_extrainfo,'Quality' %quality% ))
$if($and($not(%quality%),$strcmp(%__codec%,Musepack)),$puts(text_extrainfo,))
$if($and($strcmp(%__codec%,Vorbis),%quality%),$puts(text_extrainfo,'Quality' %quality% ))
$if($and($not(%quality%),$strcmp(%__codec%,Vorbis)),$puts(text_extrainfo,))
$if($and($strcmp(%__codec%,Monkey''s Audio),%__compression%),$puts(text_extrainfo,%__compression% ))
$if(%__mod_samples%,$puts(text_extrainfo,%__mod_samples% 'Module Samples' ))
$if($and($strcmp(%__codec%,OptimFROG),%__mode%),$puts(text_extrainfo,%__mode% ))
$if($and($strcmp(%__codec%,DualStream),%__mode%),$puts(text_extrainfo,%__mode% ))
$if($and($not(%__extrainfo%),$strcmp(%__codec%,MP3)),$puts(text_extrainfo,))
$if($and($not(%__extrainfo%),$strcmp(%__codec%,MP2)),$puts(text_extrainfo,))
// Tarkistetaan onko tiedosto Matroska tai MP4 tiedoston sisällä
$if($strcmp($ext(%_filename_ext%),mka),$puts(container, 'Matroska Container' ))
$if($strcmp($ext(%_filename_ext%),mp4),$puts(container, 'MP4 Container' ))
// HTML koodin alkuosat
'<html>'$crlf()
'<head>'$crlf()
$crlf()
' <title>Soittolista</title>'$crlf()
$crlf()
'<body bgcolor="#F5F5E6" text="#000000">'$crlf()
$crlf()
'<H1>Soittolista</H1>'$crlf()
$crlf()
'<p>'$crlf()
$num(%_playlist_number%,$len(%_playlist_total%)).
[$get(artisti) '<>' ]
[$get(Koodekki)]
[$get(TSN)]
[$caps2($get(text_extrainfo))]
[$get(container)]
['<>' %_length% ]
[$get(Tkoko)]$crlf()
'</p>'$crlf()
$crlf()
'<FONT SIZE="+2" COLOR=blue>© cyborg</FONT>'$crlf()
$crlf()
'</body>'$crlf()
$crlf()
'</html>'$crlf()
Here is the html file that it produces for one song:
CODE
<html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
20. Adam - Danger [Mass In Orbit Remix] <> MP3 192 kbps <> 6:59 <> 9.61 MB
</p>
<FONT SIZE="+2" COLOR=blue>© cyborg</FONT>
</body>
</html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
20. Adam - Danger [Mass In Orbit Remix] <> MP3 192 kbps <> 6:59 <> 9.61 MB
</p>
<FONT SIZE="+2" COLOR=blue>© cyborg</FONT>
</body>
</html>
Here is the html file it produces for many songs:
CODE
<html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
20. Adam - Danger [Mass In Orbit Remix] <> MP3 192 kbps <> 6:59 <> 9.61 MB
</p>
<FONT SIZE="+2" COLOR=blue>© Janne Silvennoinen</FONT>
</body>
</html>
<html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
21. Avanto - The Flute <> MP3 192 kbps <> 6:35 <> 9.05 MB
</p>
<FONT SIZE="+2" COLOR=blue>© Janne Silvennoinen</FONT>
</body>
</html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
20. Adam - Danger [Mass In Orbit Remix] <> MP3 192 kbps <> 6:59 <> 9.61 MB
</p>
<FONT SIZE="+2" COLOR=blue>© Janne Silvennoinen</FONT>
</body>
</html>
<html>
<head>
<title>Soittolista</title>
<body bgcolor="#F5F5E6" text="#000000">
<H1>Soittolista</H1>
<p>
21. Avanto - The Flute <> MP3 192 kbps <> 6:35 <> 9.05 MB
</p>
<FONT SIZE="+2" COLOR=blue>© Janne Silvennoinen</FONT>
</body>
</html>
What should I do to make it work correctly? How can I make the script to add the html codes in start of the file and end of the file once?