Skip to content

Commit

Permalink
Update loader.js
Browse files Browse the repository at this point in the history
  • Loading branch information
robwalch committed Nov 18, 2015
1 parent 3173f3f commit f5f5950
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/js/playlist/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ define([
break;
}
}
if (parsers.localName(rss) === 'xml') {
rss = rss.nextSibling;
}
if (parsers.localName(rss) === 'rss') {
pl = rssParser.parse(rss);
}
}

if (parsers.localName(rss) === 'xml') {
rss = rss.nextSibling;
}

// If the response is not a valid RSS, check if it is a JSON
if (parsers.localName(rss) === 'rss') {
pl = rssParser.parse(rss);
} else {
// If the response is not valid RSS, check if it is JSON
if (!_.isArray(pl)) {
try {
pl = JSON.parse(loadedEvent.responseText);
// If the response is not a JSON array, try to read playlist of the response
if (!Array.isArray(pl)) {
if (!_.isArray(pl)) {
pl = pl.playlist;
}
} catch (e) {
Expand Down

0 comments on commit f5f5950

Please sign in to comment.