Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-13-2016, 03:27 AM   #1
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Restrict news shared by email

Hi all,
I'm downloading every morning various news in three languages and sharing them by automatic email with my wife or sometimes with other people. They, however, read only one or two of these languages, so sending everything clutters their devices. Is there a way to to say that some news should not be emailed to some addresses? I guess not, this would have to be somewhere on the Preferences page "Sharing books by email". Would you consider this to be a useful extension to calibre functionality? And if not, I'd write a plugin to achieve this, I'm only not sure which plugin class should that be and whether such functionality can be implemented in a plugin at all.

Cheers
bubak is offline   Reply With Quote
Old 07-13-2016, 03:44 AM   #2
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,356
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not something I am interested in implementing, but patches are welcome. THis is not something that can go into a plugin. You would need to patch core calibre.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-13-2016, 07:01 AM   #3
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
I see. I think it might work with adding another column "Restrict Languages" to the table in "Sharing books by email" which would contain either popup-menus to check languages (but I hate those long menus that contain all possible languages on the planet), or a free text field that would be empty (no restriction), or contain a list of languages to send, e.g. "English, German". But maybe it could contain any search term that can be in the Search field on the library page, then it could be used for all possible selections and restrictions, not only by language...?
bubak is offline   Reply With Quote
Old 07-13-2016, 07:13 AM   #4
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,356
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Dont use languages. Use tags. The news downlaods all have their title added as a tag and you can specify custom tags for each news source in the advanced tab of the fetch news dialog.
kovidgoyal is offline   Reply With Quote
Old 07-13-2016, 07:30 AM   #5
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Ok, that's even simpler, so the new column will contain just one freetext item, the tag.
bubak is offline   Reply With Quote
Advert
Old 07-15-2016, 09:23 AM   #6
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Just a few more details: I guess the tags should go to 'accounts' rather than have their own list like e.g. 'aliases'? And second, the config file smtp.py will be modified but the new code should work with the old format (without the tags) as well. Do you prefer to have checks for list length of accounts[i], or adding empty tags right after parsing the old file? The former is sort of ugly and I haven't yet found a right place for the latter...
bubak is offline   Reply With Quote
Old 07-15-2016, 09:32 AM   #7
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,356
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Rather than putting it in accounts which is quote overloaded (it was orginially supposed to store just a couple of things per account). Create a new config variable that has a mapping (dict) of account id to list of tags. That should be fully backwards compatible.
kovidgoyal is offline   Reply With Quote
Old 07-15-2016, 12:31 PM   #8
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Here is the patch. Sorry for the format, I didn't want to bother with a commit for a very simple change.
Attached Files
File Type: txt diffs.txt (4.8 KB, 123 views)
bubak is offline   Reply With Quote
Old 07-15-2016, 12:42 PM   #9
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Too fast with the Enter key :-( There is a missing strip:

- if opts.tags.get(account, False) and not (set(opts.tags[account].split(',')) & set (mi.tags)):
+ if opts.tags.get(account, False) and not (set([t.strip() for t in opts.tags[account].split(',')]) & set (mi.tags)):
bubak is offline   Reply With Quote
Old 07-15-2016, 02:57 PM   #10
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,356
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...28f17490e05cd3
kovidgoyal is offline   Reply With Quote
Old 07-15-2016, 04:38 PM   #11
bubak
Connoisseur
bubak began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
Thanks.
bubak is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email news to multiple email adresses in one shot? leo738 Calibre 1 12-22-2011 11:33 AM
Kindle - no email or news Snowsride Amazon Kindle 1 09-10-2011 12:36 PM
Can't email news (or books) poemi Calibre 2 12-18-2010 01:22 PM
Fetching News and Email emalvick Calibre 3 09-01-2010 04:31 AM


All times are GMT -4. The time now is 10:40 PM.


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