Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-18-2019, 05:09 AM   #1
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
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)
I hope someone can help me, or at least clarify if it's a bug or normal in Calibre?

Thanks so much in advance.

Tanjamuse

Last edited by Tanjamuse; 03-18-2019 at 05:13 AM.
Tanjamuse is offline   Reply With Quote
Old 03-18-2019, 06:54 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Tanjamuse View Post
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
You can sort the column like:

Code:
{tags:list_sort(0,\,)}
Quote:

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)
I hope someone can help me, or at least clarify if it's a bug or normal in Calibre?
I had to reformat it to read it properly, but the following should be the same.
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
	)
And assuming the two fandom columns are the lists that need to be sorted, I'd probably rewrite it as:

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}'))
But, I can't test that as I don't have the appropriate columns.
davidfor is offline   Reply With Quote
Advert
Old 03-18-2019, 07:44 AM   #3
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
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.
Tanjamuse is offline   Reply With Quote
Old 03-19-2019, 12:23 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Tanjamuse View 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?
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.
davidfor is offline   Reply With Quote
Old 03-19-2019, 04:41 AM   #5
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
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.
Tanjamuse is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 09:28 PM.


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