Skip to content

move and delete books manually#204

Open
elfkuzco wants to merge 3 commits intomainfrom
delete-books
Open

move and delete books manually#204
elfkuzco wants to merge 3 commits intomainfrom
delete-books

Conversation

@elfkuzco
Copy link
Contributor

@elfkuzco elfkuzco commented Mar 10, 2026

Rationale

This PR adds functionality to move, recover and delete books from the API/UI.
Screenshot_20260310_045108
Screenshot_20260310_045044
Screenshot_20260310_045027

Changes

  • add endpoints to delete, move and recover book
  • move quarantine and staging related warehouse env vars from mill to common context as they are now used by the API layer too
  • enhance get_book_or_none function to allow for passing params for filtering instead of having if...else checks for attributes
  • add db functions to move, recover and delete book
  • previously, the shuttle delete_files logic set the book has_error if deletion failed. This doesn't seem correct as the book does not necessarily have an error. Instead, in addition to logging the exception message, set the needs_file_operation to False
  • remove the has_error flag from filters to get_next_book_to_delete as we want to now delete books that have errors too
  • add UI buttons to move, recover and delete book
  • only include quarantine, staging and/or prod books in library.xml generation (filter added in DB query get_latest_books_for_collection)

This closes #143

@elfkuzco elfkuzco self-assigned this Mar 10, 2026
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 89.16667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.19%. Comparing base (5d55224) to head (83af63f).

Files with missing lines Patch % Lines
backend/src/cms_backend/db/book.py 90.69% 5 Missing and 3 partials ⚠️
backend/src/cms_backend/api/routes/books.py 84.21% 3 Missing ⚠️
backend/src/cms_backend/mill/context.py 0.00% 1 Missing ⚠️
backend/src/cms_backend/shuttle/move_files.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
- Coverage   80.39%   80.19%   -0.21%     
==========================================
  Files          47       47              
  Lines        1974     2065      +91     
  Branches      192      205      +13     
==========================================
+ Hits         1587     1656      +69     
- Misses        334      353      +19     
- Partials       53       56       +3     

☔ View full report in Codecov by Sentry.
📢 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 March 10, 2026 04:14
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.

Allow to move and delete books manually

1 participant