View Single Post
Old 10-25-2010, 08:45 AM   #82
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Gary_M_Mugford View Post
Ultimately, I LIKE the overall result of the last tag being the one that is used. But can I count on that behaviour going forward, as it would seem to be a sort of bug?
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.
chaley is offline   Reply With Quote