various fix thanks to eslint

This commit is contained in:
boyska 2023-09-14 00:16:21 +01:00
parent 4e19b6304e
commit 3d0ac08488
3 changed files with 9 additions and 5 deletions

View file

@ -9,5 +9,7 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {}
"rules": {
"no-unused-vars": ["error", {"argsIgnorePattern": "^_"}]
}
}

View file

@ -178,7 +178,7 @@ class Radio {
class RadioStreaming {
constructor(sources) {
this.sources = sources.sort(
(a, b) => this.getPriority(a) < this.getPriority(a),
(a, b) => this.getPriority(a) < this.getPriority(b),
);
}
@ -254,7 +254,7 @@ class RadioStreaming {
* @param {Object} options options. Currenly unused
* @return {Radio}
*/
async function get(siteurl, options) {
async function get(siteurl, _options) {
let resp = await fetch(getManifestUrl(siteurl));
let text = await resp.text();

6
ui.js
View file

@ -1,12 +1,14 @@
/* global radiomanifest */
// const radiomanifest = require('radiomanifest.js')
function updateNow(radio) {
var box = document.querySelector("#now-info");
const show = radio.getSchedule().getNowShow();
var showText;
try {
var showText = show.getName() + "\nfeed: " + show.getWebsite();
showText = show.getName() + "\nfeed: " + show.getWebsite();
} catch (e) {
var showText = String(show);
showText = String(show);
}
var text =
radio.getName() + " - " + radio.getDescription() + " -- " + showText;