From 24c3d0c92e954cbe76c1742f4155f8488caa1ad1 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Tue, 13 Nov 2012 00:23:15 -0500 Subject: [News] a title of a feed from an opml import should be the one saved in the file --- ajax/importopml.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ajax') diff --git a/ajax/importopml.php b/ajax/importopml.php index f0a7d556c..3733f5413 100644 --- a/ajax/importopml.php +++ b/ajax/importopml.php @@ -66,7 +66,7 @@ if ($parsed == null) { $data = $parsed->getData(); -function importFeed($feedurl, $folderid) { +function importFeed($feedurl, $folderid, $feedtitle) { global $eventSource; global $l; @@ -78,6 +78,7 @@ function importFeed($feedurl, $folderid) { $feed = OCA\News\Utils::slimFetch($feedurl); if ($feed !== null) { + $feed->setTitle($feedtitle); //we want the title of the feed to be the one from the opml file $feedid = $feedmapper->save($feed, $folderid); $itemmapper = new OCA\News\ItemMapper(OCP\USER::getUser()); @@ -137,7 +138,8 @@ function importList($data, $parentid) { foreach($data as $collection) { if ($collection instanceOf OCA\News\Feed) { $feedurl = $collection->getUrl(); - if (importFeed($feedurl, $parentid)) { + $feedtitle = $collection->getTitle(); + if (importFeed($feedurl, $parentid, $feedtitle)) { $countsuccess++; } } -- cgit v1.2.3