![]() |
#1 |
Member
![]() Posts: 23
Karma: 10
Join Date: Sep 2017
Device: Android
|
[Android] File Name Template help
Hello, I am trying to use conditional text in the file name template to apply a different template to only certain books.
I use Calibre for ebooks and manga, and all of the manga is in .cbz format (and tagged with "Manga"). My goal is to have all manga saved to a separate location on android devices when imported using Calibre Companion and renamed in a way that traditional manga reading applications will parse properly (Folder with the series name, with all entries in that series inside and named "Series" - "Chapter #" and then the [Scanlation Group] (I have a custom column for that field). I achieved this by setting the cbz file type in calibre companion to save to a different location (the local folder my manga app looks for) and using the following line in the Template Field: {series}/{series} - Chapter {series_index} [{#scanlators}] It worked great creating a file that looks like "MangaName - Chapter 5 [ScanlatorGroup]" inside a folder named named "MangaName". Awesome! Any manga reading app will parse that perfectly. Now that the test worked, I tried using the conditional commands in the template field to make it so only my manga is formatted that way, and all other traditional books are saved using the default "{title} - {authors}" formatting. Thats where things went to hell. From what I read at: http://cc_faq.multipie.co.uk/index.php?solution_id=1067 you can set different templates for different things using conditional text like :if: :then: and :else:, but there doesn't seem to be a way (listed at least) to set it by file type or a specific Tag. It recommended making a Yes/No column for that specific sorting, and marking everything you want that sorting applied to as "yes". So I made a custom Yes/No column named "Manga" and and set it to yes in the test mangas's metadata. Then I changed the Template field in Calibre Companion to: :if: {#manga} :then: {series} - Chapter {series_index} [{#scanlators}] :else: {title} - {authors} I expected it to parse the manga volume the same as the origonal non conditional test, and for it to parse other books like epubs with the default "{title} - {authors}" format. What happened was a file like this: "_if_Yes_then_MangaName - Chapter 5 [ScanlatorGroup]_else_ChapterName_ - AuthorName" It just treated all the conditional "if-then-else" text as part of the name, replacing all the ":" with "_" since they cannot be used in file names. I figure I must be making some stupid error but I can't figure out what. Im using the newest version of Calibre companion (5.3.5.2) so I know its not due to that. Anyone know what im doing wrong? In the end it wouldn't be Horrible if the normal books were sent over using that manga formatting since I launch all books manually from Caliber Companion to the reader I use (Moon+) and it lists books (even PDF's) as the name from Calibre Companions metadata, and not the file name (like it would if you searched for that PDF using Moon+ manually since that format doesn't hold metadata). But still if this is possible and i'm just messing something up id like to do it the intended way. I also suspect there might be some issues with Moon+ bookmark/last read position synching on other devices if the file names aren't the same (even though the name in the reader is the Calibre metadata supplied one). so I would probably need to use that file naming everywhere. Last edited by BaronKrause; 09-19-2017 at 09:25 PM. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Your template is missing the if statement's end indicator, 3 colons (::
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 23
Karma: 10
Join Date: Sep 2017
Device: Android
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update folders/file names after changing default save template. | JPKowal | Library Management | 7 | 01-24-2017 07:27 PM |
CC unable to write to file (Android | vohk | Calibre Companion | 1 | 10-18-2014 05:18 PM |
Troubleshooting File transfer from android to kindle | masud.shorif | Amazon Kindle | 23 | 09-15-2014 08:25 PM |
How to link file manager to Android/Moon +? | michaelbr | Android Devices | 1 | 12-25-2012 10:00 PM |
save file template for series | bucsie | Calibre | 2 | 11-08-2010 02:07 AM |