var minisrv_service_file = true;
var WTVBGMusic = require("./WTVBGMusic.js");
var wtvbgm = new WTVBGMusic(minisrv_config, ssid_sessions[socket.ssid]);
if (request_headers.query.category) {
var musicList = wtvbgm.getCategorySongList(request_headers.query.category);
var categoryName = wtvbgm.getCategoryName(request_headers.query.category);
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-
wtv-expire-all: http
Content-Type: text/html`
data = `
${categoryName}
${(musicList.length > 14) ? '
' : '
'}
${categoryName}
Choose the songs that you'd like to include.
`;
}
data += `
`;
if (musicList[k]['title'].length > 12 && musicList[k]['title'].length < 18) data += ``;
if (musicList[k]['title'].length > 18) data += ``;
data += `${musicList[k]['title']}
`;
if (musicList[k]['title'].length > 12) data += ``;
songsListed++;
});
data += `
`;
} else {
var errPage = doErrorPage("400", "Category ID is required.");
headers = errPage[0];
data = errPage[1];
}