Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-27-2014, 03:34 PM   #16
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,422
Karma: 85397180
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
How do you guys trap missing dates (pubdate) ?
If there is no date, it should return as blank??
eschwartz is offline   Reply With Quote
Old 02-28-2014, 02:54 AM   #17
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
Yes, no date => blank

Last edited by svda; 02-28-2014 at 11:50 AM.
svda is offline   Reply With Quote
Advert
Old 02-28-2014, 02:08 PM   #18
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,422
Karma: 85397180
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
Yes, no date => blank
Right, so what's the problem? It's already doing that. If pubdate is undefined, it will be left out. Although I did discover that the space between the author and the title, if there is no series or pubdate, is missing, so I migrated it out of the ifempty test. Fixed version:

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')
)
eschwartz is offline   Reply With Quote
Old 03-01-2014, 03:27 AM   #19
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
Didn't even notice that. Thank you eschwartz.

When the pubdate is unknown it results in pubdate (101)
As mentioned by theducks:
FWIW 1/1/101 is the 'unassigned' date for datetypes

Last edited by svda; 03-01-2014 at 03:30 AM.
svda is offline   Reply With Quote
Old 03-01-2014, 10:10 PM   #20
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,422
Karma: 85397180
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
Didn't even notice that. Thank you eschwartz.

When the pubdate is unknown it results in pubdate (101)
As mentioned by theducks:
FWIW 1/1/101 is the 'unassigned' date for datetypes
Well, I don't get that, when the pubdate is "undefined" it's blank. Maybe it is a Windows vs. linux issue?

I'll try to come up with something to fix this.
eschwartz is offline   Reply With Quote
Advert
Old 03-01-2014, 10:40 PM   #21
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Try this:

PHP Code:
program:

    
pdate=finish_formatting(
        
format_date(
            
field('pubdate'),
            
'yyyy'),
        
'',
        
'(',
        
') '
    
);

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

It should test if pdate contains "101" and return empty if so.

@theducks why is 1/1/101 the unassigned datetype? Do you have any idea why I have the empty string for an unassigned date? I am using linux if it makes a difference.

Last edited by eschwartz; 03-01-2014 at 10:45 PM.
eschwartz is offline   Reply With Quote
Old 03-01-2014, 10:45 PM   #22
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: 29,660
Karma: 54369090
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 eschwartz View Post
Well, I don't get that, when the pubdate is "undefined" it's blank. Maybe it is a Windows vs. linux issue?

I'll try to come up with something to fix this.
You can't set a (date) 'Type' on nothing so 1/1/101 represents a blank date
theducks is online now   Reply With Quote
Old 03-01-2014, 10:49 PM   #23
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,422
Karma: 85397180
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 theducks View Post
You can't set a (date) 'Type' on nothing so 1/1/101 represents a blank date
Very well, but I am still bewildered as to why it returns the empty string for me.
eschwartz is offline   Reply With Quote
Old 03-02-2014, 12:23 AM   #24
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: 29,660
Karma: 54369090
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 eschwartz View Post
Very well, but I am still bewildered as to why it returns the empty string for me.
There is probably some magic in the DB engine when it sees that value.
theducks is online now   Reply With Quote
Old 03-02-2014, 12:29 AM   #25
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,422
Karma: 85397180
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 theducks View Post
There is probably some magic in the DB engine when it sees that value.
Quote:
Originally Posted by eschwartz View Post
Very well, but I am still bewildered as to why it returns the empty string for me.
Specifically, why it works for me and not for @svda
eschwartz is offline   Reply With Quote
Old 03-02-2014, 12:55 AM   #26
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,420
Karma: 25894272
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by eschwartz View Post
Very well, but I am still bewildered as to why it returns the empty string for me.
@eschwartz : I think chaley explained it to me once, can't recall him saying it was windows only - but look in the books table with something like SQLite Database Browser and tell me what you see - I'll be gobsmacked if you see something different to me.

Like theducks said, there's some under handed information hiding going on behind the scenery to cause the undefined date "01010101T00:00:00' to be presented as 'blank/null/empty/vacuas' - might be Qt.

So where do you see this 'empty string' ? And what is an 'empty string' - pointer to a location with zero length, something that looks like "", null pointer...?

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	131
Size:	94.1 KB
ID:	119766  

Last edited by BetterRed; 03-02-2014 at 01:10 AM.
BetterRed is online now   Reply With Quote
Old 03-02-2014, 12:55 AM   #27
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
Sorry, I don't have access to my computer this weekend. I will try this monday asap.
svda is offline   Reply With Quote
Old 03-02-2014, 01:13 AM   #28
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,422
Karma: 85397180
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 BetterRed View Post
@eschwartz : I think chaley explained it to me once, can't recall him saying it was windows only - but look in the books table with something like SQLite Database Browser and tell me what you see - I'll be gobsmacked if you see something different to me.

Like theducks said, there's some under handed information hiding is going on behind the scenery to cause the undefined date "01010101T00:00:00' to be presented as 'blank/null/empty/vacuas' - might be Qt.

So where do you see this 'empty string' ?

BR
When printing out the pubdate via a template/plugboard, the pubdate returns as empty, in the sense that the template {pubdate:ifempty(isempty)} will return "isempty". During my tests I reset the pubdate on a book and it stopped showing up in the custom column.

See screenshot of my dedicated library for testing templates on blank records. I play around enough, mostly for other people, that I finally took the plunge. Am I crazy?

EDIT: See second screenshot, for debugging I used
Code:
ifempty(pdate,'[[pubdate-is-empty]] ')
instead of pdate.
Attached Thumbnails
Click image for larger version

Name:	calibre-test-pubdate-template.png
Views:	107
Size:	194.9 KB
ID:	119769   Click image for larger version

Name:	calibre-test-pubdate-template2.png
Views:	114
Size:	196.7 KB
ID:	119770  

Last edited by eschwartz; 03-02-2014 at 01:25 AM.
eschwartz is offline   Reply With Quote
Old 03-02-2014, 02:03 AM   #29
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,420
Karma: 25894272
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by eschwartz View Post
When printing out the pubdate via a template/plugboard. During my tests I reset the pubdate on a book and it stopped showing up in the custom column.

See screenshot of my dedicated library for testing templates on blank records. I play around enough, mostly for other people, that I finally took the plunge. Am I crazy?
@eschwartz - If you crazy, then me loco - my test database has its own instance of calibre potable [sic], that's what you see in my SQLIte Browser snap above.

Go to other end of the food chain, and look at what's in the database. If you can't to do that, save a csv catalogue that has pubdate and load into Excel (or your favourite text editor) or similar - see attached. Then work back up the chain to see where the transform happens.

Maybe none of this will explain why you and the OP are getting different results - but it may give a glimmer of a hint - no idea what though.

Do you happen to know how to enter a published date earlier than 1st Jan 1000CE into calibre? Ψ²

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	138
Size:	57.7 KB
ID:	119771  

Last edited by BetterRed; 03-02-2014 at 02:08 AM. Reason: grammar
BetterRed is online now   Reply With Quote
Old 03-02-2014, 02:30 AM   #30
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If I look at the pubdate column, it shows 100-12-31T18:00:00 by all blank entries. NO need for SQLite Browser.

Apparently the magic is only happening on my computer?

And you can edit whatever date you want in the individual edit metadata. Or at least, you get 0101 through to 7999.
eschwartz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:51 AM.


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