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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-04-2010, 03:17 PM   #1
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
How to search for dates (published or entered)?

There are two date fields in the metadata. Is it possible to search these fields in the search bar? If so, how? Can I find all books published before a certain date or in a specific year? IIRC, in the code, the published date is "pubdate", but

"pubdate:2009"

doesn't work.

Thanks.
Starson17 is offline   Reply With Quote
Old 04-05-2010, 12:11 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,458
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC you can't search on dates, but sorting should do most of what you need.
kovidgoyal is offline   Reply With Quote
Old 04-05-2010, 09:49 AM   #3
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kovidgoyal View Post
IIRC you can't search on dates, but sorting should do most of what you need.
Thanks. Sorting is what I've been doing, and I never really needed searching on dates, but I began to wonder if I was missing something. Recently I started using chaley's new save search functionality and thought I might want a save search for the wife that only showed current news. (BTW, I tested your new recount code on Vista and it worked great - no crashes. OTOH, the old code worked for me, too.)
Starson17 is offline   Reply With Quote
Old 04-05-2010, 10:47 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,458
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks for the testing. Always good to have some, as I certainly can't test calibre nearly enough myself

I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax

Code:
pubdate:(><=)YYYY-MM-DD
month and day should be optional.

Similarly for date:

Last edited by kovidgoyal; 04-06-2010 at 05:16 AM.
kovidgoyal is offline   Reply With Quote
Old 04-06-2010, 12:34 AM   #5
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 630
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
Quote:
Originally Posted by kovidgoyal View Post
I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax

pubdate><=)YYYY-MM-DD
Do I need to include the actual frowning "smiley" image as shown in your post? Or will typing the colon followed by an open parenthesis be sufficient?
Sabardeyn is offline   Reply With Quote
Old 04-06-2010, 11:29 AM   #6
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Sabardeyn View Post
Do I need to include the actual frowning "smiley" image as shown in your post? Or will typing the colon followed by an open parenthesis be sufficient?
I think he was suggesting I write code to implement this, if I want it (and he was suggesting what the search should look like). And yes, I think the frown face should be required!
Starson17 is offline   Reply With Quote
Old 04-06-2010, 07:28 PM   #7
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,923
Karma: 1673776
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by kovidgoyal View Post
I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax

Code:
pubdate:(><=)YYYY-MM-DD
month and day should be optional.

Similarly for date:
This shouldn't be hard to do. However, be careful with things like pubdate:>2000. If one is not careful, the 2000 would convert to 2000-01-01 for the comparison, which wouldn't work at all.

Given 30 seconds of thought, I think that if one does a equal-length substring match, everything works. pubdate:OP2000 would compare 4 characters. ..:OP2000-10 would compare 7. This should work with all the relational comparisons.

While at it, whoever does this should implement all the relational operators (=, >, <. !=. >=. <=). In addition, comparison strings that aren't valid dates (e.g., 2000-88-54) should raise PARSE_ERROR, which would indicate that the search has an error (search bar becomes pink).
chaley is offline   Reply With Quote
Old 04-06-2010, 08:55 PM   #8
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
This shouldn't be hard to do.
Oh I disagree. It looks like it would take superhuman abilities to figure out how to do this. Anyone who accomplished such a feat of programming would be legendary. (Does anyone have a bucket of paint and a fence they need whitewashed)

Quote:
“Oh, come now, you don’t mean to let on that you like it?”

The brush continued to move.

“Like it? Well, I don’t see why I oughtn’t to like it. does a boy get a chance to whitewash a fence every day?”

That put the thing in a new light. Ben stopped nibbling his apple. Tom swept his brush daintily back and forth - stepped back to note the effect - added a touch here and there - criticized the effect again - Ben watching every move and getting more and more interested, more and more absorbed. Presently he said:

“Say, Tom, let me whitewash a little.”

Tom Considered, was about to consent; but he altered his mind:

“No-no-I reckon it wouldn’t hardly do, Ben. You see, Aunt Polly’s awful particular about this fence - right here on the street, you know - but if it was the back fence, I wouldn’t mind, and she wouldn’t. Yes, she’s awful particular about this fence; it’s got to be done very careful; I recon there ain’t one boy in a thousand, maybe two thousand, that can do it the way it’s got to be done.”

“No-is that so? Oh, come now - lemme try. Only just a little - I’d let you, if you was me, Tom.”

“Ben, I’d like to, honest injun; but Aunt Polly - well, Jim wanted to do it, but she wouldn’t let him; Sid wanted to do it, and she wouldn’t let Sid. Now, don’t you see how I’ fixed? If you was to tackle this fence and anything was to happen to it --”

“Oh, shucks, I’ll be just as careful. Now lemme try. Say - I’ll give you the core of my apple.”

“Well, here - No, Ben, no you don’t. I’m afeared --”

“I’ll give you all of it!”

Tom gave up the brush with reluctance in his face, but alacrity in his heart.
Starson17 is offline   Reply With Quote
Old 04-07-2010, 05:31 AM   #9
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,923
Karma: 1673776
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Starson17 View Post
Oh I disagree. It looks like it would take superhuman abilities to figure out how to do this. Anyone who accomplished such a feat of programming would be legendary. (Does anyone have a bucket of paint and a fence they need whitewashed)
Please open a ticket asking for the feature. Include in the ticket your full name, address, birth date, mother's maiden name, and banking details. Alternatively, type the information into calibre's search box and name that search 'Nigerian 419'. Once I get the information through either channel, I will get back to you in a few days.

