I know your solution is working but I think it might be a time consuming query , too many relationships . I suggest you another solution :
- add a new field to users account (type : term reference and link it to your taxonomy vocabulary , I named it Favorite Genre)
- Hide it from users using Field Permissions module
- Install Rules module
- Enable flag actions sub-module
- go to Rules and add new rule , event = A node has been flagged, under "your content type"
- add an action , add an item to a list (we want to add the books genre to user's favorite)
- item to be added is the flaged-node->book_catagory and that must be added to user-flagged-favorite_genre
by now when a user bookmark a book the book genre will be added to his/her favorite genre. the benefit is that there is no need for more querying to find this out.
now go to views add a relation based on user , and you can filter books based on user's favorite genre.
be careful : maybe you do a trick on unbookmark , and remove the book genre from his list , this would be make mistake cause maybe user have other books with this genre . in this case you need to make a loop based on user's bookmarked books and check their genres , if there were no book with that genre then you can remove that genre from user's favorite .
more details about Rules module here.