database2.py deletion notifications
Is the notify=True argument on the majority of functions in database2.py historical code, for future usage, or just selectively used?
I wanted to get notifications about rows being deleted in my plugin so that I could update some id mapping caches I maintain. However I see that while all the infrastructure is there, the call to delete_book sets notify=False. Further searches revealed only one call to add_event_listener in the codebase, and that was in tag_viewer.py which responded to any notification it might receive.
In the end I chose an approach of db.data.has_id() when I retrieve an id from my cache to verify it is still valid and remove it if not. Anything else I could/should have done instead?
|