fix if else construct
This commit is contained in:
@@ -26,16 +26,17 @@ function show()
|
|||||||
MPDartist = MPDsong = MPDfile = 'empty';
|
MPDartist = MPDsong = MPDfile = 'empty';
|
||||||
var array = temp.toString().split("\n");
|
var array = temp.toString().split("\n");
|
||||||
// вывод в консоль информации о файле
|
// вывод в консоль информации о файле
|
||||||
|
/*
|
||||||
for(i in array) {
|
for(i in array) {
|
||||||
console.log(array[i]);}
|
console.log(array[i]);} */
|
||||||
|
|
||||||
// .replace - удаление пробелов в начале и конце строки
|
// .replace - удаление пробелов в начале и конце строки
|
||||||
MPDartist = array[0].replace(/^\s*/,'').replace(/\s*$/,'');
|
MPDartist = array[0].replace(/^\s*/,'').replace(/\s*$/,'');
|
||||||
MPDsong = array[1];
|
MPDsong = array[1];
|
||||||
MPDfile = array[2].replace(/^vk_kun\//,'').replace(/\.mp3/,'');
|
MPDfile = array[2].replace(/^vk_kun\//,'').replace(/\.mp3/,'');
|
||||||
console.log(MPDfile);
|
//console.log(MPDartist);
|
||||||
|
|
||||||
if (MPDartist == null && MPDsong == null) {
|
if (MPDartist == '') {
|
||||||
//document.querySelector('a[name="lastFMlink"]').setAttribute('href', null);
|
|
||||||
$('#title').html(MPDfile);
|
$('#title').html(MPDfile);
|
||||||
} else {
|
} else {
|
||||||
lastfm.artist.getInfo({artist: MPDartist}, {success: function(data){
|
lastfm.artist.getInfo({artist: MPDartist}, {success: function(data){
|
||||||
|
|||||||
Reference in New Issue
Block a user