On a more serious note, do open a ticket and assign it to me. Given that I have just been into the guts of the search stuff and hope that I haven't yet forgotten how it works, it does make sense for me to do the work. I won't need your whitewash.
chaley is offline   Reply With Quote
Old 04-07-2010, 08:54 AM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
Given that I have just been into the guts of the search stuff
This was in the back of my mind. You've got to be familiar with this part of the code after doing the regex search and exact match coding. Seriously, it wasn't that I had a burning desire for this capability, I just thought it was implemented already and that I didn't know the command syntax.

I'm out of the hospital and back at work full time, so my development time is very limited. I'm not a programmer, just a interested amateur who likes adding features to a worthy project. I sometimes suspect my amateur efforts take Kovid more time than to fix than if he wrote from scratch.

Feel free to add the bug ticket and take this on if you think it's worthwhile. I hesitate to do it, as I don't want to make requests unless I really want the feature, and when I really want it, I feel obligated to do it myself. Why ask someone else to do work I'm not willing to do myself?

After my merge code gets added (or rejected) I'll choose another project to do. Perhaps it will be this, but I suspect it will be something more closely related to the Add record code and merge code that I've become familiar with.

Of course, if you want me to add the ticket for this feature, I'll be happy to do that, but only if you think it's worthwhile and you want to tackle it. If you have any other project that is of more interest, tackle that one first. (I like your proposed variable content tag project a lot, it's more interesting than this one, and I know it's a big one).

I hope you liked my whitewash quote - after all - this is an ebook forum and a quoting a bit of a classic struck me as appropriate.
Starson17 is offline   Reply With Quote
Old 04-07-2010, 10:55 AM   #11
theducks
Grand Sorcerer
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: 15,301
Karma: 6022735
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by chaley View Post
Please open a ticket asking for the feature. Include in the ticket your full name, address, birth date, mother's maiden name, and banking details. Alternatively, type the information into calibre's search box and name that search 'Nigerian 419'. Once I get the information through either channel, I will get back to you in a few days.

On a more serious note, do open a ticket and assign it to me. Given that I have just been into the guts of the search stuff and hope that I haven't yet forgotten how it works, it does make sense for me to do the work. I won't need your whitewash.
OK Where is the Pub Date stored?
The only date (really a: Timestamp field ) I found in the metadata.db (metadata_sqlite.sql) structure was in the Books table
theducks is offline   Reply With Quote
Old 04-07-2010, 12:43 PM   #12
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,112
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Timestamp and pubdate both appear to be fields in the books table (which seems the logical place to hold them). I assume the first is when the book was added to Calibre and the second the publication date.
itimpi is offline   Reply With Quote
Old 04-07-2010, 05:07 PM   #13
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,923
Karma: 1673776
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by theducks View Post
OK Where is the Pub Date stored?
The only date (really a: Timestamp field ) I found in the metadata.db (metadata_sqlite.sql) structure was in the Books table
That is where they are. They are both timestamps with the time part ignored. Also, pubdate does not set the day. By default, timestamp is the date the record was first written, but it can be changed in edit_metadata.

I am submitting ticket with the code now.
chaley is offline   Reply With Quote
Old 04-07-2010, 06:12 PM   #14
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,923
Karma: 1673776
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Starson17 View Post
(I like your proposed variable content tag project a lot, it's more interesting than this one, and I know it's a big one).
That work is going well, faster than I expected. All the fundamental work is done. Tag-based columns:
- have one of four data types (text, bool, date, number)
- can be created and populated
- can be positioned and sized
- can be hidden and re-enabled
- can be deleted
- can be directly edited, with appropriate completion
- can be edited using the metadata editor.
What I have left to do is the GUI dialog box that permits a 'normal' user to create a tag column. The tag browser work to separate tags into categories is no longer necessary, although I think I will do it anyway.

I will probably give something to Kovid this weekend. This isn't a small change, so I imagine that he will spend some time looking at and fixing what I have done.
Quote:
I hope you liked my whitewash quote - after all - this is an ebook forum and a quoting a bit of a classic struck me as appropriate.
When as a child I tried to get my younger sister to do my chores, my mother would frown at me and tell me that I was whitewashing the fence. I didn't fully understand until I was around 10 and read the book.
chaley is offline   Reply With Quote
Old 04-07-2010, 06:13 PM   #15
theducks
Grand Sorcerer
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: 15,301
Karma: 6022735
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by chaley View Post
That is where they are. They are both timestamps with the time part ignored. Also, pubdate does not set the day. By default, timestamp is the date the record was first written, but it can be changed in edit_metadata.

I am submitting ticket with the code now.
SQL lite allows 2 dates within one field? I was looking for a second Date capable field

Before the great and nifty Catalog by Ryker, I played around with the Command line DB export and saw the time as part of the field.
I usually update the date when I make major changes to the contents of a title since the "data" table does not have a timestamp for each book format when added/updated.
theducks 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
How to remove dates from news feed vega07 Calibre 11 07-26-2010 07:25 PM
Article Dates with parse_index EnergyLens Calibre 6 04-21-2010 11:13 PM
Kindle 2 Shipping Dates Cutestory Amazon Kindle 29 02-13-2009 12:30 PM
Dates in Russian (?) Roger Wilmut Calibre 10 11-24-2008 07:22 PM
Google Book Search to search full-text books online Bob Russell Deals, Freebies, and Resources (No Self-Promotion) 1 08-19-2006 01:13 PM


All times are GMT -4. The time now is 11:10 PM.


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