+ if lang and r.book.language != lang:
+ return False
+ if only_audio and not r.book.has_mp3_file():
+ return False
+ if only_synchro and not r.book.has_daisy_file():
+ return False
+ if epoch and not r.book.tags.filter(category='epoch', slug=epoch).exists():
+ return False
+ if kind and not r.book.tags.filter(category='kind', slug=kind).exists():
+ return False
+ if genre and not r.book.tags.filter(category='genre', slug=genre).exists():
+ return False
+
+ return True
+
+ results = [r for r in results if ensure_exists(r)]