aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-03-19 20:14:31 +0100
committerGravatar GitHub <noreply@github.com> 2019-03-19 20:14:31 +0100
commit834ffacce22ff6a2c0f1459476dc4a45e8ea06f9 (patch)
treec38618fc45cd6e0f466ed9d46f59902c4b5b1ccc /app/Controllers
parentcb00eafba02b5dfe9bfefd8a4b4228cccef9a6bf (diff)
No old ID (#2276)
* No old ID https://github.com/FreshRSS/FreshRSS/issues/2273 * PostgreSQL insert or ignore
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/feedController.php10
-rw-r--r--app/Controllers/importExportController.php2
2 files changed, 4 insertions, 8 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index d5ae235ad..7f36e0388 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -377,17 +377,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$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($read_upon_reception);
- } elseif ($entry_date < $date_min) {
- $id = min(time(), $entry_date) . uSecString();
+ $id = uTimeString();
+ $entry->_id($id);
+ if ($entry_date < $date_min) {
$entry->_isRead(true); //Old article that was not in database. Probably an error, so mark as read
} else {
- $id = uTimeString();
$entry->_isRead($read_upon_reception);
}
- $entry->_id($id);
$entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry);
if ($entry === null) {
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index 80b9868ec..1d7176929 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -585,7 +585,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
$feed_id, $item['id'], $item['title'], $author,
$content, $url, $published, $is_read, $is_starred
);
- $entry->_id(min(time(), $entry->date(true)) . uSecString());
+ $entry->_id(uTimeString());
$entry->_tags($tags);
if (isset($newGuids[$entry->guid()])) {