View Single Post
Old 06-01-2018, 01:38 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by kovidgoyal View Post
I'm sure there must besome existing plugins that use the jobs infrastructure you can copy from.
Yes, I'm OK with this. It's what I did the only other time I tried the jobs approach. This is how I know it's challenging for me I guess it would be good practice to have a second attempt.

Is there some calibre help documentation I may have missed that would help me get a better overview of how it all fits together?


Quote:
Originally Posted by kovidgoyal View Post
Your choices are:

1) Simply run your entire job in a thread hat produces its output in a temporary directory. Show a blocking progressdialog while this is happening. After the worker thread is complete, copy the output data into calibre on the main thread.

2) Use the calibre jobs infrastructure to do all the heavy lifting for you. This is how calibre itself runs conversion/bulk metadata download etc jobs. The idea is the same, you run the job to output to a temporary dir, when it is complete you bring the data into calibre.
The jobs approach seems to be the option-for-all-seasons, it's just that it seems a bit OTT when the chosen book only contains a few short files.

Is there any issue with kicking off multiple MS API calls/EXEs? Might the OS grind to a halt?

The end product is a directory full of MP3s on a local disk. I'm not currently planning to import them back into calibre. Is there any need to hide them in a temp dir until the last step? The only output data I might want to bring back to the calibre GUI would be a text log of what was done and how long each cycle took to run. I think I should be able to sort something out for that.
jackie_w is offline   Reply With Quote