Did not find any issues regarding this. Please close this if this is a duplicate.
If a directory/term is deleted, all the images become unreachable via Drupal Media view (/admin/content/media). Tested with Media Directories UI.
Digging the database reveals that the reference is not deleted from the media.
Add a process to go through the media items having the deleted directory/term ID in database table `media_field_data` column `directory` and set this value to `NULL` when taxonomy term/directory is deleted.
Active
2.2
Code