Delete any media that are not READY, e.g. missing from disk. This should cascade delete things like read progress etc.
Delete any series that are not READY, e.g. missing from disk, or that are empty, i.e. no media left
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
Relates to https://github.com/stumpapp/stump/issues/195
Cleaning a library does the following:
READY
, e.g. missing from disk. This should cascade delete things like read progress etc.READY
, e.g. missing from disk, or that are empty, i.e. no media leftThis 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:I also fixed a few UI things, like non-scrolling SideBar on mobile and oddities with the refreshed entity card variants