Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 12-26-2010, 10:19 AM   #106
Maggie-Me
Zealot
Maggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with othersMaggie-Me plays well with others
 
Maggie-Me's Avatar
 
Posts: 142
Karma: 2594
Join Date: May 2009
Device: Kindle PW,Sony 700, Sony 950 (Daily Edition),Nook Color,iPad
ah.. fantastic, that is where I thought but wanted to be sure, you have made my day...
Maggie-Me is offline   Reply With Quote
Old 12-29-2010, 12:12 PM   #107
MrTissues
Junior Member
MrTissues began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Dec 2010
Device: Kindle 3
This plugboard feature is very nice. The only problem I have found is that when emailing my Kindle the name is unchanged. It only will do it if you transfer via USB.

Is there any way to enable this for both conversions?
MrTissues is offline   Reply With Quote
 
Enthusiast
Old 01-03-2011, 10:52 AM   #108
ibigfire
Junior Member
ibigfire began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Unhappy

I am officially going insane. I know I'm missing something simple, but after reading this forum and the online manual I cannot for the life of me figure out what I'm doing wrong.

I have a custom column named Genre. The lookup/search name is "#genre". In both the plugin and the sending books to devices I have it set as
Code:
{#genre}/{authors} - {series_index}.{series} - {title}
The "{authors} - {series_index}.{series} - {title}" part works great, seemingly, but the #genre folder becomes simply a folder named #genre with all the books in it. Why won't it take the few different genres I've set in the column and use those as different folder names for the different books?

I've stayed up much too late trying to figure this out, so I'm headed to bed, but any help you can give would be much appreciated in the morning. Goodnight.

Last edited by ibigfire; 01-03-2011 at 08:48 PM.
ibigfire is offline   Reply With Quote
Old 01-03-2011, 11:27 AM   #109
chaley
"chaley", not "charley"
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: 4,686
Karma: 764832
Join Date: Jan 2010
Location: France
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
What version of calibre are you running? Custom columns have been around longer than they were supported in templates. I don't remember the version where template support came in, but I think it was around 0.7.20.
chaley is offline   Reply With Quote
Old 01-03-2011, 05:24 PM   #110
stevehaley
Junior Member
stevehaley began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
Many thanks to all who have lead the way on this - I thought I would add my two-pennyworth and findings.

My problem was the normal kindle/series/collection title format problem but I wasnt happy that any one derived format fixed the problem as I could see having collections with one series where just the series number would be ok and others with more than one where I would want to show the series name or a shortened version of this as well.

To implement this flexible solution I created 3 custom columns:-
1) A format picker allowing me to decide which style I want for the particular book. I ended up with
a) Full Series name and series no + title
b) Alt series name (see 2) + number + title
c) Shortened series name as per earlier examples + no + title
d) Series No only + title
e) title only
column lookup name = kindle_title_fmt
column type = Text with fixed list of values
values = Series and Num,Alt and Num,Short and Num,Num only,No Series info

2) A column for an alternative series name if the shortened or full didnt suit
column lookup name = alt_series_name
column type = text

3) An output column showing the final book name as it will appear in the kindle and it is this one that contains all the code.
column lookup name = kindle_title
column type = column built from other columns
column code:-

Code:
program:
stripped = re(field('series'), '^(A|The|An)\s+', '');
shortened = shorten(stripped, 4, '-' ,4);
initials = re(stripped, '[^\w]*(\w?)[^\s]+(\s|$)', '\1');
s_index = template('{series_index:0>2.0f}');
abrv=strcat(
            switch( stripped,
                    '.\s', initials,
                    '.', shortened,
                    field('series')),
            test(s_index, strcat(' ', s_index, ': '), ''),
            field('title'));

str_title1 = template('{series}{series_index:0>2.0f| |: }{title}');
str_title2 = template('{#alt_series_name}{series_index:0>2.0f| |: }{title}');
str_title3 = abrv;
str_title4 = template('{series_index:0>2.0f| |: }{title}');
str_title5 = template('{title}');
str_default = str_title5;
str_input = lowercase(field('#kindle_title_fmt'));

switch(str_input,
           'series and num',str_title1,
           'alt and num',str_title2,
           'short and num',str_title3,
           'num only',str_title4,
           'no series info',str_title5,
           str_default);
