|
|
#46 | ||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,746
Karma: 21843110
Join Date: Dec 2008
Location: Krewerd
Device: HTC Flyer; BBMini; Sony PRS650
|
Quote:
__________________
Quote:
|
||
|
|
|
|
|
#47 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,127
Karma: 77366
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
AFAIK, it's only applied when (title) metadata is updated, thus, you'd have to edit every title field without changing it or something like that.
__________________
I reject your reality and substitute my own. |
|
|
|
|
Enthusiast
|
|
|
|
#48 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,746
Karma: 21843110
Join Date: Dec 2008
Location: Krewerd
Device: HTC Flyer; BBMini; Sony PRS650
|
Question:
I have a yes/no/unknown custom column ({#read}). I want to use this column in a collection. But simplying adding {#read} doesn't work, as I'll get a collection "Yes" and "No". Which doesn't make any sense, naturally. So, I'd like to make a new custom column {#collection_read} which will transform the "Yes", "No" and "" into a value with actual visible meaning But {#column:switch(Yes, Read, No, Reading, Unread)} doesn't work... It'll give me either "Read" or "Unread", the "Reading" is never shown...
__________________
Quote:
|
|
|
|
|
|
|
#49 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
Quote:
Try{#column:switch(Yes,Read,No,Reading,Unread)}
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
||
|
|
|
|
|
#50 | ||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,746
Karma: 21843110
Join Date: Dec 2008
Location: Krewerd
Device: HTC Flyer; BBMini; Sony PRS650
|
Never tried the spaces! I'm not used to having spaces actually meaning anything ![]() Quote:
Nope, I didn't change any naming rules and I got a nice category "Yes"...
__________________
Quote:
|
||
|
|
|
|
|
#51 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
Quote:
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
||
|
|
|
|
|
#52 | |
|
Connoisseur
![]() ![]() ![]() Posts: 79
Karma: 274
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
Thanks for providing me with the initialism code. Very much appreciated. GM EDIT: Guess I'm not much of a programmer. Had spaces>0 originally. The pseudocode should be if spaces=0 then shorten else regex. Not that it matters, since Charles is going above and beyond. Looking forward to next week's release, afterwhich I will be making the composite columns outlined below end enjoying the best of all worlds. Last edited by Gary_M_Mugford; 10-20-2010 at 01:08 AM. |
|
|
|
|
|
|
#53 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,278
Karma: 12727566
Join Date: Apr 2010
Device: sony PRS-600, PRS-350, PRS-T1, Tablet
|
Quote:
Meg Langslow Mysteries - ... Donna Andrews becomes Meg Langslow Mysteries - 03 - Revenge of the Wrought-Iron Flamingos No author but I have the collections by author so I can still see the author on the line above. Helen |
|
|
|
|
|
|
#54 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
First, while working through this example I found that my implementation of the lookup function wasn't optimal. It suffered from the same problems that sweetpea found with test etc. I changed lookup, and the changes will appear in the next release (tomorrow, possibly). The examples uses the new functionality, so they won't work at home until release/upgrade. OK, how to do it. The full solution requires creating three composite columns. The first column is used to remove the leading articles. The second is used to compute the 'shorten' form. The third is to compute the 'initials' form. Once you have these columns, the plugboard selects between them. First column: Code:
Name: #stripped_series. Template: {series:re(^(A|The|An)\s+,)||}
Code:
Name: #shortened. Template: {#stripped_series:shorten(4,-,4)}
Code:
Name: #initials. Template: {#stripped_series:re(([^\s])[^\s]+(\s|$),\1)}
Code:
Template:{#composite:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title}
Destination field: title
Series: The Lord of the Rings Series index: 2 Title: The Two Towers Output: LotR [02] The Two Towers Series: Dahak Series index: 1 Title: Mutineers Moon Output: Dahak [01] Mutineers Moon Series: Berserkers Series Index: 4 Title: Berserker Throne Output: Bers-kers [04] Berserker Throne Series: Meg Langslow Mysteries Series Index: 3 Title: Revenge of the Wrought-Iron Flamingos Output: MLM [03] Revenge of the Wrought-Iron Flamingos Of course, the plugboard template can easily be changed to require 2, 3, or however-many-you-want spaces before initials are used. For example, the following checks for 3 spaces. Plugboard expression: Code:
Template:{#composite:lookup(\s.*\s.*\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title}
Destination field: title
Series: Meg Langslow Mysteries Series Index: 3 Title: Revenge of the Wrought-Iron Flamingos Output: Meg -ries [03] Revenge of the Wrought-Iron Flamingos All the others would remain the same.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre Last edited by chaley; 10-17-2010 at 04:22 PM. Reason: Fix wrong names in template |
|
|
|
|
|
|
#55 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,278
Karma: 12727566
Join Date: Apr 2010
Device: sony PRS-600, PRS-350, PRS-T1, Tablet
|
So once again I am really confused. My post was informational (I thought) in that the kindle 3 will display a pretty comprehensive title on more than one line if you leave the cursor on it. (kindle cursor when browsing kindle) I have actually got it all quite reasoable in my mind at least on my mother's kindle.
Not that the Kindle agrees with me of course but I shall persevere. Or give my mother my Sony if she likes that better
|
|
|
|
|
|
#56 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
I hadn't before heard anyone mention that about a kindle.I was responding to the post ahead of yours. I did use your example, because it was handy and the right number of words.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
|
|
#57 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 252
Karma: 59872
Join Date: Dec 2009
Location: New York, USA
Device: Kindle 3 (wifi) + nokia n900 tablet phone
|
EDIT: Editing out the whole post, I noticed too late I'd only read 3 pages of the thread, not 4 and what I wanted was already being discussed.
Sorry!
__________________
With all of this going on, this enclosure movement of the mind, this locking up of symbols and themes and facts and genes and ideas (and eventually people), why get excited about the patenting of a peanut butter and jelly sandwich? “I just thought that there were limits,” he said; “some things should be sacred.” James Boyle: http://thepublicdomain.org/thepublicdomain1.pdf Last edited by Gwen Morse; 10-17-2010 at 12:10 PM. |
|
|
|
|
|
#58 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,746
Karma: 21843110
Join Date: Dec 2008
Location: Krewerd
Device: HTC Flyer; BBMini; Sony PRS650
|
I finished my save-template for my non-meta-data-reading devices (I've got two).
I had several hurdles to take. First of all: a folder structure. In order to not create one huge list of authors, I wanted to sort my authors in an alphabetic structure. Code:
[A - D]/Adams, Douglas/Hitchhiker's Guide to the Galaxy/01 - The Hitchhiker's Guide to the Galaxy v1.epub Code:
{author_sort:switch(^[A-D],[A - D],^[E-J],[E - J],^[K-O],[K - O],^[P-T],[P - T],^[U-Z],[U - Z],[Other])}
The next part was easier, simply {author_sort} Then {series}, but not all books have series, so, {series:|/|} The next part is a bit more difficult. Let me explain: My books have the following meta-data: Author: Douglas Adams Author Sort: Adams, Douglas Title: HggtG - 01 - The Hitchhiker's Guide to the Galaxy Series: The Hitchhiker's Guide Series Index: 1 The reason why I have the series in the title is simply because I think that series info belongs to the title. But that does make it a bit harder in this case, as I'll need to strip it. {#collection_title} did the job: Code:
{title:re(.*? - .*? - (.*?),\1)}
My final field: {#folder_name}/{author_sort}{series:|/|}/{series_index:0>2s|| - }{#collection_title} - v{#version:ifempty(0)} Now, there's one oddity. When I make a custom column in my Library, with this template, I'll get: Code:
[A - D]/Adams, Douglas/Hitchhiker's Guide to the Galaxy/01 - The Hitchhiker's Guide to the Galaxy v1 Code:
[A - D]/Adams, Douglas/Hitchhiker's Guide to the Galaxy/01 - The Hitchhiker's Guide to the Galaxy v#version.epub there's something weird going on with that #version anyway, as I had it as floating point before. It refused to do anything with it then! Not even in a custom template...
__________________
Quote:
|
|
|
|
|
|
|
#59 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Quote:
I know the text types work, as do series types. Float and int now work (but not released). I need to check the other odd type: date.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
|
|
#60 | ||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,746
Karma: 21843110
Join Date: Dec 2008
Location: Krewerd
Device: HTC Flyer; BBMini; Sony PRS650
|
Quote:
__________________
Quote:
|
||
|
|
|
![]() |
| Tags |
| custom column |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
| Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
| Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
| Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
| Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |