ralsina / aranduka

Automatically exported from code.google.com/p/aranduka
0 stars 1 forks source link

Add support for downloading eBooks in multiple formats in the Manybooks.net book store plugin #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the Manybooks.net book store plugin only allows you to download books 
in ePub format (which is the one published on the OPDS catalog). We could hack 
the plugin using the list of formats on the converter plugin, so that you could 
download the book directly in the format you prefer.

Original issue reported on code.google.com by andresgattinoni on 7 Feb 2011 at 1:18

GoogleCodeExporter commented 9 years ago
I'll fix it once the new version of the book store plugins is ready.

Original comment by andresgattinoni on 8 Feb 2011 at 12:26

GoogleCodeExporter commented 9 years ago
I started this on revision 70f7c8d1f0. I'm not sure yet how to make the UI list 
all the available formats for download.

Original comment by andresgattinoni on 9 Feb 2011 at 1:20

GoogleCodeExporter commented 9 years ago
Basically, in parseBranch we parse an Atom feed (it's actually OPDS) and split 
it into a list of books and a list of links.

Then those two are passed to a template (category.tmpl) which renders a nice 
HTML page from that data.

You may want to add stuff into the objects in the book list, or pass another 
data structure with the extra links and then use the template to display them 
on the right place.

Original comment by roberto.alsina on 9 Feb 2011 at 1:30

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 746106065d.

I moved forward a little with this. I'm still having random problems to connect 
to ManyBooks.net, so I added a message for the user.
Now that ManyBooks provides a long list of available formats, we should 
probably change the way the links are displayed.
Maybe we could use a <select> with a Download button. I need to see how to do 
this on webkit.

Original comment by andresgattinoni on 10 Feb 2011 at 3:05

GoogleCodeExporter commented 9 years ago
Also I don't know how to avoid the plugin from caching the empty result it gets 
when it can't connect to ManyBooks.net, so that I can try to reload it without 
restarting Aranduka.

Original comment by andresgattinoni on 10 Feb 2011 at 3:10

GoogleCodeExporter commented 9 years ago
I am having problems with excessive caching, too, for example, on the epub 
viewer.

I will ask around.

Original comment by roberto.alsina on 10 Feb 2011 at 3:38

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 85255342f0.

Well, I'm not sure why this doesn't work. The javascript code for the 
redirection works, if I put
"window.location.href='http://www.google.com'", it takes me to Google. If I 
make an alert of
o.options[o.selectedIndex].value I get the right URL. But I'm not being 
redirected nor the book is being
downloaded. Any ideas?

Original comment by andresgattinoni on 15 Feb 2011 at 2:27

GoogleCodeExporter commented 9 years ago
Apparently the JavaScript redirection doesn't trigger the url parser function. 
You can try it by adding an html link to, say google.com, and in console you 
get a debug message saying that is following the link, but if you set the 
JavaScript redirect to google instead of the book url you don't get that debug 
message. I'm investigating how to fix this..

Original comment by algoz...@gmail.com on 13 Apr 2011 at 2:43

GoogleCodeExporter commented 9 years ago
I don't have much idea of how the webkit works, but could it have something to 
do with the connect/disconnect of the parseBranch slot?
I noticed that one of the first thing that parseBranch does is to call 
disconnect.

Original comment by andresgattinoni on 13 Apr 2011 at 2:48

GoogleCodeExporter commented 9 years ago
I think that the problem is that the javascript "location.href = 
'http://blabla.com'" doesn't trigger the linkClicked method of the QWebView, 
because, well technically it isn't a click.. OTOH, it doesn't even trigger the 
urlChanged() method! at least with the current code..

Original comment by algoz...@gmail.com on 13 Apr 2011 at 3:05

GoogleCodeExporter commented 9 years ago
Hmm... is it possible to access QWebView events from Javascript?
If not, what about something like this?
http://stackoverflow.com/questions/943554/how-to-get-javascript-in-a-qwebview-to
-create-new-instances-of-c-based-classes

Maybe that way we can create something from Qt side which does the redirection 
and tell javascript to call a Qt method.

Original comment by andresgattinoni on 13 Apr 2011 at 3:14

GoogleCodeExporter commented 9 years ago
Yep, may be that's the way to do it.. I was taking a look at the 
addToJavaScriptWindowObject() method of QWebFrame, that could be another 
solution, it exports objects to the javascript window object. But I couldn't 
make it work yet. Roberto might have a better idea of a solution, I know zero 
JavaScript and Aranduka was my first time with WebKit.. :-) Going to bed now.. 
tomorrow I'll give it another shot.

Original comment by algoz...@gmail.com on 13 Apr 2011 at 3:53

GoogleCodeExporter commented 9 years ago
Good news fellows, Revision d34a7a31f7 Fixes the JavaScript problem. It 
downloads epubs but I get Exceptions with other formats, the openUrl function 
needs some love... :-)

Original comment by algoz...@gmail.com on 15 Apr 2011 at 3:42

GoogleCodeExporter commented 9 years ago
This issue was updated by revision f6121efa6202.

I've made a few changes. I think this is ready to be tested and merged to the 
integrate branch.
Can any of you guys check it out?

Original comment by andresgattinoni on 19 Jan 2012 at 3:01

GoogleCodeExporter commented 9 years ago
Andy,

 I've downloaded 2 books from Manybooks.net in several formats and found no problem! :-) I say merge!

PS: By the way.. Aranduka looks great on Gnome3 ;-)

Original comment by algoz...@gmail.com on 19 Jan 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Cool :)
I'll merge it right now.

Original comment by andresgattinoni on 19 Jan 2012 at 11:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 4f368fd4e1d3.

Original comment by andresgattinoni on 19 Jan 2012 at 11:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by andresgattinoni on 29 Jan 2012 at 2:41