+ # remove pdcounter stuff
+ book_titles = set(match.pretty_title().lower() for match in result
+ if isinstance(match, models.Book))
+ authors = set(match.name.lower() for match in result
+ if isinstance(match, models.Tag) and match.category=='author')
+ result = tuple(res for res in result if not (
+ (isinstance(res, pdcounter_models.BookStub) and res.pretty_title().lower() in book_titles)
+ or (isinstance(res, pdcounter_models.Author) and res.name.lower() in authors)
+ ))
+