Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2014, 04:16 AM   #1
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
Need a little help with saving to disk

I'm using this template :
{author_sort}/{title}/{author_sort} - [{series} {series_index:0>3s}] {title}

But that doesn't look nice when the book has no series.
example : Thiesler, Sabine - [ ] Bewusstlos
How can I tune this so that if series = null, it won't show series information ?

Even better would be that if there is no series it would write the publishing date

example : Thiesler, Sabine - (2012) Bewusstlos

Last edited by svda; 02-24-2014 at 05:53 AM.
svda is offline   Reply With Quote
Old 02-24-2014, 04:51 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,895
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by svda View Post
I'm using this template :
{author_sort}/{title}/{author_sort} - [{series} {series_index:0>3s}] {title}

But that doesn't look nice when the book has no series.
example : Thiesler, Sabine - [ ] Bewusstlos
How can I tune this so that if series = null, it won't show series information ?
The below will eliminate the brackets when there is no series/

Code:
{series:| [|] } {series_index:0>3s}
DoctorOhh is offline   Reply With Quote
Advert
Old 02-24-2014, 06:47 AM   #3
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
Thankyou DoctorOhh !!!!!

I tuned it some more to :
{author_sort}/{title}/{author_sort} - {series:| [| {series_index:0>3}] } {pubdate} {title}

Now I get :

Kellerman, Jonathan - [Alex Delaware 001] (2012) Blackout.epub
and
Fitzek, Sebastian - (2008) Der Seelenbrecher.epub

Which is quite a nice result!

I noticed however that when no pubdate is available, I get (101)

Fitzek, Sebastian - (101) Das Kind.epub

So very happy already. If I could get it to show the pubdate only when there is no series, that would be awesome.
svda is offline   Reply With Quote
Old 02-24-2014, 11:21 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,950
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by svda View Post
I noticed however that when no pubdate is available, I get (101)

Fitzek, Sebastian - (101) Das Kind.epub

So very happy already. If I could get it to show the pubdate only when there is no series, that would be awesome.
FWIW 1/1/101 is the 'unassigned' date for datetypes
theducks is online now   Reply With Quote
Old 02-24-2014, 09:10 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Use general program mode:

PHP Code:
program:

    
strcat(
        
template("{author_sort}/{title}/{author_sort} - {series:|[|}"),
        
ifempty(
            
finish_formatting(
                
field('series_index'),
                
'0>3',
                
' ',
                
'] '
            
),
            
finish_formatting(
                
format_date(
                    
field('pubdate'),
                    
'yyyy'),
                
'',
                
' (',
                
')'
            
)
        )

eschwartz is offline   Reply With Quote
Advert
Old 02-25-2014, 06:33 AM   #6
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
I use this one.

Code:
{author_sort}/{author_sort}{series:| - |} {series_index:0>2s} - {title} {tags:| (|, } {languages:||, } {:'format_date(raw_field('pubdate'),'yyyy')'||)}
It will create a Author_sort Directory and save each file as
Author_sort - Series - Series No - Titel (Tag, ... ,languages, ... , Pubdate)

You only need to fix your "[" "]" and number of digits.

Last edited by Divingduck; 02-25-2014 at 06:37 AM.
Divingduck is offline   Reply With Quote
Old 02-25-2014, 11:35 AM   #7
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
Thanks so much everyone. Gonna try this tomorrow and I will let you know! :-)
svda is offline   Reply With Quote
Old 02-25-2014, 02:45 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Divingduck View Post
I use this one.

Code:
{author_sort}/{author_sort}{series:| - |} {series_index:0>2s} - {title} {tags:| (|, } {languages:||, } {:'format_date(raw_field('pubdate'),'yyyy')'||)}
It will create a Author_sort Directory and save each file as
Author_sort - Series - Series No - Titel (Tag, ... ,languages, ... , Pubdate)

You only need to fix your "[" "]" and number of digits.
Mine doesn't show the pubdate unless series doesn't exist, which is what I think the OP wants.
eschwartz is offline   Reply With Quote
Old 02-26-2014, 03:58 AM   #9
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
You are right, I had overlook that detail.
Divingduck is offline   Reply With Quote
Old 02-26-2014, 07:06 AM   #10
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
Here's my feedback :
@Divingduck, your template only shows the right ")" and is not condtional
I'm experimenting a bit with my brackets, but I'm still not there.


@eschwarz, your solution is missing the {title} at the end of the string I want to write.
Otherwise, perfect! Haven't found out yet where to put the last {title}

I'm trying to learn from the examples I get, so thanks to both of you.
svda is offline   Reply With Quote
Old 02-26-2014, 02:22 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by svda View Post
Here's my feedback :

...

@eschwarz, your solution is missing the {title} at the end of the string I want to write.
Otherwise, perfect! Haven't found out yet where to put the last {title}

I'm trying to learn from the examples I get, so thanks to both of you.
Whoops, sorry. Here, I've added it:

PHP Code:
program:
    
strcat(
        
template("{author_sort}/{title}/{author_sort} - {series:|[|}"),
        
ifempty(
            
finish_formatting(
                
field("series_index"),
                
'0>3',
                
' ',
                
'] '
            
),
            
finish_formatting(
                
format_date(
                    
field('pubdate'),
                    
'yyyy'),
                
'',
                
' (',
                
') '
            
)
        ),
        
field('title')

At the end, I added one more entry to strcat, the final field('title').

(I also fixed an error where the date didn't have a space appended to separate it from the title.)



If you are trying to learn how this all works, a good resource is the calibre manual entry on templates, which also lists the different functions available. See here: http://manual.calibre-ebook.com/template_lang.html and ask questions if you need help understanding how it all works!

Last edited by eschwartz; 02-26-2014 at 02:26 PM.
eschwartz is offline   Reply With Quote
Old 02-26-2014, 02:52 PM   #12
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
@svda, this is possible, but only if you had no tags for your books. This is a situation I do not have for both tags and pubdate.

The example I gave use "(" by starting with a tag and ")" by ending with pubdate
You can modify it e.g. this way to have only the year in
Code:
{author_sort}/{author_sort}{series:| - |} {series_index:0>2s} - {title} {tags:| |, } {languages:||, } {:'format_date(raw_field('pubdate'),'yyyy')'|(|)}
But if you need condtional, then it is better to use the code from eschwartz.
Divingduck is offline   Reply With Quote
Old 02-27-2014, 03:32 AM   #13
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
I must say I am really very impressed with both of your knowledge and help. Many thanks!

@eschwartz : tried and approved!
@Divingduck : going to try yours out also ...
svda is offline   Reply With Quote
Old 02-27-2014, 03:50 AM   #14
svda
Connoisseur
svda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipsesvda can illuminate an eclipse
 
Posts: 52
Karma: 8426
Join Date: Feb 2013
Location: Belgium
Device: none
How do you guys trap missing dates (pubdate) ?
svda is offline   Reply With Quote
Old 02-27-2014, 06:13 AM   #15
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
I am using different data sources like author or publisher's webpage, wiki, library services like dnb.de (for German books), isbn.com plugin and the book itself (especially before updating these data in a book). Sometimes it is difficultly to get accurate metadata, e.g. for historical books like here at MR, Gutenberg … if a contributor does not name the exact source of a digitalized text for an ebook
Divingduck is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving to Disk From Calibre mitch13 Library Management 7 11-14-2013 11:54 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
Saving to disk htaylor Calibre 2 01-04-2009 08:29 PM


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


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