Skip to content

Commit

Permalink
minor improves
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhigh committed Oct 3, 2024
1 parent 405366f commit 796d9bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions application/back_end/send_mail_adpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ def send_to_kindle(user, title, attachment, fileWithTime=True, to=None):

#统一的发送邮件函数
def send_mail(user, to, subject, body, attachments=None, html=None):
if not isinstance(to, list):
sender = user.cfg('sender')
if not sender:
raise ValueError('Email of sender is empty')
if not to:
raise ValueError('Email of recipient is empty')
elif not isinstance(to, list):
to = to.split(',')

sm_service = user.get_send_mail_service()
srv_type = sm_service.get('service', '')
data = {'sender': user.cfg('sender'), 'to': to, 'subject': subject, 'body': body}
data = {'sender': sender, 'to': to, 'subject': subject, 'body': body}
if attachments:
data['attachments'] = attachments
if html:
Expand Down
4 changes: 2 additions & 2 deletions application/lib/calibre/web/feeds/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class BasicNewsRecipe(Recipe):

#: Number of simultaneous downloads. Set to 1 if the server is picky.
#: Automatically reduced to 1 if :attr:`BasicNewsRecipe.delay` > 0
simultaneous_downloads = 5
simultaneous_downloads = 3

#: Timeout for fetching files from server in seconds
timeout = 60
Expand Down Expand Up @@ -969,7 +969,7 @@ def __init__(self, options, log, output_dir, fs, feed_index_start=0):

if self.test:
self.max_articles_per_feed = self.test[1]
self.simultaneous_downloads = min(4, self.simultaneous_downloads)
self.simultaneous_downloads = min(3, self.simultaneous_downloads)

if self.debug:
self.verbose = True
Expand Down
4 changes: 2 additions & 2 deletions application/static/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ function ShowShareDialog(id, title){
'no','oc','oj','or','om','os','pa','fa','pi','pl','pt','ps','qu','rm','ro','ro','rn','ru','sg','sa','si','sk','sk',
'sl','se','sm','sn','sd','so','st','es','sq','sc','sr','ss','su','sw','sv','ty','ta','tt','te','tg','tl','th','bo',
'ti','to','tn','ts','tk','tr','tw','ug','uk','ur','uz','ve','vi','vo','cy','wa','wo','xh','yi','yo','za','zh','zu'];
var languages = ['en','fr','zh','es','pt','de','it','ja','ru','tr','ko','ar','cs','nl','el','hi','ms','bn','fa','ur',
var languages = ['en','zh','es','fr','pt','de','it','ja','ru','tr','ko','ar','cs','nl','el','hi','ms','bn','fa','ur',
'sw','vi','pa','jv','tl','ha','da','in','no','pl','ro','sv','th'];
var userLang = BrowserLanguage();
var ostr = [`<h3 style="margin:0px auto;text-align:center;">${i18n.shareLinksHappiness}</h3>
Expand All @@ -813,7 +813,7 @@ function ShowShareDialog(id, title){
<select onchange="this.nextElementSibling.value=this.value;DisplayShareRssLang()">
<option value=""></option>`);
for (var lang of languages) {
ostr.push(`<option value="${lang}">${lang}</option>`);
ostr.push(`<option value="${lang}">${LanguageName(lang)}</option>`);
}
ostr.push(`</select>
<input type="text" name="category" oninput="DisplayShareRssLang()" value="${userLang}" id="txt_share_rss_lang" />
Expand Down

0 comments on commit 796d9bd

Please sign in to comment.