![]() |
#1 |
Connoisseur
![]() 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() 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...?
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() 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...
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() 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.
|
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() 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)): |
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,356
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() Posts: 65
Karma: 10
Join Date: Dec 2010
Device: kindle voyage
|
Thanks.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |