aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2018-01-01 20:34:06 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-01-01 20:34:06 +0100
commit8c2113f9e6eb86b630a4e861513229d7abf219b8 (patch)
tree6e9ca68cf291a21d573f82ff7818c66e40a7ec30 /app/Models/Feed.php
parente73fae159168b1ed9c0469e1d5bce55a3ef1f911 (diff)
Add mute strategy configuration (#1750)
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 560f7415d..216a26d44 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -1,6 +1,12 @@
<?php
class FreshRSS_Feed extends Minz_Model {
+ const PRIORITY_MAIN_STREAM = 10;
+ const PRIORITY_NORMAL = 0;
+ const PRIORITY_ARCHIVED = -10;
+
+ const TTL_DEFAULT = 0;
+
private $id = 0;
private $url;
private $category = 1;
@@ -11,12 +17,13 @@ class FreshRSS_Feed extends Minz_Model {
private $website = '';
private $description = '';
private $lastUpdate = 0;
- private $priority = 10;
+ private $priority = self::PRIORITY_MAIN_STREAM;
private $pathEntries = '';
private $httpAuth = '';
private $error = false;
private $keep_history = -2;
- private $ttl = -2;
+ private $ttl = self::TTL_DEFAULT;
+ private $mute = false;
private $hash = null;
private $lockPath = '';
private $hubUrl = '';
@@ -104,9 +111,12 @@ class FreshRSS_Feed extends Minz_Model {
public function ttl() {
return $this->ttl;
}
+ public function mute() {
+ return $this->mute;
+ }
// public function ttlExpire() {
// $ttl = $this->ttl;
- // if ($ttl == -2) { //Default
+ // if ($ttl == self::TTL_DEFAULT) { //Default
// $ttl = FreshRSS_Context::$user_conf->ttl_default;
// }
// if ($ttl == -1) { //Never
@@ -198,8 +208,7 @@ class FreshRSS_Feed extends Minz_Model {
$this->lastUpdate = $value;
}
public function _priority($value) {
- $value = intval($value);
- $this->priority = $value >= 0 ? $value : 10;
+ $this->priority = intval($value);
}
public function _pathEntries($value) {
$this->pathEntries = $value;
@@ -219,8 +228,8 @@ class FreshRSS_Feed extends Minz_Model {
public function _ttl($value) {
$value = intval($value);
$value = min($value, 100000000);
- $value = max($value, -2);
- $this->ttl = $value;
+ $this->ttl = abs($value);
+ $this->mute = $value < self::TTL_DEFAULT;
}
public function _nbNotRead($value) {
$this->nbNotRead = intval($value);