By default: - `ssid_sessions[socket.ssid]` is now `session_data` - `require` is no longer allowed in user scripts To access global `socket_sessions` and `ssid_sessions`, as well as `require` additional modules, you must set `privileged: true` for the specific service. See `config.json`.
18 lines
449 B
JavaScript
18 lines
449 B
JavaScript
var minisrv_service_file = true;
|
|
|
|
var music_obj = wtvbgm.getMusicObj();
|
|
|
|
headers = `
|
|
200 OK
|
|
Connection: Keep-Alive
|
|
wtv-backgroundmusic-clear: no_zits
|
|
`;
|
|
|
|
Object.keys(music_obj.enableSongs).forEach(function (k) {
|
|
if (!wtvbgm.isCategoryEnabled(wtvbgm.getSongCategory(music_obj.enableSongs[k]))) return;
|
|
var song = wtvbgm.getSong(music_obj.enableSongs[k]);
|
|
if (song) headers += "wtv-backgroundmusic-add: "+song['url']+"\n";
|
|
});
|
|
|
|
data = '';
|