Ticket #4084 (closed defect: fixed)
calibredb list stanza output should url encode the urls
| Reported by: | blysik | Owned by: | kovidgoyal |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Command Line Interface | Version: | trunk |
| Keywords: | calibredb stanza | Cc: | blysik@… |
Description
calibredb list --output-format creates hrefs with spaces in them. Stanza for the iphone crashes with spaces in the urls.
Hand editing a link, and replacing the spaces with %20 fixes the problem.
Change History
comment:2 Changed 9 months ago by kovidgoyal
I removed the URL encoding in the last release because stanza fails to handle url encoded parentheses. Somebody needs to fix stanza.
How is it working for everyone else? All calibre urls will have spaces in them since they're based on titles/authors.
comment:3 Changed 9 months ago by davidp57
kovid: yeah that's weird, and I agree that it's definitively a Stanza bug ; but, the only program that we can fix is Calibre, so we need you :)
IMHO, the calibredb program needs to be modified specifically for when the --output-format option has the value stanza ; in this mode, the URLencoding must be kept, but an additional pass should be made on each link (href) in the stanza.xml file to replace URLencoded parentheses with good old ASCII chars (effectively working around the Stanza bug).
Don't you think ?
comment:4 Changed 9 months ago by kovidgoyal
I'm still confused as to how come it's only not working for you. All the other guys in the dropbox thread seem to be having no problems with spaces.
comment:5 Changed 9 months ago by davidp57
I thinks there is a misunderstanding somewhere : I said that it needed to be updated so that the parentheses are not URLencoded ; this should be a problem with every Stanza user, if some of their books contain parentheses in their file paths. The symptom is that the vignette of the book cover does not appear neither in the book list nor in the book synopsis, and (more importantly) that the book cannot be downloaded.
Now, with the modification you made in Calibre 6.0.24, nothing is URLencoded : this means that the parentheses are ok (or at least, Stanza should not complain about them), but now the spaces pose another Stanza problem, and the symptom is that Stanza crashes when asked to display the books list...
So, my solution would be to keep the old algorithm (URLencoding everything, as it should be IMHO if Stanza was as well programmed as Calibre) and add an additional pass, specific to the Stanza-format export mode, which would replace the %28 and %29 with actual parentheses.
Just throwing my two cents...
comment:6 Changed 9 months ago by kovidgoyal
I understand that but since various people are using 0.6.24 with stanza and all the URLs generated by 0.6.24 have spaces in them, I'm confused as to how no one else is experiencing this problem.
comment:7 Changed 9 months ago by kovidgoyal
To clarify: the reason I'm reluctant to change this is that I don't want to break it for someone else int he next release.
comment:8 Changed 9 months ago by davidp57
I understand totally...
However, I think that people do have problems with spaces : in fact, the user who created this ticket does...
I browse the Dropbox thread, looking for evidence, and here is a guy who has problems with parentheses (using pre-6.0.24 Calibre), another who says Stanza works well with URLencoded parentheses, yet another who says the contrary...
Evidence is inconclusive, I'll have to make some tests tonight at home to be certain. But, from my personal experience and a few tests I made some time ago, Stanza does not like %28 and %29, and crashes when there are spaces in its links...
comment:9 Changed 9 months ago by blysik
I've tested an epub link with url encoded parens, and Stanza on my iphone downloaded it fine. Here's the line from my stanza.xml file:
<link type="application/epub+zip" href="http://dl.dropbox.com/u/111970/Ebooks/Robert%20Asprin/The%20Face%20of%20Chaos%20%2857%29/The%20Face%20of%20Chaos%20-%20Robert%20Asprin.epub"/>
This is Stanza version 1.9.1 on my iPhone 3GS.
comment:10 Changed 9 months ago by kovidgoyal
Can you post this in the stanza+dropbox thread on mobileread, and see if it works for others as well (perhaps they need to update their stanza installs.
comment:11 Changed 9 months ago by davidp57
- Status changed from new to closed
- Resolution set to worksforme
Weird as it seems, now that I developped my own little tool for generating Stanza catalogs, I found out that a standard URLencoded path works fine with Stanza ; that's weird, let's close this ticket altogether...
Example (that works) :
<link type="application/epub+zip" href="../Kevin%20J.%20Anderson%2FAssemblers%20of%20Infinity%20%2812%29%2FAssemblers%20of%20Infinity%20-%20Kevin%20J.%20Anderson.epub" />
<link type="image/jpg" rel="x-stanza-cover-image" href="../Kevin%20J.%20Anderson%2FAssemblers%20of%20Infinity%20%2812%29%2Fcover.jpg" />
<link type="image/jpg" rel="x-stanza-cover-image-thumbnail" href="../Kevin%20J.%20Anderson%2FAssemblers%20of%20Infinity%20%2812%29%2Fcover.jpg" />
comment:12 Changed 9 months ago by blysik
- Status changed from closed to reopened
- Resolution worksforme deleted
Have to re-open, right? calibredb doesn't url encode right now. You've determined that Stanza handles a url encoded okay, which is good. But we still need calibredb to start doing that again.
comment:13 Changed 9 months ago by davidp57
You're right, I'm sorry !
comment:14 Changed 9 months ago by kovidgoyal
- Status changed from reopened to closed
- Resolution set to fixed
Fixed in branch trunk. The fix will be in the next release.
