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

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-07-2015, 09:12 AM   #16
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
Quote:
Originally Posted by goge View Post
Sooo... did some work last night. I'm going to have to scrap the plugin idea.
I agree that's why I'm going to implement it in the content server.

My non-graphical/no ui plugin didn't seem to have access to the db, and didn't seem to start when only starting the content server.

Starting multiple web servers also seems like a waste when the content server already starts up a cherrypy server.

Is the content server extensible with plugins? At a glance it doesn't seem to be. It seems the easiest way to add new functionality would be to add endpoints to ajax.py or create a new class used with the LibraryServer.

At first I'm only going to be adding an endpoint that takes an isbn parameter and adds it to the db and schedules a metadata update similar to the ui. Once that is done I might also add an endpoint to edit existing metadata.

So should I add the functionality to ajax.py and create a new 'web app' similar to browse.py or add the functionality to browse as well?
goge is offline   Reply With Quote
Old 04-07-2015, 11:32 AM   #17
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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, you cannot extend the server with plugins. You will need to patch calibre.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-10-2015, 09:26 AM   #18
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
Hi,

I added the endpoints to import a book into the db from an isbn number and that is running fine

I am now looking into how to get the metadata for the book.

https://github.com/kovidgoyal/calibr...lk_download.py
So far, following the metadata download in the above gui action I follow the action through a threaded worker job to:
https://github.com/kovidgoyal/calibr...rces/worker.py

It seems to write the metadata out to the file system and the job that calls it reads the metadata out of the filesystem. Am I understanding this correctly?

Is there a synchronous way import meta data?
I'd rather not duplicate the business logic in bulk_download.py -> download.
download doesn't seem to use the gui.

Can I use the bulk_download.py -> download from within the LibraryServer?
Async backend would work well if we had some real time web component but from what I understand cherry py doesn't have a good implementation for it. I could just poll on the client.

Thanks!
goge is offline   Reply With Quote
Old 04-10-2015, 09:45 AM   #19
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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at how the fetch-ebook-metadata command line tool does it
kovidgoyal is offline   Reply With Quote
Old 04-10-2015, 01:21 PM   #20
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
Thank you!

That implementation works really well. I now have the add by isbn ajax implemented. It adds the book and fetches it's metadata That's enough for me to get started scanning my books!

I can see some improvements. I also should implement checking for duplicates. I can get covers as well. There is already a bit of a delay, maybe <5 seconds, when fetching the metadata, downloading a cover will increase that. I might make it asynchronous in the future.

Thanks for the help! I'm going to see about embedding the scanner web app in the LibraryServer as well. When things are fully functional I'll make a pull request.
goge is offline   Reply With Quote
Advert
Old 04-14-2015, 09:11 AM   #21
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
I have a bunch of questions now that I'm trying to embed the angularjs single page app into the LibraryServer

Is it possible to create a static content endpoint in the LibraryServer cherry py server? Does one already exist?

If I create one where should I put the directory in the codebase structure? Can I create an ISBN subfolder in the library/server folder? When the content server is built will it still have access to those static files?

Thanks!
goge is offline   Reply With Quote
Old 04-14-2015, 10:52 PM   #22
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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
All static resources belong in resources/content_server
kovidgoyal is offline   Reply With Quote
Old 04-17-2015, 09:13 AM   #23
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
I'll put the html and js in an isbn subfolder similar to browse.

Thank you!
goge is offline   Reply With Quote
Old 05-01-2015, 09:06 AM   #24
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
Still here, haven't gotten much further. Work and family life with a newborn is slowing the development.

The Angular.js web app is living in resource/content_server/isbn.
The javascript isbn barcode reader I'm using is android only. That works for me but I may need to find a server side implementation in python to get other devices like iOS to work.

I'm going to pull on a Design and User Experience co-worker sometime soon to help with the layout and some interactions.

I would _Love_ to get some real time / concurrent tasks going but there doesn't seem to be any good implementations that work with out of the box cherrypy. If I do I would need to spin up a separate websockets server :/
goge is offline   Reply With Quote
Old 05-01-2015, 09:46 AM   #25
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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not sure I understand the need for websockets. Since all the work is happening on the server anyway, you should be able to get away with just having the client poll the server periodically for an update on the status of background jobs. It is much less efficient, of course, but since the calibre server does not have to support millions of users, that shouldn't be an issue.
kovidgoyal is offline   Reply With Quote
Old 05-08-2015, 08:16 AM   #26
goge
Member
goge began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
Ya I agree, there is no real _need_ but it was just something I was interested in playing with =D


Thanks!
goge 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
Add from the Mobile Read Library? danwdoo Calibre 8 12-03-2014 06:03 PM
3 suggestions: merge on add, cleanup on add, sorting changeling Calibre 5 08-24-2013 06:35 AM
ASIAN, ISBN and ISBN-13 jbcohen General Discussions 2 04-02-2013 02:27 PM
Problem with add books from isbn Arutha Library Management 3 01-17-2012 08:56 PM
Stupid Question: ISBN-10 and ISBN-13 Tegan Library Management 4 03-11-2011 01:20 AM


All times are GMT -4. The time now is 08:34 PM.


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