Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-05-2009, 09:05 PM   #16
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
Nice! I've put in a few hours and rewritten and expanded the script. It now takes the date directly from the first download link on the page. Many other things have changed as well, so take a look
Attached Files
File Type: bat nrc_v2.bat (1.5 KB, 270 views)
quisvir is offline   Reply With Quote
Old 11-18-2009, 09:09 AM   #17
Azeeman
Junior Member
Azeeman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2009
Device: Sony PRS600
Hi guys,

As a subscriptor to the NRC this is a very interesting post. Unfortunately I can not get it all to work with the latest nrc_v2 script. The script just stops after changing the meta-data. Therefore the book will not be added to Calibre and more (rest of the script).

No warnings, but the file is created just fine. Any suggestions?
Azeeman is offline   Reply With Quote
Advert
Old 11-18-2009, 11:05 AM   #18
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
Quote:
Originally Posted by Azeeman View Post
Hi guys,

As a subscriptor to the NRC this is a very interesting post. Unfortunately I can not get it all to work with the latest nrc_v2 script. The script just stops after changing the meta-data. Therefore the book will not be added to Calibre and more (rest of the script).

No warnings, but the file is created just fine. Any suggestions?
Are you sure the epub is downloaded correctly? Try opening it with Calibre's ebook viewer.

If it did download correctly, you may have stumbled upon the same problem that JvdW encountered, which I personally have not. What operating system and version of Calibre are you using? As a sort-of fix, you can add the following to the start of each calibre-related line (ebook-meta, calibredb, calibre-debug)
Code:
start /wait
This way, you can force the script to wait until it is done with each command before proceeding to the next.
quisvir is offline   Reply With Quote
Old 11-19-2009, 04:36 AM   #19
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by quisvir View Post
Are you sure the epub is downloaded correctly? Try opening it with Calibre's ebook viewer.

If it did download correctly, you may have stumbled upon the same problem that JvdW encountered, which I personally have not. What operating system and version of Calibre are you using? As a sort-of fix, you can add the following to the start of each calibre-related line (ebook-meta, calibredb, calibre-debug)
Code:
start /wait
This way, you can force the script to wait until it is done with each command before proceeding to the next.
The epubs download OK, if they are published on time that is.
The real problem is that since Calibre-0.6.17 this doesn't work anymore. Since that version Kovid has changed the layout of the Calibre folder, changed the installer and also changed the way Calibre is packaged. One of these changes is causing this problem.
A suggestion of Kovid is to use powershell to start the batch file, but I would like to keep the number of external programs needed to a minimum of zero if possible.


Regards,

Joop
JvdW is offline   Reply With Quote
Old 11-20-2009, 05:23 AM   #20
Azeeman
Junior Member
Azeeman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2009
Device: Sony PRS600
The option 'start /wait' works for me. I guess the script was trying to add the epub to the database but was blocked by the previous proces.

Thanks! Now going to schedule this script for ma-vr 15:10 :-)
Azeeman is offline   Reply With Quote
Advert
Old 11-11-2010, 04:07 AM   #21
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Hello Kovid,

Hoping that you read posts on old threads, sorry to revive this one because of the context it supplies.

Quote:
Originally Posted by kovidgoyal View Post
Actually, I'm sorry, what happens is that when a news download completes, the id is recorded in a config file which is then used to sync

Assuming you can find out the id of the freshly added news (which should be easy to do using calibredb, the following command will mark it to be synced

Code:
calibre-debug -c "from calibre.gui2 import dynamic; ids = dynamic.get('news_to_be_synced', set([])); ids.add(35); dynamic.set('news_to_be_synced', ids)"
replace 35 with the id of the freshly added news
As can be seen of the posts in this thread all was (is) well until 0.7.24?
I had .7.23 on my computer at work and could run the batchfile and Calibre would automatically send the news to my reader (505). At home it didn't work anymore but there I try to keep up with the latest version.

There is mentioning in the changelog about a change in sending news to the reader with multiple libraries but I don't know if that is the cause but the line of code you suggested doesn't work anymore with versions above .7.23. I do see it being present in dynamic.pickle but can't see if its correct. Downloading news through a recipe works OK in .7.27

Do you have any idea what might be cause this and a pointer to fix it?

Thanks in advance,

Joop
JvdW is offline   Reply With Quote
Old 11-11-2010, 11:24 AM   #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: 45,363
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah this setting was moved inside the db (otherwise if you use multiple libraries, the ids can conflict).

Code:
from calibre.library import db; db = db(); import pprint; pprint.pprint(db.prefs)
will print out all the settings stored in the db, including the one you are interested in.
kovidgoyal is online now   Reply With Quote
Old 11-12-2010, 05:31 AM   #23
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by kovidgoyal View Post
Yeah this setting was moved inside the db (otherwise if you use multiple libraries, the ids can conflict).

Code:
from calibre.library import db; db = db(); import pprint; pprint.pprint(db.prefs)
will print out all the settings stored in the db, including the one you are interested in.
Thanks voor the pointer. I have made the following change, line is broken into multiples for readability:
Code:
start /wait calibre-debug -c "
from calibre.library import db; 
db=db(); 
from calibre.utils.config import prefs; 
ids = db.prefs.get('news_to_be_synced', set([])); 
ids.append(%id%); 
db.prefs.set('news_to_be_synced', ids);
"
How does that look to you?
Any room for improvement?

Thanks,

Joop
JvdW is offline   Reply With Quote
Old 11-12-2010, 10:21 AM   #24
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: 45,363
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
in the get use [] as the default not set([])
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic News Download brewjono Calibre 3 10-09-2010 08:49 AM
automatic lrf for news fetching? tuncaysu Calibre 2 01-15-2010 09:13 AM
automatic tag changes for news feeds in calibre? SDgirl Sony Reader 0 06-03-2009 09:11 PM
My automatic "feeds to Memory card" trick... sherman Calibre 0 11-22-2008 04:42 PM
Having trouble getting feeds to work; willing to help but don't know how tdavie Calibre 12 10-05-2008 08:01 PM


All times are GMT -4. The time now is 01:40 AM.


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