View Single Post
Old 10-25-2010, 10:50 AM   #85
Gary_M_Mugford
Groupie
Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.
 
Gary_M_Mugford's Avatar
 
Posts: 176
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
Quote:
Originally Posted by chaley View Post
No, not a bug, and no, you can't count on it.

The order of individual tags in tags fields is not defined. My suspicion is that the order is the order of initial creation, but I haven't taken the time to verify the supposition. However, being undefined means that the order can be considered accidental, and could change.

In your case, what you are seeing as the 'last' tag is really the first. The different views arise because calibre sorts the tags when they are displayed on the library view.

If you want the first two letters of each tag, try
{tags:re( *(.[^\,]?)[^\,]*?((\,)|$),\1\2)}
If you also want the isempty part, then you will need to create a composite column containing the above :re, then apply the isempty test to that column.
Charles,

Hmmmm. Interesting. Since I use so few tags and I tend to put them in basically in the order they naturally occur, I could also very much live with first-in as the default single tag to shorten. In fact, I'd VERY MUCH like that to be the default case.

What I'm doing, of course, is to cheat and not use categories on the Kindle. I don't have the desire nor the time to handle categories as per Kindle's methodology. But I wouldn't mind the books being sorted BY category (i.e. tag). So I am going to use the 'current' behaviour until it changes. The template I am using for the plugboard is:

Code:
[{#genre:}] {#stripped_series:lookup(.\s,#initials,.,#shortened,series){series_index:|-|-}{title}
And yeah, I'm willing to accept not having leading zeroes in the index. Since I delete books as I read them, I tend not to have xxxx10 and xxxx9 in that order for too long. Just a personal preference.

Last aside, using this, it was interesting to see that I had not tagged a couple of humourous biographies as such. Sooo, I ended up with both a Stephen Fry bio and Anna Gurwitch's Fired being listed as SF. I was able to correct both post-haste and re-export to the Kindle.

At any rate, I will be happy with the current state of the plugboard until the behaviour for genre creation changes. In the meantime, thanks so very much for your efforts.

GM

EDIT: I just noticed something taking a quick re-read. I copied and pasted the plugboard template into this post. It doesn't have a space before the last d in shortened in the template. Yet, when I pasted it here, there WAS a space. And now I remember that was the case with a couple of other posts with code in them. In my editor here, it took two lines in the editor and NOW I wonder if the space was inserted there to break up the code. At any rate, might be worth being on the lookout for. I have corrected the code to remove the inserted space. Or, at least I tried. Still seems to be there. By the way, message #78 has the same issue. Solved by pasting it into code wrapper. Live and learn.

Last edited by Gary_M_Mugford; 10-25-2010 at 11:13 AM.
Gary_M_Mugford is offline   Reply With Quote