Quote:
Originally Posted by compurandom
I'm looking for a more selective selection.
Something like given this search and sort, select variations of: - The first 10 items
- The 10 items after an offset
- a random 10 items
- everything except the first 10 items
|
You can write a custom action that does what you want. To select books based on book_ids you can use:
Code:
books_ids = [1,2,3]
gui.library_view.select_rows(book_ids)
To get the currently selected books ids:
Code:
rows = gui.current_view().selectionModel().selectedRows()
book_ids = [ gui.library_view.model().db.id(row.row()) for row in rows ]
To get the book_ids for the first 10 books in the current library view:
Code:
book_ids = [gui.library_view.model().id(x) for x in range(0, 10)]