You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New MediaUsageRegistry singleton: any module registers a check from its service provider's boot() and returns a human-readable reason when a file must not be deleted. The media module stays free of knowledge about who uses its files.
The guard sits on the Media model (deleting event) and throws MediaInUseException, so every deletion path is covered — library screen, bulk delete, commands, tinker.
The media library deletes the ROW first and the FILE second, and shows the reason instead of refusing silently. Previously a refused deletion could leave a record pointing at a file that was already gone.
A bulk delete removes the free files and keeps the claimed ones selected; a check that throws is reported and falls through instead of making the file undeletable.