10-10-2011, 04:53 AM | #1 |
Zealot
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
custom export
I currently use the following template for exporting my books to separate folders based on filetype:
{#supercat}/{tags}/{authors}/{title} - {authors} It works fine for me. I chose which type to export and it neatly places chosen type in well organized folders. However I have to run the export for each book type that I have to achieve what I want. Is there a way to structure the template to place the various types into their respective folders? When I do each one manually I end up with different top folders for each type by choosing the parent when I save. I want to automate this whole process. btw, #supercat is a custom tag. :-) |
10-10-2011, 06:50 AM | #2 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If you have one format per book, then you can use
{formats}/{#supercat}/{tags}/{authors}/{title} - {authors} If you have multiple formats per book, then the above probably won't do what you want, as you will end up with folders named "EPUB, MOBI, PRC" or some such. I can't think of a way around this problem. This isn't any field available containing the current format. |
Advert | |
|
10-10-2011, 06:57 AM | #3 | |
Zealot
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
Quote:
|
|
10-11-2011, 06:01 AM | #4 |
Zealot
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
In the left pane, the "formats" field shows the total for each format separately. How can I access the function that breaks down each format like that?
|
10-11-2011, 06:13 AM | #5 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
If you are trying to find a template language function that returns the number of (for example) epubs in the library, there isn't one. Template functions operate on individual books, not on a database. If you are trying to find the number of formats for a specific book, then use the count function, as in {:'count(field('formats'), ',')'}. |
|
Advert | |
|
10-11-2011, 06:39 AM | #6 | |
Zealot
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
Quote:
{#supercat}/{tags}/{authors}/{title} - {authors} what I want is something like: {formats}/{#supercat}/{tags}/{authors}/{title} - {authors} except I want a case where if there are multiple formats per book that a copy of each format gets placed in separate folders. Not where I would end up with folders like: "EPUB, MOBI, TXT". In a case like this, I want each book to get routed to: EPUB/{#supercat}/{tags}/{authors}/{title} - {authors} MOBI/{#supercat}/{tags}/{authors}/{title} - {authors} TXT/{#supercat}/{tags}/{authors}/{title} - {authors} Hope this is clear. I know I can get my hands dirty and write a custom script but I don't want to do so if there is an existing easier way of doing it. |
|
10-11-2011, 08:05 AM | #7 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
As I said above, there is no way in the template language to know the current format being saved. In fact, even the part of calibre code that generates pathnames does not have access to the extension (format). Because of this, there is no way in the template language to route a particular format to a particular folder.
|
10-11-2011, 08:20 AM | #8 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
@Iomari
It is not as efficient, but you can get your output. First: Search (or use the Tag Browser: Formats: ) to show only books that have the format you want. Set your save template first folder (a literal) to the format name. Code:
EPUB/{#supercat}/{tags}/{authors}/{title} - {authors} You can use literals mixed in with field names. |
10-11-2011, 08:22 AM | #9 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
10-11-2011, 08:26 AM | #10 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
10-11-2011, 08:27 AM | #11 |
Zealot
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
Looks like I'm going to have to write a custom command line script to do this. I don't have a problem with that but if there was some built in way of doing it I would rather not spend the time writing what is already available.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can custom book data be displayed in a custom column? | kiwidude | Development | 9 | 03-02-2011 05:35 AM |
Export help needed please | kakkalla | Library Management | 18 | 01-28-2011 11:18 AM |
Export just metadata? | TheD0ct0r | Calibre | 3 | 12-11-2010 09:52 AM |
Request Export the markups to pc | mihai@alaphant.nl | enTourage Archive | 3 | 11-21-2010 05:19 PM |
Import/Export | Scullion | Calibre | 2 | 08-03-2009 01:15 AM |