03-11-2015, 11:58 PM | #46 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Yes, that would be the basic idea behind any solution. The only real improvement would be a way to automatedly add that value, which would require a full database context and thus a calibre-debug script.
Example here (this is much the same concept, though it accomplishes a different goal): https://www.mobileread.com/forums/sho...&postcount=631 instead of in_list() you could use for readability (triggers when the column is non-empty): Code:
various_authors=test( field('#serie'), '', strcat(' - ', field('authors')) ); |
03-12-2015, 01:06 AM | #47 | ||
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
Quote:
Quote:
Advantage is that it does not messes the opf file with thousand of """ strings up, seams all Custom Column do that. Also when deleting the Content of a "custom column" the Costum Colum metatag itself does not get deleted in the opf file, very messy I see also that Calibre does not seam to use epub 3 DC tags. "DC: type" tag - the content would be related to my goal. Should work for templates even the books are epub 2. Any chance to get this into the Tag-Editor in Calibre? Last edited by Thomas_AR; 03-12-2015 at 01:15 AM. |
||
Advert | |
|
03-12-2015, 01:21 AM | #48 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Makes sense then.
As far as DC tags go -- custom columns are quite nonstandard as you saw, they need to define both content and parsing rules in the OPF. Using meta tags is I suspect deliberate. Perhaps an identifiers type builtin column for storing DC metadata can be created. Theoretically. Kovid would have to decide it is worth it (and change always needs consideration). What can you do with DC tags that you cannot do currently? |
03-12-2015, 01:34 AM | #49 |
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
Well, anyway for now i think i am happy with the last solution - thanks for your help, much appreciated.
Perhaps in the future Kovid considers to add some epub 3 DC tags. There are some interesting DC tags like: type, collection, etc. Could give some opportunities i think like separating information. But you are right, there is nothing more we can do with or without new epub 3 DC tags, just a stylish advantage, not needing customs columns and not messing up the opf file. Thanks again. Thomas Last edited by Thomas_AR; 03-12-2015 at 01:39 AM. |
03-12-2015, 01:43 AM | #50 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Sure.
|
Advert | |
|
03-12-2015, 03:33 AM | #51 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You should use Code:
program: # return separator+authors if no Multi Autor Serie (MAS) is found, or return empty various_authors=str_in_list( field('tags'), ',', 'MAS', '', strcat(' - ', field('authors')) ); [...] |
|
03-12-2015, 07:45 PM | #52 |
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
Yes "MAS" could resolve in finding other tags which contains those three letters, i will choose some more unique
Thanks for the hint with the separator. learning every day. |
03-13-2015, 09:53 AM | #53 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If you use str_in_list then it is looking for an exact match for the string, not a regular expression match as found in in_list. You wouldn't need to worry about MAS also matching MASTER or NAMASTE.
|
03-13-2015, 05:17 PM | #54 |
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
|
03-13-2015, 05:34 PM | #55 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Hah, I originally used in_list() because you implied that "Perry Rhodan" was a part of each affected series.
Lots more good information and useful functions listed in the manual (and built into the template dialog box) -- when you get a spare moment (and assuming you intend to master the use of templates) I suggest you take a look-see through them. I don't remember half of them except well enough to know -- usually -- that "there should be something vaguely capable of doing x, let me look that up". |
03-13-2015, 06:25 PM | #56 | |
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
Quote:
So at the end i am using: Code:
program: # return separator+authors if Multi Autor Serie (MAS) is not found, or return empty various_authors=str_in_list( field('tags'), ',', 'MAS', '', strcat(' - ', field('authors')) ); end_template=template('{series_index:0>4s| | - }{title} - {authors}'); start_template=test( field('series'), strcat( '_ ', field('series'), various_authors ), field('authors') ); strcat(start_template, '/', end_template); When MAS is found in Tags i like to have 0>4s (those series go app to 2000 books), but not in the other series (mostly they end at 20 at the most). Also there are some series with series indices with sub values 1.5, 2.0, 2.5 etc and those series are never bigger than 20 books. So if MAS in Tags is not found i would like to have a series index with 0>4.2f or 0>4.1f, if found 0>4 Possible or a better solution? Last edited by Thomas_AR; 03-13-2015 at 06:37 PM. |
|
03-13-2015, 06:35 PM | #57 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Try:
Code:
program: # return separator+authors if Multi Autor Serie (MAS) is not found, or return empty various_authors=str_in_list( field('tags'), ',', 'MAS', '', strcat(' - ', field('authors')) ); sindex=str_in_list( field('tags'), ',', 'MAS', finish_formatting(field('series_index'), '0>5.2f', ' ', ' - '), finish_formatting(field('series_index'), '0>4s', ' ', ' - ') ); start_template=test( field('series'), strcat( '_ ', field('series'), various_authors ), field('authors') ); strcat(start_template, '/', sindex, field('title'), ' - ', field('authors')); Last edited by eschwartz; 03-13-2015 at 06:38 PM. |
03-13-2015, 06:52 PM | #58 |
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
This is strangely not working.
I got for Series with NO "MAS" Tag and series index " 1, 2, 2.5, 3, 4 files as followed: 0001 0002 0003 0004 2.50 and in the tester i get the message in the checker: The template contains no {fields}, so books will have all the same name. Last edited by Thomas_AR; 03-13-2015 at 10:48 PM. |
03-13-2015, 08:25 PM | #59 | |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I found me a chart and recoded series by cycle [in cycle index] Perry Rhodan.Pobis[1] |
|
03-13-2015, 09:26 PM | #60 | ||
Zealot
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
|
Quote:
I thought about doing so with Custom columns, but it messes the opf ile up like hell Quote:
|
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Send to device - Template help | Snow Sciles | Library Management | 12 | 05-26-2014 05:16 PM |
Generic "Sending to Device" template not kicking in on Folder Device | At_Libitum | Library Management | 2 | 11-01-2013 07:12 AM |
Save to Device template | HFC3 | Library Management | 6 | 07-08-2013 11:48 AM |
Save template for sending books to Kindle 3 | Eaglebeak60 | Devices | 2 | 02-14-2011 06:12 PM |
Send to device template | rockeh | Calibre | 6 | 08-17-2010 05:28 PM |