You can do all that with calibredb. Use calibredb search to get the ids of all unread books, with whatever other criteria you need. Have your script pick a random one from that list.
You can also do that in the calibre GUI. Create a Virtual library to show your unread books (virtual libraries are based on arbitrary search expressions). Then the pickk a random book feature will pick a book from that virtual library.
|