09-05-2013, 07:45 AM | #1 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Multiple 'save to disc' templates?
I'm terrible when it comes to templates, plugboards, etc, so this might be a stupid question, but is it possible to have multiple 'save to disc' templates? I have four 'main' categories of ebooks, and I want them to be saved slightly differently (mainly different folder styles than different info in the names). I've been doing it manually, but it can take forever to get them saved in the right folders, so I was wondering if it was possible to do this via templates?
|
09-05-2013, 11:21 AM | #2 | |
Well trained by Cats
Posts: 29,794
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:
Please post inside [ code] tags, examples of those 4 you want (there is almost always more than 1 way to get it done ), and copies of the existing patterns that you use (you can copy from them from the history pulldown) Also review the features of the Quick Preferences Plugin https://www.mobileread.com/forums/sho...d.php?t=118776, maybe it will help |
|
09-05-2013, 01:59 PM | #3 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Sorry, wrong thread... Ooops!
Last edited by Adoby; 09-05-2013 at 02:02 PM. |
09-06-2013, 07:47 AM | #4 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Quote:
Okay, the four I would like please are: 1. Code:
{#genre}/{#category}/{series}/{title}{series_index:0>4.1f}{authors} 2. Code:
{#genre}/{#sub_genre}/{title}{author} Code:
{#genre}/{#sub_genre}/{series}/{title}{series_index:0>4.1f}{authors} ...and I think that's it actually, so 3 instead of 4! Thank you! |
|
09-06-2013, 10:37 AM | #5 | |
Well trained by Cats
Posts: 29,794
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:
The other is a conditional on series (see the Template language series examples) |
|
09-06-2013, 12:47 PM | #6 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Exactly how do you determine which template to use, and in which priority? If #category is not blank, use #1 no matter what is in #sub_genre? What do you do it both #category and sub_genre are blank? There really are no separators between the title, series indices, and authors?
|
09-08-2013, 04:09 PM | #7 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Quote:
There are 3 categories I tend to use, but #category is never blank. I could use #1 all the time, but I would prefer not to because I want different info available. Some of these ebooks are just study notes and the like, produced by my friends and I because we use them for university, so the distinction would be really useful to have. #category and #sub_genre and always filled, so that isn't an issue. And the examples I gave are just rough ones - I was on my sister's tablet at the time, and I don't know how hers works other than the basics. She's got a weird keyboard she's downloaded from somewhere. I would like separators though please! |
|
09-08-2013, 04:20 PM | #8 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The problem: before anyone can give you the multiple-path template, you must supply the templates and the precise rules for choosing between the templates. The rules can look only at the metadata for the book. The choice specifically cannot depend on human intervention, because the human isn't available inside the computer.
Thus, if you can tell me what metadata should generate which save template, then I can give you a master template that makes the choice. If the choice is made because you know the answer but can't give the rules, then abandon hope all ye who enter here. |
09-08-2013, 05:03 PM | #9 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Quote:
I'll try and make it clearer. After a think, in an ideal world (because I don't know what is possible) I would please like... 1. Folders to go: #category, which contains the #sub_category folders, in which are the corresponding series. If no series exists, then the ebooks should just be in their #sub_category folder. The title of the ebooks to be title - series number (to 2 decimal places) - author ,if the ebook is within a series. If it isn't part of a series, then just title-author. 2. Folders: #genre, to contain the #sub_genre folders. Title of ebook: title-author. 3. Folders: #genre, to contain the #sub_genre folders, each of which contains the relevant 'series' folders. Title: title-series number to 2 decimal places-author Is that better? Or do I need to put anything else? I suppose 2. and 3. are the same thing, only one is for ebooks in a series and the other is for single ebooks. Thank you |
|
09-08-2013, 05:12 PM | #10 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
How do you choose between #1 and #2/3? Is it the value in #category? If so, them could you give some examples? Or is it the value of some other metadata field?
|
09-08-2013, 05:29 PM | #11 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Quote:
The ebooks for 1., however, are those for my post-grad. course e.g. #category = Tort Law and #sub_category = Medical Negligence (or general negligence, nuisances, etc). I really want them keeping separately from my leisure-time reading, or I'll get distracted and then end up reading rather than studying. Thank you, hope this answers your questions |
|
09-08-2013, 05:50 PM | #12 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Taking a guess, the template would look something like
Code:
program: c = field('#category'); template1 = template('{#category}/{#sub_category}/{series}/{title}{series_index:0>4.1f}{authors}'), ''); template2 = template('{#genre}/{#sub_genre}/{series}/{title}{series_index:0>4.1f}{authors}'); first_non_empty( strcmp(c, 'Tort Law', '', template1, ''), strcmp(c, "some other post grad category", '', template1, ''), template2 ) For all the templates, if a value does not exist, it is replaced with nothing. This could leave two slashes adjacent to one another, which will be replaced by the template processor with one slash. Thus, when using template two when there isn't a series, without you doing anything the template effectively becomes Code:
template('{#genre}/{#sub_genre}/title}{authors}'); |
09-09-2013, 12:43 PM | #13 | |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
plugin for favorite save to disk templates | gabby98 | Plugins | 3 | 07-03-2013 01:35 PM |
How and why to save Calibre books to Disc? | polli | Related Tools | 12 | 01-12-2012 10:33 AM |
Can't Save to Disc | MickeyC | Calibre | 2 | 10-16-2011 09:54 AM |
title in save to disc | pcalv | Library Management | 9 | 08-04-2011 07:11 AM |
0.7.1 Save to Disc function fixed? | grizedale | Calibre | 9 | 06-07-2010 04:49 PM |