Skip to content

Commit

Permalink
Fix archiving
Browse files Browse the repository at this point in the history
fix FreshRSS#5934
Regression from FreshRSS#5830
  • Loading branch information
Alkarex committed Dec 10, 2023
1 parent 803fa8f commit 29479a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions app/Controllers/configureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,15 @@ public function archivingAction(): void {
'keep_period_count' => '3',
'keep_period_unit' => 'P1M',
];
$keepPeriod = FreshRSS_Context::$user_conf->archiving['keep_period'];
if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $keepPeriod, $matches)) {
$volatile = [
'enable_keep_period' => true,
'keep_period_count' => $matches['count'],
'keep_period_unit' => str_replace($matches['count'], '1', $keepPeriod),
];
if (!empty(FreshRSS_Context::$user_conf->archiving['keep_period'])) {
$keepPeriod = FreshRSS_Context::$user_conf->archiving['keep_period'];
if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $keepPeriod, $matches)) {
$volatile = [
'enable_keep_period' => true,
'keep_period_count' => $matches['count'],
'keep_period_unit' => str_replace($matches['count'], '1', $keepPeriod),
];
}
}
FreshRSS_Context::$user_conf->volatile = $volatile;

Expand Down
2 changes: 1 addition & 1 deletion app/Models/UserConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/**
* @property string $apiPasswordHash
* @property array<string,mixed> $archiving
* @property array{'keep_period':string|false,'keep_max':int|false,'keep_min':int|false,'keep_favourites':bool,'keep_labels':bool,'keep_unreads':bool} $archiving
* @property bool $auto_load_more
* @property bool $auto_remove_article
* @property bool $bottomline_date
Expand Down

0 comments on commit 29479a6

Please sign in to comment.