Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <[email protected]>
  • Loading branch information
Grotax committed Dec 29, 2024
1 parent 219b1c3 commit 8e2c398
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 7 additions & 2 deletions lib/Service/FeedServiceV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
use FeedIo\Reader\ReadErrorException;
use FeedIo\Reader\NoAccurateParserException;
use HTMLPurifier;
use OCP\IAppConfig;

use OCA\News\Db\FeedMapperV2;
use OCA\News\Fetcher\FeedFetcher;
use OCA\News\AppInfo\Application;
use OCA\News\Service\Exceptions\ServiceConflictException;
use OCA\News\Service\Exceptions\ServiceNotFoundException;
use OCP\AppFramework\Db\Entity;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\IAppConfig;

use OCA\News\Db\Feed;
use OCA\News\Db\Item;
Expand Down Expand Up @@ -286,7 +287,11 @@ public function fetch(Entity $feed): Entity
}

// Check if the nextUpdateTime check should be used
$useNextUpdateTime = $this->config->getAppValue('news', 'useNextUpdateTime', 'true') === 'true';
$useNextUpdateTime = $this->config->getValueBool(
Application::NAME,
'useNextUpdateTime',
Application::DEFAULT_SETTINGS['useNextUpdateTime']
);

if ($useNextUpdateTime) {
$nextUpdateTime = $feed->getNextUpdateTime();
Expand Down
6 changes: 0 additions & 6 deletions tests/Unit/Service/FeedServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ protected function setUp(): void
->disableOriginalConstructor()
->getMock();

// Mock the getAppValue method
$this->config->method('getAppValue')
->willReturnMap([
['news', 'useNextUpdateTime', 'true', 'true'],
]);

$this->class = new FeedServiceV2(
$this->mapper,
$this->fetcher,
Expand Down

0 comments on commit 8e2c398

Please sign in to comment.