11-06-2010, 04:52 AM | #46 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Regarding searching: if a tag (or other value) has a leading or trailing blank, then an equality test will fail. The DB isn't supposed to have any of these, but I suppose it is possible that some sneaked in. I will fix this.
|
11-06-2010, 05:51 AM | #47 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Huh, it seems to be related to searching two different fields then. In my case I was searching for an author name (though not by tag in that case)
This search will reproduce it in your demo server: Code:
Conrad and not Tags:=Classics To answer your other question, both 'Tags:=Nopub' and 'not Tags:=Nopub' yield the expected results by themselves. |
11-06-2010, 06:00 AM | #48 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Could this bug explain your other problems? I will fix this and make a release shortly. I will also look at giving an error if a field name doesn't exist. |
|
11-06-2010, 06:44 AM | #49 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Release 0.1.5 is out. I hope it fixes the search problems.
Change log: Spoiler:
|
11-06-2010, 11:34 AM | #50 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Thanks! Seems to be working now - just got a chance to change the server config now, was testing from my phone before.
I'll let you know if I run into any other difficulties, but seems pretty to be working quite well at this point. Are the results OPDS compliant, or is this just a catalog browser? It's cool if it's not, if that's the case I'm thinking of using your PHP server as the master catalog browser, and then use Calibre2OPDS to generate Stanza/Aldiko catalogs for friends/family using the respective devices for those apps. Last edited by ldolse; 11-06-2010 at 11:36 AM. |
11-06-2010, 01:12 PM | #51 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Good.
Quote:
Would have per-user restrictions be of any use? It wouldn't be hard to do. |
|
11-06-2010, 08:43 PM | #52 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Per user restrictions would be nice, but not critical. I was planning on password protecting it and giving out user accounts at the server level with standard 401 auth. Would you just use that user ID, or were you thinking of creating accounts within your server?
|
11-07-2010, 05:59 AM | #53 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
They were easy to do, and are in the latest release V0.1.6.
Quote:
|
|
11-10-2010, 08:51 AM | #54 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Thanks for that - it will be useful. Tested it out and seems to work well.
Finally got my library in a presentable state, which is why it's taken a bit to reply. Now that almost all my books have covers, I discovered one bug. It's showing up when viewing covers, though it may affect other requests, not sure. Basically if the title has a single quote - ' - anywhere in the title then the cover won't display. I'm guessing the single quote needs to be escaped somehow in cover.php, but not sure how to go about that. |
11-10-2010, 09:09 AM | #55 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The URLs passed for the cover are already escaped. (See book_base.php, line 31). For example, the URL I see for the book "1632' (I messed with the title) is index.php?m=cover&c=Eric+Flint%2F_1632%27+%281262% 29%2Fcover.jpg It could be that the file system your library is coming from does something with quotes. Check to see whether or not the quote is really there in the path, or whether it has been translated to something else. I will be off-line for a while, so take your time. It will be the end of November before I can get back to it. |
|
11-10-2010, 09:22 AM | #56 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Weird, it's quite reliable on my system - I've got dozens of books with single quotes in the title, and all are exhibiting this. I'm not seeing single quotes get escaped automatically though...
Here's an example: Local filesystem: /Users/userid/Documents/MyeBooks/Douglas Adams/Dirk Gently's Holistic Detective Agency (754)/cover.jpg Actual URL on the Web Server (can be viewed here): /ebooks/Douglas Adams/Dirk Gently's Holistic Detective Agency (754)/cover.jpg URL passed from the PHP script (displays generic book cover): /CalibrePHP/index.php?m=cover&c=Douglas+Adams%2FDirk+Gently%27 s+Holistic+Detective+Agency+(754)%2Fcover.jpg No worries about the time, thanks for checking into it. Edit - I now see that the single quote is escaped in the actual html generated by the PHP, but when the browser actually goes to it it converts it back to a single quote - pasting the URL into the browser location bar will illustrate it. Anyway either way the book cover isn't found. Last edited by ldolse; 11-10-2010 at 09:27 AM. |
11-10-2010, 09:29 AM | #57 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Random thought before I check out -- make sure that the PHP option magic_quotes_gpc is turned off. It could cause some difficulties.
|
11-11-2010, 01:19 PM | #58 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I was doing some research/testing on this - just posting it here for when you get back online, or in case there is another PHP expert out there with some input.
There are lots of discussions out there indicating PHP just doesn't behave well with single quotes in directories/filenames. Unfortunately the most frequent recommended solution is to not use them, which isn't really acceptable since these map to Calibre titles. My first thought was to work around this using various unicode apostrophe alternatives. I was hoping Calibre would convert these to underscores like it does some other characters. Unfortunately Calibre was too smart for me and mapped these to ascii single quotes at the filesystem level. I dug further into the PHP code to see what was going on. Single quotes are handled a bit oddly. While the encoded URL shows just only the single quote, when I actually print the $path variable it's showing up a bit oddly: Code:
Douglas Adams/Dirk Gently/'s Holistic Detective Agency (754)/cover.jpg Regarding magic_quotes_gpc, I haven't had much luck completely disabling that, following the directions for disabling it using .htaccess didn't seem to work, though magic_quotes_runtime is disabled - maybe that's all that's required. Nothing I've changed there has made a difference though. Last edited by ldolse; 11-11-2010 at 09:36 PM. |
11-11-2010, 08:53 PM | #59 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
One other thing, had to add a few mimetypes to mimetypes.php - finfo is not supported in php 5.2:
Code:
'rtf' => 'application/rtf', 'lit' => 'application/x-ms-reader', 'doc' => 'application/msword', 'zip' => 'application/zip', |
11-13-2010, 04:26 AM | #60 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |
Web Content Server | mezme | Calibre | 7 | 01-08-2010 09:59 PM |
Calibre web server on MAC I cant get to work.. any help appreciated. | stustaff | Calibre | 5 | 01-06-2010 06:05 PM |
Calibre - web server problems | eclpmb | Calibre | 9 | 11-28-2008 02:04 PM |