Last step is simply to create a new plugboard for the kindle 2 which points title at {#kindle_title}

Personally I would also recomend changing the filename fmt in the kindle 2 plugin to include the series to make it easier if you are using the kindle collection manager

You can change the default simply by re-pointing str_default at one of the other title fmts


Learning notes:-
1) It wasnt immediately obvious to me despite being reasonably documented that you reference custom columns by sticking a '#' on the front of the name. Probably because none of the code examples showed it and I hate reading words as opposed to example code.
2) the switch command is incorrectly documented (missing the switch field) - I have raised a bug for this.
3) Was easiest to just put any old text into the 3rd column when creating it then use the f2 edit later to put the actual code in.

People should be able to easily modify the above to produce their own flexible solutions and it also neatly shows how to use custom columns - hope this helps someone
rgds
Stephen

Note this is my first attempt at the calibre mods/programming and I am sure someone will come up with a better cleaner solution. The code could certainly be better.
Serious props to those that created and maintain calibre
stevehaley is offline   Reply With Quote
Old 01-03-2011, 08:08 PM   #111
ibigfire
Junior Member
ibigfire began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Quote:
Originally Posted by chaley View Post
What version of calibre are you running?
0.7.37

At some point last night I figured there might be a bug so I updated. It didn't help unfortunately.

Just to confirm I'm doing things right, I've attached a picture of what I think is all the pertinent information.

Also, very impressive job, stevehaley.
Attached Thumbnails
Click image for larger version

Name:	temp.png
Views:	105
Size:	147.6 KB
ID:	64066  
ibigfire is offline   Reply With Quote
Old 01-03-2011, 08:27 PM   #112
stevehaley
Junior Member
stevehaley began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
Quote:
Originally Posted by ibigfire View Post
I have a custom column named Genre. The lookup/search name is "#genre#. In both the plugin and the sending books to devices I have it set as
Stupid question but what exactly have you put in the lookup name field?
is it '#genre#' or 'genre' (ignore quotes) - it should be the latter.
You add the # elsewhere at the start to reference the field as it is custom.

