Choose correct title and summary for feed (might be related to #3).

This commit is contained in:
Colin Frei 2013-10-02 21:50:03 +02:00
parent 5afe73a4b2
commit ffd3ba33db

View file

@ -22,11 +22,13 @@ angular.module('podcasts.models', ['podcasts.database', 'podcasts.utilities'])
promise.then(function(xml) { promise.then(function(xml) {
var channelChildren = xml.find('channel').children(), var channelChildren = xml.find('channel').children(),
newFeed = {}, newFeed = {},
imageUrl; imageUrl,
titles = xml.find('title'),
descriptions = xml.find('description');
newFeed.url = cleanedUrl; newFeed.url = cleanedUrl;
newFeed.title = xml.find('title').text(); newFeed.title = angular.element(titles[Object.keys(titles)[0]]).text();
newFeed.summary = xml.find('description').text(); newFeed.summary = angular.element(descriptions[Object.keys(descriptions)[0]]).text();
newFeed.nrQueueItems = 1; newFeed.nrQueueItems = 1;
angular.forEach(channelChildren, function(value, key) { angular.forEach(channelChildren, function(value, key) {