summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorskiingwiz <skiingwiz@gmail.com>2021-03-27 22:15:10 -0400
committerBenjamin Brahmer <info@b-brahmer.de>2021-04-02 11:15:17 +0200
commit04519388ce1bf3acc9997b35748762a7380e5954 (patch)
tree628b743c43c39aa4319153f3e5482ff35fd383af /lib
parente917127a7bab29b06ffca597fbb554cf57f6d212 (diff)
Allow directly adding a feed without going through the discovery process
Signed-off-by: skiingwiz <skiingwiz@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/FeedController.php6
-rw-r--r--lib/Service/FeedServiceV2.php11
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/Controller/FeedController.php b/lib/Controller/FeedController.php
index 9c97d34b1..f071ade0f 100644
--- a/lib/Controller/FeedController.php
+++ b/lib/Controller/FeedController.php
@@ -161,7 +161,8 @@ class FeedController extends Controller
?int $parentFolderId,
?string $title = null,
?string $user = null,
- ?string $password = null
+ ?string $password = null,
+ bool $fullDiscover = true
) {
if ($parentFolderId === 0) {
$parentFolderId = null;
@@ -178,7 +179,8 @@ class FeedController extends Controller
false,
$title,
$user,
- $password
+ $password,
+ $fullDiscover
);
$params = ['feeds' => [$feed]];
diff --git a/lib/Service/FeedServiceV2.php b/lib/Service/FeedServiceV2.php
index d15dfceb7..bb1be8dcb 100644
--- a/lib/Service/FeedServiceV2.php
+++ b/lib/Service/FeedServiceV2.php
@@ -189,15 +189,18 @@ class FeedServiceV2 extends Service
bool $full_text = false,
?string $title = null,
?string $user = null,
- ?string $password = null
+ ?string $password = null,
+ bool $full_discover = true
): Entity {
if ($this->existsForUser($userId, $feedUrl)) {
throw new ServiceConflictException('Feed with this URL exists');
}
- $feeds = $this->explorer->discover($feedUrl);
- if ($feeds !== []) {
- $feedUrl = array_shift($feeds);
+ if ($full_discover) {
+ $feeds = $this->explorer->discover($feedUrl);
+ if ($feeds !== []) {
+ $feedUrl = array_shift($feeds);
+ }
}
try {