Modified link to internal radio. And deleted /filelist and /playlist endpoints and moved them to nginx.

This commit is contained in:
Alexander Andreev 2021-11-16 18:21:26 +04:00
parent 3fe0783f9e
commit ddd4e839d0
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -13,7 +13,7 @@ const util = require("../shared/util");
async function getRadioStatus() {
try {
let status = await fetch('http://radio.arav.home/status-json.xsl').then(r => r.json());
let status = await fetch('http://radio.arav.home.arpa/status-json.xsl').then(r => r.json());
return {
server_start_iso8601: status.icestats.server_start_iso8601,
server_start_date: util.datetime(status.icestats.server_start_iso8601, util.post_date_format),
@ -56,16 +56,6 @@ function setRoutes() {
last_songs: await getLastPlayedSongs()
});
})
.get('/filelist', async ctx => {
ctx.type = 'text/html';
ctx.body = fs.readFileSync(
path.join(__dirname, '/static/radio_filelist.html'));
})
.get('/playlist', async ctx => {
ctx.attachment('radio.arav.top.m3u');
ctx.body = fs.readFileSync(
path.join(__dirname, '/static/assets/files/radio.arav.top.m3u'));
})
.get('/stats', async ctx => {
ctx.body = await getRadioStatus();
})