Quote:
Originally Posted by stregone
I got the plugin setup and made a reading list, and configured it and calibre to add the books to a collection on my kobo. Is there any way to sort my kobo collection (on the device) in the order of the reading list? I have the reading order column set up. While reading up on getting this plugin setup I thought I saw something about automatically editing the 'date added' to allow for a 'custom sort' of a sort (haha puns) on the device, but I can't find that again. Any thoughts?
|
Not sure this is suitable for you. But a possible solution is to use a plugboard to prepend the reading list index to the title. But for that you need a custom template function:
Code:
def evaluate(self, formatter, kwargs, mi, locals, list_name):
from calibre.gui2.ui import get_gui
gui = get_gui()
rl_plugin = gui.iactions.get('Reading List')
if rl_plugin:
book_ids = rl_plugin.get_book_list(list_name)
try:
return '{:03d}'.format(book_ids.index(mi.id) + 1)
except ValueError:
return ''
else:
return ''
To add the template function above to calibre:
- Go to Preferences > template functions > template functions tab > copy/paste the code above in the program code box
- In the Function textbox give the functions its name: reading_list_index
- Argument count = 1
- Press the "Create" button
Now you can use this function in a template:
Code:
program:
idx = reading_list_index('Default');
if idx then idx & ' - ' & $title else $title fi
The above template prepends the reading list index to the title. Replace
Default with the your reading list name. Also note this function only works in GPM mode as in the example above.
Note: This template function pads the index with zeros to ensure the sorting will be OK.