mirror of
https://github.com/serrebidev/BlindRSS.git
synced 2026-08-13 11:59:26 -07:00
Isolate storage and internal processing of retention settings from UI language #52
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
serrebi/BlindRSS#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the retention-related settings in BlindRSS are tightly coupled with their UI display labels. This causes the configuration to break when the user changes the application’s language.
Affected settings
Settings > Feeds & Articles > Article Retention(combobox)article_retentionSettings > Downloads > Retention Policy(combobox)download_retentionCurrent behavior
retention_optsarray ingui/dialogs.py.gettext()calls, so they are not localizable._perform_retention_cleanup(),_retention_seconds()ingui/mainframe.py) directly processes these label strings.The problem that prevents these strings from being localized is described below.
Problem
If a user:
then the stored config values (which are label strings in Language A) will no longer match the new localized labels in Language B. This leads to:
This violates the best practice of decoupling persistent configuration from UI presentation.
Required solution
Refactor the retention settings so that:
1_day,1_year,5_years, etc.).gettext()._perform_retention_cleanup(),_retention_seconds(), and any other places) operates on the stable identifiers, not on UI label strings.Scope
gui/dialogs.pyto defineretention_optsas a mapping from identifier → localized label.gui/mainframe.pymethods (_perform_retention_cleanup(),_retention_seconds()) to work with identifiers.Acceptance criteria
Additional notes
Fixed in v1.99.5. Thanks for the thorough write-up — implemented essentially as you specified.
What changed:
core/retention.pydefines the stable identifiers (1_day…5_years,unlimited) as the single source of truth, along with the day/second math and the identifier-to-localized-label mapping.ConfigManagerconverts existing label-based values for botharticle_retentionanddownload_retention, including the legacy2 days/3 monthslabels that the old cleanup code accepted but the UI never offered. Unknown or corrupt values fall back tounlimited— the safe direction, so a bad value can never delete more than the user asked for._perform_retention_cleanup()and_retention_seconds()now operate on identifiers through the shared module; the hardcoded label tables are gone. Legacy label strings remain accepted defensively anywhere they might still appear.tests/test_retention_identifiers.py(normalization, migration, both value forms end to end).Also in v1.99.5 — the bug you reported about new articles not appearing until the entire refresh finishes is fixed. It was a regression from v1.99.0: the list-churn work deferred every article-list reload until the whole refresh batch ended. The visible list now reloads on a slow throttle (about every 2.5 seconds) while a refresh is running, so articles stream in as each feed completes again — without going back to the per-feed reload churn that used to starve full-text extraction.
Thanks! We need to do the same for the "Uncategorized" system folder. It seems like localizing its name might break something. Please take a look at the current implementation.