Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add ability to clean library #199

Merged
merged 9 commits into from
Nov 26, 2023
Merged

✨ Add ability to clean library #199

merged 9 commits into from
Nov 26, 2023

Conversation

aaronleopold
Copy link
Collaborator

@aaronleopold aaronleopold commented Nov 24, 2023

Relates to #195

Cleaning a library does the following:

  1. Delete any media that are not READY, e.g. missing from disk. This should cascade delete things like read progress etc.
  2. Delete any series that are not READY, e.g. missing from disk, or that are empty, i.e. no media left
  3. Return a flag indicating if the library is empty, i.e. no series with media left

This is done within a single transaction, so technically has the potential to timeout if the library cleaning requirement is excessively large (e.g. there are something like 5k+ books that need to be deleted at once along with all the cascading and their series etc). Because of this, it might be good in the future if people hit this to batch.

The media is queried for twice since delete_many returns affected row count and not records themselves:

  • Once to grab the IDs, so we can clean up thumbnails
  • Twice to do the deletion

I also fixed a few UI things, like non-scrolling SideBar on mobile and oddities with the refreshed entity card variants

Update main with latest develop
Also added some associated user permission strings
Cleaning a library will hard-delete entities that are not in a READY state, e.g. missing from disk
@aaronleopold aaronleopold merged commit c0bfde7 into develop Nov 26, 2023
7 checks passed
@aaronleopold aaronleopold deleted the al/clean-library branch November 26, 2023 16:23
JMicheli pushed a commit to JMicheli/stump that referenced this pull request Dec 4, 2023
JMicheli pushed a commit to JMicheli/stump that referenced this pull request Dec 8, 2023
@aaronleopold aaronleopold mentioned this pull request Feb 18, 2024
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.

1 participant