View Single Post
Old 03-09-2019, 12:01 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,440
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote