Skip to content

retain old books based on collection settings - #520

Merged
elfkuzco merged 1 commit into
mainfrom
retain-old-books
Sep 21, 2026
Merged

elfkuzco merged 1 commit into
mainfrom
retain-old-books

Conversation

@elfkuzco

Copy link
Copy Markdown
Contributor

Rationale

This PR enhances the logic to apply retention rules by not applying the rules for titles that belong to a collection with setting retain_old_books.

Changes

  • add new column retain_old_books to collection and collection history
  • skip application of retention rules to titles that belong to any collection with setting retain_old_books set to True
  • create/update collection property retain_old_books
  • add collections, created_before and created_after filters to books API/UI
Screenshot_20260917_162257 Screenshot_20260917_162020 Screenshot_20260917_161632

This closes #517

@elfkuzco
elfkuzco added this pull request to stack #521 September 17, 2026 15:30
@elfkuzco elfkuzco self-assigned this Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.91%. Comparing base (ab047e8) to head (08d789b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #520      +/-   ##
==========================================
+ Coverage   81.80%   81.91%   +0.11%     
==========================================
  Files          70       70              
  Lines        4435     4452      +17     
  Branches      523      527       +4     
==========================================
+ Hits         3628     3647      +19     
+ Misses        643      642       -1     
+ Partials      164      163       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elfkuzco
elfkuzco requested a review from benoit74 September 17, 2026 15:37

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, two small remarks.

Comment thread backend/src/cms_backend/db/rules.py Outdated
Comment thread backend/src/cms_backend/db/rules.py Outdated

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from fix-book-illustration-diffs to main September 21, 2026 08:31
@elfkuzco
elfkuzco merged commit 87a3fe5 into main Sep 21, 2026
7 checks passed
@elfkuzco
elfkuzco deleted the retain-old-books branch September 21, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Older zim files are not deleted in /custom_apps

2 participants