From 796d9bdf69780be3c7e9f3c789cfb40d28861776 Mon Sep 17 00:00:00 2001 From: cdhigh Date: Thu, 3 Oct 2024 19:04:52 -0300 Subject: [PATCH] minor improves --- application/back_end/send_mail_adpt.py | 10 ++++++++-- application/lib/calibre/web/feeds/news.py | 4 ++-- application/static/base.js | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/application/back_end/send_mail_adpt.py b/application/back_end/send_mail_adpt.py index a34f86fd..639f9943 100644 --- a/application/back_end/send_mail_adpt.py +++ b/application/back_end/send_mail_adpt.py @@ -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: diff --git a/application/lib/calibre/web/feeds/news.py b/application/lib/calibre/web/feeds/news.py index f5b0e2c1..c248ebe4 100644 --- a/application/lib/calibre/web/feeds/news.py +++ b/application/lib/calibre/web/feeds/news.py @@ -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 @@ -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 diff --git a/application/static/base.js b/application/static/base.js index a6ed398b..22012fc8 100644 --- a/application/static/base.js +++ b/application/static/base.js @@ -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 = [`

${i18n.shareLinksHappiness}

@@ -813,7 +813,7 @@ function ShowShareDialog(id, title){