зеркало из https://github.com/nextcloud/news.git
more fixes
This commit is contained in:
Родитель
a72ed5f93f
Коммит
541318cb81
|
@ -39,7 +39,7 @@ class ItemBusinessLayer extends BusinessLayer {
|
|||
/**
|
||||
* Returns all new items
|
||||
* @param int $id the id of the feed, 0 for starred or all items
|
||||
* @param FeedType $type the type of the feed
|
||||
* @param int $type the type of the feed
|
||||
* @param int $updatedSince a timestamp with the last modification date
|
||||
* returns only items with a >= modified timestamp
|
||||
* @param boolean $showAll if unread items should also be returned
|
||||
|
@ -70,7 +70,7 @@ class ItemBusinessLayer extends BusinessLayer {
|
|||
/**
|
||||
* Returns all items
|
||||
* @param int $id the id of the feed, 0 for starred or all items
|
||||
* @param FeedType $type the type of the feed
|
||||
* @param int $type the type of the feed
|
||||
* @param int $limit how many items should be returned
|
||||
* @param int $offset only items lower than this id are returned, 0 for no offset
|
||||
* @param boolean $showAll if unread items should also be returned
|
||||
|
|
|
@ -60,6 +60,8 @@ class FeedFetcher implements IFeedFetcher {
|
|||
/**
|
||||
* Fetch a feed from remote
|
||||
* @param string url remote url of the feed
|
||||
* @param boolean $getFavicon if the favicon should also be fetched, defaults
|
||||
* to true
|
||||
* @throws FetcherException if simple pie fails
|
||||
* @return array an array containing the new feed and its items
|
||||
*/
|
||||
|
|
|
@ -23,11 +23,22 @@ class Fetcher {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add an additional fetcher
|
||||
* @param IFeedFetcher $fetcher the fetcher
|
||||
*/
|
||||
public function registerFetcher(IFeedFetcher $fetcher){
|
||||
array_push($this->fetchers, $fetcher);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch a feed from remote
|
||||
* @param string url remote url of the feed
|
||||
* @param boolean $getFavicon if the favicon should also be fetched, defaults
|
||||
* to true
|
||||
* @throws FetcherException if simple pie fails
|
||||
* @return array an array containing the new feed and its items
|
||||
*/
|
||||
public function fetch($url, $getFavicon=true){
|
||||
foreach($this->fetchers as $fetcher){
|
||||
if($fetcher->canHandle($url)){
|
||||
|
|
|
@ -16,8 +16,9 @@ namespace OCA\News\Fetcher;
|
|||
interface IFeedFetcher {
|
||||
|
||||
/**
|
||||
* @param string url the url that the user entered in the add feed dialog
|
||||
* box
|
||||
* @param string url remote url of the feed
|
||||
* @param boolean $getFavicon if the favicon should also be fetched, defaults
|
||||
* to true
|
||||
* @throws FetcherException if the fetcher encounters a problem
|
||||
* @return array with the first element being the feed and the
|
||||
* second element being an array of items. Those items will be saved into
|
||||
|
|
Загрузка…
Ссылка в новой задаче