summaryrefslogtreecommitdiffstats
path: root/bl
diff options
context:
space:
mode:
Diffstat (limited to 'bl')
-rw-r--r--bl/feedbl.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/bl/feedbl.php b/bl/feedbl.php
index 53a2e6061..8df399788 100644
--- a/bl/feedbl.php
+++ b/bl/feedbl.php
@@ -25,6 +25,8 @@
namespace OCA\News\Bl;
+use \OCA\AppFramework\Db\DoesNotExistException;
+
use \OCA\News\Db\Feed;
use \OCA\News\Db\FeedMapper;
use \OCA\News\Utility\FeedFetcher;
@@ -56,6 +58,10 @@ class FeedBl extends Bl {
public function create($feedUrl, $folderId, $userId){
// first try if the feed exists already
+ try {
+ $this->mapper->findByUrlHash(md5($feedUrl), $userId);
+ throw new BLException('Can not add feed: Exists already');
+ } catch(DoesNotExistException $ex){}
try {
list($feed, $items) = $this->feedFetcher->fetch($feedUrl);