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 09-05-2013, 07:45 AM   #1
redscarlett
Enthusiast
redscarlett began at the beginning.
 
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?
redscarlett is offline   Reply With Quote
Old 09-05-2013, 11:21 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,763
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by redscarlett View Post
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?
Yes. (At least for 2, it is. I have 2 significantly different file path patterns: On for series and another for non-series and have it switch if it sees series data.)

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
theducks is offline   Reply With Quote
Old 09-05-2013, 01:59 PM   #3
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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.
Adoby is offline   Reply With Quote
Old 09-06-2013, 07:47 AM   #4
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by theducks View Post
Yes. (At least for 2, it is. I have 2 significantly different file path patterns: On for series and another for non-series and have it switch if it sees series data.)

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
Sorry for the late reply - I'm helping my Dad set up his new caravan! :S

Okay, the four I would like please are:

1.
Code:
{#genre}/{#category}/{series}/{title}{series_index:0>4.1f}{authors}
but i would like it to be that, if there is no series, then there is no 'series' sub-folder (if you understand me?)

2.
Code:
 {#genre}/{#sub_genre}/{title}{author}
3.
Code:
{#genre}/{#sub_genre}/{series}/{title}{series_index:0>4.1f}{authors}
Once more, using 'series' only if one exists.

...and I think that's it actually, so 3 instead of 4!

Thank you!
redscarlett is offline   Reply With Quote
Old 09-06-2013, 10:37 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,763
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by redscarlett View Post
Sorry for the late reply - I'm helping my Dad set up his new caravan! :S

Okay, the four I would like please are:

1.
Code:
{#genre}/{#category}/{series}/{title}{series_index:0>4.1f}{authors}
but i would like it to be that, if there is no series, then there is no 'series' sub-folder (if you understand me?)

2.
Code:
 {#genre}/{#sub_genre}/{title}{author}
3.
Code:
{#genre}/{#sub_genre}/{series}/{title}{series_index:0>4.1f}{authors}
Once more, using 'series' only if one exists.

...and I think that's it actually, so 3 instead of 4!

Thank you!
Should be doable, there are really only 2 conditions (#sub_genre and #category). (note: I only code the simple, conditional ones. Help will be along now they can see what you need)

The other is a conditional on series (see the Template language series examples)
theducks is offline   Reply With Quote
Old 09-06-2013, 12:47 PM   #6
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,728
Karma: 6690881
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?
chaley is offline   Reply With Quote
Old 09-08-2013, 04:09 PM   #7
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by chaley View Post
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?
Sorry for the huge delay! Everything that could have gone wrong with my Dad's caravan this weekend didgo wrong!

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!
redscarlett is offline   Reply With Quote
Old 09-08-2013, 04:20 PM   #8
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,728
Karma: 6690881
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.
chaley is offline   Reply With Quote
Old 09-08-2013, 05:03 PM   #9
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by chaley View Post
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.
Sorry - I'm new to this, so I wasn't sure what to/what not to supply.

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
redscarlett is offline   Reply With Quote
Old 09-08-2013, 05:12 PM   #10
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,728
Karma: 6690881
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?
chaley is offline   Reply With Quote
Old 09-08-2013, 05:29 PM   #11
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by chaley View Post
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?
2. and 3. are for fiction and non-fiction - so essentially normal e-books. An example would be #genre = Romance and #sub_genre = Paranormal (or historical, steampunk, etc).

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
redscarlett is offline   Reply With Quote
Old 09-08-2013, 05:50 PM   #12
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,728
Karma: 6690881
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
	)
The first template would be chosen if the category equals "Tort Law" or "some other post grad category". You would put a line into the template for each possible post-grad category.

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}');
Best I can do with the information I have.
chaley is offline   Reply With Quote
Old 09-09-2013, 12:43 PM   #13
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by chaley View Post
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
	)
The first template would be chosen if the category equals "Tort Law" or "some other post grad category". You would put a line into the template for each possible post-grad category.

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}');
Best I can do with the information I have.
Thank you!! That's brilliant
redscarlett is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 04:15 PM.


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