Theoretically it sounds good, but...
- Assumes no typographical errors occur within the database or files.
- Assumes metadata is available, included and accurate.
- Comparing (imported) filenames pre-supposes that everyone is using the same book-naming system. Post import filenames will work.
- A hash cannot work if based on the file contents. Way too many variations between ebook formats, let alone someone editing a personal copy.
Despite that it might work. At least enough to bring things to the user's attention for further review. Now the only question becomes whether it is feasible to implement and use. It would seriously impair importing large libraries.
There would need to be some way to turn this off. Someone may have and want multiple copies of the same book for various reasons.