03-04-2014, 02:54 PM | #1 |
Addict
Posts: 296
Karma: 1599870
Join Date: Jun 2012
Device: none
|
Multiple save to disk templates?
I'm thinking about consolidating my copies of Calibre Portable. I didn't realize until recently that the Portable version could handle multiple libraries, so I currently have it installed in 3 different locations for my 3 libraries.
I've outlined the pros and cons of merging, and realized there's one major issue. My 3 libraries all have different save to disk templates. I need to be able to maintain separate templates for each library, or barring that, have a way to choose between templates when I save books to disk. Is there any way to keep multiple save to disk templates in Calibre? |
03-04-2014, 03:09 PM | #2 |
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)
|
Use multiple configuration directories, which you are already doing.
Or manually change the template each time you switch libraries. Keep in mind that you can have a general template, as well as specific overriding templates per device type. Also, the MTP device interface can be set up separately per device. I use a special template that chooses how I want to save each book depending on the data I have saved in custom columns. If a book has anything in the #origfilename custom column, it's an Amazon book and I use the contents of that column as the template, if that field is empty, I fall back on the generic "Author_Sort/Title - Author" template. Code:
program: ifempty( field('#file'), template('[[author_sort:sublist(0,1,&)]]/[[title]] - [[authors:sublist(0,1,&)]]')) Last edited by eschwartz; 03-04-2014 at 03:13 PM. |
03-04-2014, 05:11 PM | #3 |
Addict
Posts: 296
Karma: 1599870
Join Date: Jun 2012
Device: none
|
eschwartz, you're a genius!
Having a single branching template is a reasonable workaround. It's not quite as convenient as storing separate templates, but once you gave me the idea, I did some research and experimentation, and it looks like the switch function and the current_library_name function can be used together to select different templates based upon which library is active. It even works when certain custom fields used in one of these sub-templates don't even exist in a different library. The nice thing about using the switch function is that if I ever need to add another library in the future, I just have to add another pattern/value pair to the script. It's not as convenient as multiple templates, but it's the next best thing. As soon as I work out my final template, I'll post it over on that other thread that you mentioned so that others can make use of it if they wish. This is the last piece I needed in order to consolidate my copies of Calibre Portable. Thanks! |
03-04-2014, 06:28 PM | #4 |
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)
|
Awesome! Glad I could help!
|
03-05-2014, 02:42 PM | #5 |
Addict
Posts: 296
Karma: 1599870
Join Date: Jun 2012
Device: none
|
I posted my final template in the other thread, but to make it easier to find with a forum search, I'm posting it here as well:
Code:
program: switch(current_library_name(), 'Calibre Library', template('{#division}/{#genre}/{#authorlookup}/{series:||/}{series_index:0>3s||_}{#subseries}{#subseries_index:0>3s||_}{title}'), 'Library - Special', template('{#group}/{title}'), 'Library - Working', template('{author_sort}/{series}/{series_index:0>3s}_{title}'), template('{author_sort}/{series}/{series_index:0>3s}_{title}')) |
03-10-2014, 05:38 PM | #6 |
Wizard
Posts: 1,751
Karma: 2667650
Join Date: Jul 2012
Device: Android, Nook Simple Touch, Nook Color, ..., Glo
|
nice guys...you gave me another way to think about my save templates when I am dealing with family/friend devices
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple 'save to disc' templates? | redscarlett | Library Management | 12 | 09-09-2013 12:43 PM |
plugin for favorite save to disk templates | gabby98 | Plugins | 3 | 07-03-2013 01:35 PM |
How to remove unwanted Save-to-disk templates | alexmobile | Calibre | 5 | 02-22-2012 05:54 AM |
Save on disk | PhM | Calibre | 1 | 06-13-2011 12:43 PM |
Save to Disk | beckywc | Library Management | 3 | 06-06-2011 08:54 PM |