ie elsewhere it will always be {#genre}

also I suspect it is all case sensitive - you have {#Genre} there not {#genre}


I think .....
stevehaley is offline   Reply With Quote
Old 01-03-2011, 08:58 PM   #113
ibigfire
Junior Member
ibigfire began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Quote:
Originally Posted by stevehaley View Post
Stupid question but what exactly have you put in the lookup name field?
is it '#genre#' or 'genre' (ignore quotes) - it should be the latter.
You add the # elsewhere at the start to reference the field as it is custom.

ie elsewhere it will always be {#genre}

also I suspect it is all case sensitive - you have {#Genre} there not {#genre}
Ah, yeah, sorry. That was just a late night typo. I have just the word "genre" in the lookup name field.

I tried both the lowercase {genre} and the uppercase, but due to it remembering that I tried uppercase it won't stop automatically filling it in as uppercase because it remembers it as a previous template. Even if I forcefully get it to be a lowercase 'g' when I hit Apply and go back into it to check it, it's turned itself uppercase again. Super annoying, but I figure the plugin settings override the general preferences settings anyways, I think, so it shouldn't be stopping it from working.
Attached Thumbnails
Click image for larger version

Name:	temp2.png
Views:	82
Size:	38.6 KB
ID:	64067  
ibigfire is offline   Reply With Quote
Old 01-03-2011, 10:13 PM   #114
stevehaley
Junior Member
stevehaley began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
Quote:
Originally Posted by ibigfire View Post
Even if I forcefully get it to be a lowercase 'g' when I hit Apply and go back into it to check it, it's turned itself uppercase again. Super annoying, but I figure the plugin settings override the general preferences settings anyways, I think, so it shouldn't be stopping it from working.
Got me - If it were me I would try changing the name to cgengre or similar - maybe genre is a reserved field or something - the fact it upercases is worrying
stevehaley is offline   Reply With Quote
Old 01-03-2011, 10:37 PM   #115
ibigfire
Junior Member
ibigfire began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Quote:
Originally Posted by stevehaley View Post
Got me - If it were me I would try changing the name to cgengre or similar - maybe genre is a reserved field or something - the fact it upercases is worrying
We think alike, apparently. I tried changing it to "type" at one point. It really seems like it should be working...
ibigfire is offline   Reply With Quote
Old 01-04-2011, 03:34 AM   #116
chaley
"chaley", not "charley"
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: 4,686
Karma: 764832
Join Date: Jan 2010
Location: France
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
Thanks for sharing this.

A note on your notes:
Quote:
Originally Posted by stevehaley View Post
Learning notes:-
2) the switch command is incorrectly documented (missing the switch field) - I have raised a bug for this.
It is documented correctly. Switch and several other functions are used in single-function mode, and they do not have the field parameter. It is implied. When these functions are used in template program mode or general program mode, the parameter is required. The documentation says this, but in text. I have made changes that I hope makes the text clearer.

Also, I found a problem yesterday with general program mode composite columns used in plugboards/templates. The program itself was substituted, not the evaluation of the program. Have you verified that your plugboard {#kindle_title} puts the values you expect into the book?

I fixed the problem. It will be available in the next release. A workaround is to use general program mode in the plugboard, in your case
program:field(#isbn)
chaley is offline   Reply With Quote
Old 01-04-2011, 04:13 AM   #117
chaley
"chaley", not "charley"
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: 4,686
Karma: 764832
Join Date: Jan 2010
Location: France
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
Quote:
Originally Posted by ibigfire View Post
We think alike, apparently. I tried changing it to "type" at one point. It really seems like it should be working...
Responding to the last several posts:

1) The column heading can be whatever you want.
2) The lookup name must be lower case. You prefix this name with a '#' to use the column. In your case, #genre.
3) I agree, the history can get annoying. I will look at fixing this by making the completion case sensitive. In this case, work around it by putting an extra space before the first slash. Calibre will remove that extra space later. Your assumption is correct: the plugin value takes precedence over the general one.
chaley is offline   Reply With Quote
Old 01-04-2011, 04:21 AM   #118
chaley
"chaley", not "charley"
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: 4,686
Karma: 764832
Join Date: Jan 2010
Location: France
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
Quote:
Originally Posted by ibigfire View Post
I have a custom column named Genre. The lookup/search name is "#genre". In both the plugin and the sending books to devices I have it set as
Code:
{#genre}/{authors} - {series_index}.{series} - {title}
I think I know what is going on here. By any chance, is the type of the #genre column 'comma separated, like tags'? There is a bug that I just found: this type of column doesn't work in save templates. In effect, calibre doesn't know what to do with the possibility of multiple values. I will fix it. Should be in the next release (within a week or so).

Workaround: (removed. It doesn't work. )

Last edited by chaley; 01-04-2011 at 06:21 AM. Reason: remove workaround
chaley is offline   Reply With Quote
Old 01-04-2011, 05:12 AM   #119
ibigfire
Junior Member
ibigfire began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Thumbs up

Quote:
Originally Posted by chaley View Post
I think I know what is going on here. By any chance, is the type of the #genre column 'comma separated, like tags'? There is a bug (that I just found), and this type of column doesn't work in save templates. In effect, it doesn't know what to do with the possibility of multiple values. I will fix it. Should be in the next release (within a week or so).

Workaround: create another custom column of type 'column made from other columns. Put {#genre} as its template. Use this new column in your device template. This works because the new column will 'flatten' the (possibly) multiple values back to a single value, avoiding triggering the problem.
Yes, the column type is that comma separated one. Awesome to hear that you found the bug and figured out how to squash it already. You do good work!

The workaround doesn't seem to work; it still makes a folder named #genre and puts all the books into it, but it's definitely referencing the Genre column correctly, because it put all the info from Genre into it's own column (named Type) properly, and it's naming the folder on my Kindle #genre, not #type, even though I made sure that {#type} is both in the general preferences spot and the plugin preferences spot.

But I'm not worried, if doing it the proper way will work within a few weeks or sooner than that's good enough for me. The organization will be nice for the future but I can still find and read specific books for now just fine so I'm in no rush.

Thank you so much Chaley, you're friggin' awesome! I also really appreciate your aide too, stevehaley, both of you are great.
ibigfire is offline   Reply With Quote
Old 01-04-2011, 05:19 AM   #120
chaley
"chaley", not "charley"
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: 4,686
Karma: 764832
Join Date: Jan 2010
Location: France
Device: PRS-300, Galaxy Nexus, Nexus 7, HTC Sensation, Galaxy Tab 10.1
Quote:
Originally Posted by ibigfire View Post
The workaround doesn't seem to work; it still makes a folder named #genre and puts all the books into it
Shows what happens when I type without thinking something all the way through. The #type composite column would be re-evaluated in the context of save-to-disk/device, which means it would trigger the same bug. Sorry about the red herring.
Quote:
But I'm not worried, if doing it the proper way will work within a few weeks or sooner than that's good enough for me.
It should arrive within that time frame. And I even tested it.
Quote:
Thank you so much Chaley, you're friggin' awesome! I also really appreciate your aide too, stevehaley, both of you are great.
Thanks for the kind words.
chaley is offline   Reply With Quote
Reply

Tags
custom column

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 06:13 PM.


MobileRead.com is a privately owned, operated and funded community.