Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/edge' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
math-GH committed Apr 26, 2024
2 parents bc4c996 + 5ca0b89 commit e5bf420
Show file tree
Hide file tree
Showing 26 changed files with 89 additions and 55 deletions.
7 changes: 7 additions & 0 deletions app/Controllers/feedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
$existingHash = $existingHashForGuids[$entry->guid()];
if (strcasecmp($existingHash, $entry->hash()) !== 0) {
//This entry already exists but has been updated
$entry->_isUpdated(true);
//Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->url(false) .
//', old hash ' . $existingHash . ', new hash ' . $entry->hash());
$entry->_isFavorite(null); // Do not change favourite state
Expand All @@ -587,6 +588,11 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
continue;
}

$entry->applyFilterActions($titlesAsRead);
if ($readWhenSameTitleInFeed > 0) {
$titlesAsRead[$entry->title()] = true;
}

if (!$entry->isRead()) {
$needFeedCacheRefresh = true; //Maybe
$nbMarkedUnread++;
Expand All @@ -601,6 +607,7 @@ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url =
$entryDAO->updateEntry($entry->toArray());
}
} else {
$entry->_isUpdated(false);
$id = uTimeString();
$entry->_id($id);

Expand Down
13 changes: 13 additions & 0 deletions app/Models/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class FreshRSS_Entry extends Minz_Model {
private string $hash = '';
private ?bool $is_read;
private ?bool $is_favorite;
private bool $is_updated = false;
private int $feedId;
private ?FreshRSS_Feed $feed;
/** @var array<string> */
Expand Down Expand Up @@ -394,6 +395,18 @@ public function isFavorite(): ?bool {
return $this->is_favorite;
}

/**
* Returns whether the entry has been modified since it was inserted in database.
* @returns bool `true` if the entry already existed (and has been modified), `false` if the entry is new (or unmodified).
*/
public function isUpdated(): ?bool {
return $this->is_updated;
}

public function _isUpdated(bool $value): void {
$this->is_updated = $value;
}

public function feed(): ?FreshRSS_Feed {
if ($this->feed === null) {
$feedDAO = FreshRSS_Factory::createFeedDao();
Expand Down
10 changes: 8 additions & 2 deletions app/Models/FilterActionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,16 @@ public function applyFilterActions(FreshRSS_Entry $entry, ?bool &$applyLabel = n
}
break;
case 'star':
$entry->_isFavorite(true);
if (!$entry->isUpdated()) {
// Do not apply to updated articles, to avoid overruling a user manual action
$entry->_isFavorite(true);
}
break;
case 'label':
$applyLabel = true;
if (!$entry->isUpdated()) {
// Do not apply to updated articles, to avoid overruling a user manual action
$applyLabel = true;
}
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Alternative-Dark/adark.css
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,9 @@ kbd {
filter: grayscale(0.8) brightness(1.7);
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--font-color-light);
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Alternative-Dark/adark.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,9 @@ kbd {
filter: grayscale(0.8) brightness(1.7);
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--font-color-light);
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Ansum/_list-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
}

.item.date {
.item .date {
color: color.scale(variables.$unread-font-color, $alpha: -50%);
}
}
Expand All @@ -77,7 +77,8 @@
}
}

.item.date {
.flux_header .date,
.flux_content .bottom .date {
color: color.scale(variables.$main-font-color, $alpha: -50%);
font-size: 0.85rem;
}
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Ansum/ansum.css
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ main.prompt {
.flux.not_read .item.website a {
color: #161a38;
}
.flux.not_read .item.date {
.flux.not_read .item .date {
color: rgba(22, 26, 56, 0.5);
}
.flux.favorite {
Expand All @@ -1028,7 +1028,8 @@ main.prompt {
color: #363330;
opacity: 0.75;
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: rgba(54, 51, 48, 0.5);
font-size: 0.85rem;
}
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Ansum/ansum.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ main.prompt {
.flux.not_read .item.website a {
color: #161a38;
}
.flux.not_read .item.date {
.flux.not_read .item .date {
color: rgba(22, 26, 56, 0.5);
}
.flux.favorite {
Expand All @@ -1028,7 +1028,8 @@ main.prompt {
color: #363330;
opacity: 0.75;
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: rgba(54, 51, 48, 0.5);
font-size: 0.85rem;
}
Expand Down
3 changes: 2 additions & 1 deletion p/themes/Dark/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ button.as-link[disabled] {
color: var(--dark-font-color8);
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--dark-font-color6);
}

Expand Down
3 changes: 2 additions & 1 deletion p/themes/Dark/dark.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ button.as-link[disabled] {
color: var(--dark-font-color8);
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--dark-font-color6);
}

Expand Down
4 changes: 2 additions & 2 deletions p/themes/Flat/flat.css
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ th {
font-size: 0.9rem;
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: #666;
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Flat/flat.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ th {
font-size: 0.9rem;
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: #666;
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Mapco/_list-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
}

.item.date {
.item .date {
color: color.scale(variables.$unread-font-color, $alpha: -50%);
}
}
Expand All @@ -73,7 +73,8 @@
}
}

.item.date {
.flux_header .date,
.flux_content .bottom .date {
color: color.scale(variables.$main-font-color, $alpha: -50%);
font-size: 0.85rem;
}
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Mapco/mapco.css
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ main.prompt {
.flux.not_read .item.website a {
color: #36c;
}
.flux.not_read .item.date {
.flux.not_read .item .date {
color: rgba(51, 102, 204, 0.5);
}
.flux.favorite {
Expand All @@ -1043,7 +1043,8 @@ main.prompt {
color: #303136;
opacity: 0.75;
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: rgba(48, 49, 54, 0.5);
font-size: 0.85rem;
}
Expand Down
5 changes: 3 additions & 2 deletions p/themes/Mapco/mapco.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ main.prompt {
.flux.not_read .item.website a {
color: #36c;
}
.flux.not_read .item.date {
.flux.not_read .item .date {
color: rgba(51, 102, 204, 0.5);
}
.flux.favorite {
Expand All @@ -1043,7 +1043,8 @@ main.prompt {
color: #303136;
opacity: 0.75;
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: rgba(48, 49, 54, 0.5);
font-size: 0.85rem;
}
Expand Down
4 changes: 0 additions & 4 deletions p/themes/Nord/nord.css
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ li.item.active {
padding: 0.25rem;
}

.flux .item.date {
font-size: 0.7rem;
}

.flux .bottom {
font-size: 0.8rem;
text-align: center;
Expand Down
4 changes: 0 additions & 4 deletions p/themes/Nord/nord.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ li.item.active {
padding: 0.25rem;
}

.flux .item.date {
font-size: 0.7rem;
}

.flux .bottom {
font-size: 0.8rem;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Pafat/pafat.css
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,9 @@ a.signin {
padding: 0.425rem;
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--font-color-grey);
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Pafat/pafat.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,9 @@ a.signin {
padding: 0.425rem;
}

.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--font-color-grey);
font-size: 0.7rem;
}

.flux .bottom {
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Swage/swage.css
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ form th {
.flux.not_read:not(.current):hover .item .title {
background-color: var(--color-background-unread);
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--color-text-light-darker);
font-size: 0.7rem;
}
.flux .bottom {
font-size: 0.8rem;
Expand Down
4 changes: 2 additions & 2 deletions p/themes/Swage/swage.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ form th {
.flux.not_read:not(.current):hover .item .title {
background-color: var(--color-background-unread);
}
.flux .item.date {
.flux .flux_header .date,
.flux .flux_content .bottom .date {
color: var(--color-text-light-darker);
font-size: 0.7rem;
}
.flux .bottom {
font-size: 0.8rem;
Expand Down
8 changes: 3 additions & 5 deletions p/themes/Swage/swage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,9 @@ form {
}
}

.item {
&.date {
color: var(--color-text-light-darker);
font-size: 0.7rem;
}
.flux_header .date,
.flux_content .bottom .date {
color: var(--color-text-light-darker);
}

.bottom {
Expand Down
4 changes: 0 additions & 4 deletions p/themes/base-theme/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@ th {
padding: 5px;
}

.flux .item.date {
font-size: 0.7rem;
}

.flux:not(.current):hover .item.title {
}

Expand Down
4 changes: 0 additions & 4 deletions p/themes/base-theme/base.rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@ th {
padding: 5px;
}

.flux .item.date {
font-size: 0.7rem;
}

.flux:not(.current):hover .item.title {
}

Expand Down
11 changes: 10 additions & 1 deletion p/themes/base-theme/frss.css
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,11 @@ a.website:hover .favicon {
overflow: hidden;
}

.flux .flux_header .date,
.flux .flux_content .bottom .date {
font-size: 0.7rem;
}

.item.query > a {
display: list-item;
list-style-position: inside;
Expand Down Expand Up @@ -2205,7 +2210,7 @@ html.slider-active {
}

.flux_header .item.website span,
.item.date, .day .date,
.item .date, .day .date,
.dropdown-menu > .no-mobile,
.no-mobile {
display: none;
Expand Down Expand Up @@ -2248,6 +2253,10 @@ html.slider-active {
text-align: center;
}

.flux .flux_header .item .title:has(~.date) {
padding-right: 1rem;
}

#overlay .close {
position: relative;
}
Expand Down
Loading

0 comments on commit e5bf420

Please sign in to comment.