|
|
@@ -267,12 +267,16 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
|
|
|
|
|
|
/**
|
|
|
* @param bool|null $muted to include only muted feeds
|
|
|
+ * @param bool|null $errored to include only errored feeds
|
|
|
*/
|
|
|
- public function deleteFeedByCategory(int $id, ?bool $muted = null): int|false {
|
|
|
+ public function deleteFeedByCategory(int $id, ?bool $muted = null, ?bool $errored = null): int|false {
|
|
|
$sql = 'DELETE FROM `_feed` WHERE category=?';
|
|
|
if ($muted) {
|
|
|
$sql .= ' AND ttl < 0';
|
|
|
}
|
|
|
+ if ($errored) {
|
|
|
+ $sql .= ' AND error <> 0';
|
|
|
+ }
|
|
|
$stm = $this->pdo->prepare($sql);
|
|
|
|
|
|
$values = [$id];
|
|
|
@@ -406,13 +410,17 @@ SQL;
|
|
|
|
|
|
/**
|
|
|
* @param bool|null $muted to include only muted feeds
|
|
|
+ * @param bool|null $errored to include only errored feeds
|
|
|
* @return array<int,FreshRSS_Feed>
|
|
|
*/
|
|
|
- public function listByCategory(int $cat, ?bool $muted = null): array {
|
|
|
+ public function listByCategory(int $cat, ?bool $muted = null, ?bool $errored = null): array {
|
|
|
$sql = 'SELECT * FROM `_feed` WHERE category=:category';
|
|
|
if ($muted) {
|
|
|
$sql .= ' AND ttl < 0';
|
|
|
}
|
|
|
+ if ($errored) {
|
|
|
+ $sql .= ' AND error <> 0';
|
|
|
+ }
|
|
|
$res = $this->fetchAssoc($sql, [':category' => $cat]);
|
|
|
if ($res == null) {
|
|
|
return [];
|