# This file will process all m3u requests set path_info [ad_conn path_info] # assume we get playlistid/playlist_name.m3u as the path set playlist_id [lindex [split $path_info /] 0] db_1row playlist_threshold "select remove_threshold from mp3_playlists where playlist_id=:playlist_id" db_foreach mp3_list "select m.mp3_id, s.title, m.total from mp3_mp3_playlist_map_view m, mp3_mp3s_not_deleted s where m.playlist_id = :playlist_id and s.mp3_id = m.mp3_id and m.total > :remove_threshold order by m.sort_key " { append page_text "http://jk30.ybos.net/mp3/mp3s/$mp3_id/$title.mp3\n" } if_no_rows { set page_text "" } ns_return 200 audio/x-mpegurl $page_text