
227
Chapter 10, Access Your Entire Media Collection Over the Internet
title='Click here to play all the songs by this
artist.'>
<%= strArtist %>
</a>
</h3>
<%
For Each objAlbum in objFSO.GetFolder(MEDIA_LIBRARY_PATH & "\"
& strArtist).SubFOlders %>
<h4>
<a href='<%=strScriptName %>?action=play&type=album&art
ist=<%= strArtist %>&album=<%= objAlbum.Name %>'
title='Click here to play whole album.'>
<%= objAlbum.Name %>
</a>
</h4>
<% For Each objSong in objAlbum.Files
If objFSO.GetExtensionName(objSong) = "mp3" then %>
<a href='<%= strScriptName %>?action=play&type=son
g&artist=<%= strArtist %>&album=<%= objAlbum.Name %>&song=<%= objSong.
Name %>'
title='Click here to play this song.'>
<%= objSong.Name %>
</a><br>
<% End If
Next
Next
'Clean up
set objFSO = Nothing
Set objAlbum = Nothing
Set objSong = Nothing
End Sub
%>
Exhibit C: playlist.asp
<%
Function GenerateArtistPlaylist(strArtist)
' This function creates a playlist of all the songs by a given
artist and
' returns the playtlists filename for download.
Dim objFSO ' File system object
Dim strPlaylist ' Playlist filename
Dim objPlaylist ' Playlist file object
Dim strArtistURL ' Base URL to album
Dim objAlbum ' ALbum folder object
Dim objSong ' Song file object
' Create new empty playlist in temp folder
Set objFSO = CreateObject("Scripting.FileSystemObject")
strPlaylist = objFSO.GetBaseName(objFSO.GetTempName) & ".m3u"
Set objPlaylist ...