|
|
#1 |
|
Zealot
![]() Posts: 124
Karma: 10
Join Date: Dec 2008
Location: France
Device: None
|
Save to disk : adding pubdate to the filename
I'm trying to add the pubdate to every book when I save to disk :
For now, my template is as follow : {author_sort[0]}/{author_sort} - {series}{series_index:0>2s| | - } {title} ({pubdate}) which gives : D/Doe, John/Title (2021) But, obviously, some books have no pubdate, and I get this : B/Bench, John/Title of the book (101) (What is this "101" number ?) So my goal is : if pubdate = 101 do nothing else add "(pubdate)" I have tried various variations based on the series model but I can't get anywhere. Thanks for your help. |
|
|
|
|
|
#2 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,269
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
101 is the basis (base) of a Date data type everyplace in Calibre. I believe this is part of the open database package Calibre is built upon
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Zealot
![]() Posts: 124
Karma: 10
Join Date: Dec 2008
Location: France
Device: None
|
Thanks theducks for the explanation.
![]() Maybe someone will have an idea for the last part of my question. |
|
|
|
|
|
#4 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,269
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
|
|
|
|
|
#5 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,360
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
What kind of time formatting uses 101 as an epoch anyways? Google is failing me...
|
|
|
|
|
|
#7 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Many years ago (probably > 15) the choice was made to use 1 Jan 0101 as the undefined date. It is up to the user to check. Somewhere lost in time that check disappeared from save-to-disk template handing, which BTW although it looks a bit like SFM it is *not* using the calibre template language. Again, historical. There are a few cases like this that predate the template language or require processing where the template processor doesn't exist. I often run across code I wrote before templates existed. And before a consolodated metadata structure existed. And before consistent custom columns existed. And ... |
|
|
|
|
|
|
#8 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,360
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Normally, I'd expect the Unix Epoch, but I suspect it was chosen against this considering the purpose of Calibre and the number of books published before 1970...
|
|
|
|
|
|
#9 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
FWIW: I was at BTL when we started worrying about whether seconds-from-1970 would be storable with the integer types we had (32 bits signed). We hadn't done anything about it before I left (1979), but we knew we had made a mistake. |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to populate pubdate and page count when adding a book? | Fynjisx | Calibre | 9 | 08-07-2022 03:39 PM |
| Using Save to Disk, how to add to the end of the exported filename? | lue42 | Library Management | 7 | 07-12-2020 09:01 PM |
| “Saving to disk” – How to save books with a shorter title length in filename? | ToBiku | Library Management | 4 | 04-30-2020 05:14 AM |
| calibre - save to disk sort pubdate descending | dnm43 | Library Management | 1 | 02-13-2016 02:35 PM |
| Save to disk generate wrong filename | abuck | Conversion | 2 | 10-14-2013 02:00 AM |