View Single Post
Old 12-13-2015, 06:19 AM   #1021
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Terisa de morgan View Post
I've tested it and it works for me. For avoiding empty columns I've used the same trick that I use at jacket (kovid told me so when I asked about the same problem:

Code:
 <div style="display:{_vts}"><b>Series 3:</b> {_tse}</div>
With _vts a custom_column with value 'None' if _tse is empty.
That's a good trick. But, it means for every column that you need to do this for, you need a second indicator column. Plus the extra non-display text is going to make the database a bit bigger.

At the moment, I'm looking at other templates. I started with the jacket because it was the close to what I wanted. I found I couldn't use this directly and pulled out code and simplified. That's what I posted last night. A relatively simple template based on the jacket.

Today, I've been looking at the metadata plugboard. Calling that to do the substitution turned out to be simple. But, the template is probably no simpler. To do what I did last night, I have:
Code:
{comments}{tags:|<p>Tags: |</p>}{rating:|<p>Rating: |</p>}{#kobo_last_read:|<p>Last Read: |</p>}{#words:|<p>Word count: |</p>}
That produces what I thinking about. But, I'm not sure if it is better than the other template. I think the first version is simpler to create. This version a lot more flexible.
Quote:
And I know I'm greedy but... in the same way you send the series when you update metadata, could you send the comments if 'use template' is activated?
Yes, it's about time to revisit the driver and metadata. But first I'll put this out in the Utilities.

My thoughts on this metadata update function in the utilities plugin are:
- Decide on the template. Or prevaricate and somehow support both.
- Add an option to not to update downloaded kepubs. I should have done this ages ago.
- Read the template from the root of the device. If there isn't one there, look in the resources directory of the calibre configuration directory. This allows different configuration for different devices. And that would be handy for people who share a calibre installation.
- Maybe put the updates into a job. If I do this, I would consider adding an option to run this automatically on connect.

Once I have this out, I'll start looking at the driver again It should be updating the metadata at the same time as the series info. Part of why I haven't done it is performance. No matter how I do it, it's going to add some time to the initial connection jobs. Adding the comments template might be a bit trickier as the driver code is separate from the Utilities plugin. But, I'll think about it.
davidfor is offline