04-07-2015, 09:12 AM | #16 | |
Member
Posts: 16
Karma: 10
Join Date: Mar 2015
Device: android phone
|
Quote:
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? |
|
04-07-2015, 11:32 AM | #17 |
creator of calibre
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.
|
Advert | |
|
04-10-2015, 09:26 AM | #18 |
Member
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! |
04-10-2015, 09:45 AM | #19 |
creator of calibre
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
|
04-10-2015, 01:21 PM | #20 |
Member
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. |
Advert | |
|
04-14-2015, 09:11 AM | #21 |
Member
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! |
04-14-2015, 10:52 PM | #22 |
creator of calibre
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
All static resources belong in resources/content_server
|
04-17-2015, 09:13 AM | #23 |
Member
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! |
05-01-2015, 09:06 AM | #24 |
Member
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 :/ |
05-01-2015, 09:46 AM | #25 |
creator of calibre
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.
|
05-08-2015, 08:16 AM | #26 |
Member
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! |
Thread Tools | Search this Thread |
|
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 |