mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-18 05:14:34 -04:00
JSON column for feeds (#1838)
* Draft of JSON column for feeds https://github.com/FreshRSS/FreshRSS/issues/1654 * Add some per-feed options * Feed cURL timeout * Mark updated articles as read https://github.com/FreshRSS/FreshRSS/issues/891 * Mark as read upon reception https://github.com/FreshRSS/FreshRSS/issues/1702 * Ignore SSL (unsafe) https://github.com/FreshRSS/FreshRSS/issues/1811 * Try PHPCS workaround While waiting for a better syntax support
This commit is contained in:
committed by
GitHub
parent
404ca869e9
commit
b552abb332
@@ -84,6 +84,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
'description' => $feed->description(),
|
||||
'lastUpdate' => time(),
|
||||
'httpAuth' => $feed->httpAuth(),
|
||||
'attributes' => array(),
|
||||
);
|
||||
|
||||
$id = $feedDAO->addFeed($values);
|
||||
@@ -271,7 +272,6 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
|
||||
$updated_feeds = 0;
|
||||
$nb_new_articles = 0;
|
||||
$is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0;
|
||||
foreach ($feeds as $feed) {
|
||||
$url = $feed->url(); //For detection of HTTP 301
|
||||
|
||||
@@ -353,8 +353,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
} else { //This entry already exists but has been updated
|
||||
//Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->id() .
|
||||
//', old hash ' . $existingHash . ', new hash ' . $entry->hash());
|
||||
//TODO: Make an updated/is_read policy by feed, in addition to the global one.
|
||||
$needFeedCacheRefresh = FreshRSS_Context::$user_conf->mark_updated_article_unread;
|
||||
$mark_updated_article_unread = $feed->attributes('mark_updated_article_unread') !== null ? (
|
||||
$feed->attributes('mark_updated_article_unread')
|
||||
) : FreshRSS_Context::$user_conf->mark_updated_article_unread;
|
||||
$needFeedCacheRefresh = $mark_updated_article_unread;
|
||||
$entry->_isRead(FreshRSS_Context::$user_conf->mark_updated_article_unread ? false : null); //Change is_read according to policy.
|
||||
if (!$entryDAO->inTransaction()) {
|
||||
$entryDAO->beginTransaction();
|
||||
@@ -365,15 +367,18 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// This entry should not be added considering configuration and date.
|
||||
$oldGuids[] = $entry->guid();
|
||||
} else {
|
||||
$read_upon_reception = $feed->attributes('read_upon_reception') !== null ? (
|
||||
$feed->attributes('read_upon_reception')
|
||||
) : FreshRSS_Context::$user_conf->mark_when['reception'];
|
||||
if ($isNewFeed) {
|
||||
$id = min(time(), $entry_date) . uSecString();
|
||||
$entry->_isRead($is_read);
|
||||
$entry->_isRead($read_upon_reception);
|
||||
} elseif ($entry_date < $date_min) {
|
||||
$id = min(time(), $entry_date) . uSecString();
|
||||
$entry->_isRead(true); //Old article that was not in database. Probably an error, so mark as read
|
||||
} else {
|
||||
$id = uTimeString();
|
||||
$entry->_isRead($is_read);
|
||||
$entry->_isRead($read_upon_reception);
|
||||
}
|
||||
$entry->_id($id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user