diff --git a/lib/Service/FeedServiceV2.php b/lib/Service/FeedServiceV2.php index bd6489efe..ad984188d 100644 --- a/lib/Service/FeedServiceV2.php +++ b/lib/Service/FeedServiceV2.php @@ -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; @@ -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(); diff --git a/tests/Unit/Service/FeedServiceTest.php b/tests/Unit/Service/FeedServiceTest.php index eb5b2a94e..3ccdb7100 100644 --- a/tests/Unit/Service/FeedServiceTest.php +++ b/tests/Unit/Service/FeedServiceTest.php @@ -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,