From c630ea38b1c78bcc825c794845141f529f8da87f Mon Sep 17 00:00:00 2001 From: santic-zombie Date: Wed, 1 Apr 2020 01:17:23 +0300 Subject: [PATCH] fix if else construct --- js/radio.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/radio.js b/js/radio.js index bbcdd89..d4bbcf5 100644 --- a/js/radio.js +++ b/js/radio.js @@ -26,16 +26,17 @@ function show() MPDartist = MPDsong = MPDfile = 'empty'; var array = temp.toString().split("\n"); // вывод в консоль информации о файле + /* for(i in array) { - console.log(array[i]);} + console.log(array[i]);} */ + // .replace - удаление пробелов в начале и конце строки MPDartist = array[0].replace(/^\s*/,'').replace(/\s*$/,''); MPDsong = array[1]; MPDfile = array[2].replace(/^vk_kun\//,'').replace(/\.mp3/,''); - console.log(MPDfile); + //console.log(MPDartist); - if (MPDartist == null && MPDsong == null) { - //document.querySelector('a[name="lastFMlink"]').setAttribute('href', null); + if (MPDartist == '') { $('#title').html(MPDfile); } else { lastfm.artist.getInfo({artist: MPDartist}, {success: function(data){