![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
Trouble Saving to Disk Alphabetically
Hi.
When I save Books to disk with a comma separated tag column the output isn't sorted alphabetically when there's more than one tag in the column. What's in the column in Calibre: Angel The Series, Buffy The Vampire Slayer, Firefly What it becomes in the folder on my computer: Buffy The Vampire Slayer, Firefly, Angel The Series This is my template for saving to disk. I know the tmp1 and tmp2 is the same one but I don't know how to remove one of the them and still keep the rest of it intact. Code:
program: tmp1 = template('{#parent_fandom}/{#meta_fandom}/{#story_id}/{author} - {title}'); tmp2 = template('{#parent_fandom}/{#meta_fandom}/{#story_id}/{author} - {title}'); tmp3 = template('_ Multiple Crossovers/{#story_id}/{author} - {title}'); cmp(count(field('#meta_fandom'), ','), 3, re(re(tmp1,': ',' '),',',', '), re(re(tmp2,': ',' '),',',', '), tmp3) Thanks so much in advance. Tanjamuse Last edited by Tanjamuse; 03-18-2019 at 05:13 AM. |
![]() |
![]() |
![]() |
#2 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Code:
{tags:list_sort(0,\,)} Quote:
Code:
program: tmp1 = template('{#parent_fandom}/{#meta_fandom}/{#story_id}/{author} - {title}'); tmp1 = re(re(tmp1,': ',' '),',',', '); tmp3 = template('_ Multiple Crossovers/{#story_id}/{author} - {title}'); cmp( count(field('#meta_fandom'), ','), 3, tmp1, tmp1, tmp3 ) Code:
program: tmp1 = template('{#parent_fandom:list_sort(0,\,)}/{#meta_fandom:list_sort(0,\,)}'); tmp1 = re(re(tmp1,': ',' '),',',', '); tmp4 = cmp( count(field('#meta_fandom'), ','), 3, tmp1, tmp1, '_ Multiple Crossovers' ); strcat(tmp4, template('/{#story_id}/{author} - {title}')) |
||
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
It's only the meta_fandom column that needs to be sorted alphabetically, sorry for not clearing that up in the original post.
Can you add a condition that says only if the parent_fandom column is empty should it be put in the _ Multiple Crossovers folder when I save, provided that there still is more than 3 fandoms? Thanks so much in advance. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Sorry, I'm not sure what you want. Looking at the current conditions, that one doesn't quite make sense to me. Can you state the full rules for what you want? Not just the change you want, but all of what you are trying to achieve.
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
I'll try to explain.
This is what I want the output to look like: Let's say there's only 1 fandom in meta fandom and no parent fandom it would be: Buffy The Vampire Slayer/ID-Number/Author - Title If there's 2 fandoms in meta fandom and a tag in the parent fandom it would be: Tolkien/Hobbit & Lord of The Rings/ID-Number/Author - Title If there's 3 fandoms in the meta fandom and a tag in the parent fandom it would be: Tolkien/Hobbit & Lord of The Rings & Silmarillion/ID-Number/Author - Title If there's 3 fandoms in the meta fandom and nothing in the parent fandom it would be: _ Multiple Crossovers/ID-Number/Author - Title Both parent fandom and meta fandom are comma separated like tags columns, I would like it to be sorted alphabetically when there's more than 1 fandom in the meta fandom and separated (if possible) by a & instead of comma when I save the folders. The template I have is createed with help from divingduck from this thread: https://www.mobileread.com/forums/sh...d.php?t=310745 Thanks so much for your time. I hope this made more sense. Last edited by Tanjamuse; 03-19-2019 at 04:44 AM. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need a little help with saving to disk | svda | Conversion | 35 | 03-03-2014 03:08 PM |
Saving to Disk | LRC1962 | Library Management | 1 | 06-20-2012 07:58 PM |
Saving to Disk | paulfiera | Calibre | 3 | 07-20-2011 10:21 AM |
Losing files when saving saving to disk | theaccountant | Library Management | 4 | 03-10-2011 02:38 PM |