From 6b8e7b0eded524aa21f574a3873379f99fcb4eac Mon Sep 17 00:00:00 2001 From: spirit Date: Sat, 21 Dec 2019 20:25:28 +0800 Subject: [PATCH] update manifest --- inc/api.php | 4 ++-- languages/en_US.mo | Bin 1500 -> 1500 bytes languages/en_US.po | 10 +++++----- languages/sakura.pot | 6 +++--- languages/zh_CN.mo | Bin 33008 -> 33543 bytes languages/zh_CN.po | 31 ++++++++++++++----------------- manifest/manifest.py | 5 ++++- options.php | 4 ++-- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/inc/api.php b/inc/api.php index 1f2fcbd..a316c3f 100644 --- a/inc/api.php +++ b/inc/api.php @@ -351,9 +351,9 @@ function feature_gallery() { $img = array_rand($img_array); $img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri(); if(strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) { - $imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][1]; + $imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0]; } else { - $imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][1]; + $imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0]; } $data = array('cover image'); $response = new WP_REST_Response($data); diff --git a/languages/en_US.mo b/languages/en_US.mo index b9992f75c4ffe01ab0243ba0c57302ad91f5ef5a..9eb161b3de1359ee1efe8f0f68f6eac1699aaf7f 100644 GIT binary patch delta 21 ccmcb^eTRF)W+o0JLj@xPDWiki . Click here to update manifest" msgstr "" diff --git a/languages/sakura.pot b/languages/sakura.pot index b9320ef..66378e4 100644 --- a/languages/sakura.pot +++ b/languages/sakura.pot @@ -3,7 +3,7 @@ msgid "" msgstr "" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" "Project-Id-Version: Sakura\n" -"POT-Creation-Date: 2019-12-15 14:40+0800\n" +"POT-Creation-Date: 2019-12-21 20:23+0800\n" "PO-Revision-Date: 2019-11-01 14:27+0800\n" "Last-Translator: \n" "Language-Team: \n" @@ -1287,13 +1287,13 @@ msgid "" msgstr "" #: options.php:879 -msgid "Cover CDN" +msgid "Cover manifest" msgstr "" #: options.php:880 #, php-format msgid "" -"Fill in the cdn path for random picture display, without adding a slash at the end, for " +"Fill in the manifest path for random picture display, without adding a slash at the end, for " "example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to Wiki . Click here to update manifest" diff --git a/languages/zh_CN.mo b/languages/zh_CN.mo index f4480f5e0c3bc0be5807e18f7e50a7c59f75edb5..61981279867178377a4b0e511b7109dc4d717341 100644 GIT binary patch delta 6432 zcmaLa3shBA9>?)>5eZFGeDQ`0N}wVrnr}h#l_r*DIKI6K%2m7&T+C-zEu##dCsR>V z%ayaTvcl1{(lYI#H8V>sQ*&~Zhq`oWHjQOg^Zjvl)6AN+=IY_I|NHE--}`X6z9^{d zsh~GT1_cr<%bJy9SkoPbBLA+~Mj zR1R)#D1ue zZZ+;gRq!#sh9_|cE@Ax!V5crlhi0M5Ey8BF3gdAbwxNCN5DE405>khC3pJG;*bv=u z0IKH;P!%n~KDY+;+;P;1s!#*Cgc|t`bfc@QvlkLk9q5MI#6vNJ_AMU?O>Jpi20cYp z@HDo-wI=^nR7WaJ{0=rCK8RY|&oCO#p*nIKTVnlgmKB82_%+6%>iG#9)4o-YVTNEB zY9tY;4#Z*{rkeZrqdNK!M&Sh1E}nyGcr9v#mBx>Zr;JxHiTl5zW-_S<^RG>I4+&K; z5nJIr^x4PPpz6J5{NCLE3DwacHjrjI ztPk_A2V0S$4#Z+Ewnz1FC2HiappNA()JQ%+t?{R*nK)+h&ziUzwG`J;4b`K!nvqac zJ5i|TQUWAYuro&BAXE=0qBf5Yqwq;oM>nGyei?O)cA_@vUyu!NRiS1iD$8l;Zd5~E zPy@-rcpQSU81Rx{wyiSMS{=l@@f2R*1!MJfj$2hfMopN=`*s9Y;nUc)Kb^({n1CSz zI6;_#16<4;>i)HX&SvgPpbkEQ3^-tUNF*oGm)RKLGF&O-aV*+Xk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-%+2}*Qf#fWd4d;TK#pRQ=fz?kC;udfVegC$-A+rfxm`&??dw#K1+NK zpTy`Rlbqw$b?KA+Os1keE#=dwf$l&J^e7hMY1ESDO!0q!6k=`SGE}{XunVq0 zt<(pW|1nZ8>P}k5Y1ERZO`M0PQx`JBrhSU9FYmbc4^+lC$L)AZw@p!`G zGv*Jd3+gIH>yk*k-_I-!b$Z*NX4n(!VSj9l!!Zu0qgHAT>aZ=rd3XXfp`kPUpXZ;U z+G|+i?~OdvfJUI&pIAb5?b$Rk>ft;qsI+)BYHzD7f2;YrmA`}f-v5eP+Vq*egRZFd zdZRiTV(|#ngeRfS#H^VNR~0MBP)AEqFFcLPUylv&6^r+n2T}EpTYSOdpUwDLzMTxS z8R{#_N447vo8#ap3GGE0CgL*G5c zoAZR#*bSGI`v0YS7xhc4?Hqs4L?@HbFN68mg9eVF?)v0%f0#z1MqFm`!Eau<= zEW~On&zoyAM6J+Zi;FFuWiIhX-BVWKB`bK-JZPRWe=uVze8Wvp18Zg8X!b-MvOyM) zG$)&-=As(e|J9aJWo|+>@VdqOPwg@ z3RFM)Q5Vt?jD{pGlF*H}@F9PA9>%QjNzFbUQQ{@9Y(4b4@*^ZMYW(t8R=NXr00Y~Qj>#e;iS}p+|lIeN2g3b z%XxI6Kc#@5yTVh!I5M*|7!V%GOo_S8h37Ndwl1dH7{;of60A8= z$jwvpKVy-a66a=yJ+ejzCE?nv!eB;tGAoi>VI>o&y@qs8?8h_I^6%Z*Bzt0f+|2Sx zvvYd&zH?_;t4pyvm$qBiG_J#qIUPE7?bu;w{?L?!M(4IKzOe4ObIWiki . Click here to update " -#| "manifest" +#, php-format msgid "" -"Fill in the cdn path for random picture display, without adding a slash at " -"the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, " +"Fill in the manifest path for random picture display, without adding a slash " +"at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, " "please refer to Wiki . Click here to update manifest" msgstr "" -"填写 cdn 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr." -"net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考Wiki。点击这里更新" -"manifest" +"填写 manifest 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn." +"jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考Wiki。点击这里" +"更新manifest" #: options.php:886 msgid "Use the front-end library locally (lib.js、lib.css)" @@ -1858,6 +1852,9 @@ msgstr "注 册" msgid "Registration is not open yet." msgstr "暂未开放注册。" +#~ msgid "Cover CDN" +#~ msgstr "封面图图片库" + #~ msgid "Jsdelivr CDN" #~ msgstr "随机图片" diff --git a/manifest/manifest.py b/manifest/manifest.py index 0e7421c..b8f5ecc 100644 --- a/manifest/manifest.py +++ b/manifest/manifest.py @@ -44,7 +44,10 @@ class Single(object): def main(self): self.hash() # if os.path.exists(self.jpeg) and os.path.exists(self.webp): - self.optimize() + try: + self.optimize() + except OSError: + print("Falied to optimize the picture: " + self.file) self.manifest() return self.mani diff --git a/options.php b/options.php index 4d61858..fc2021d 100644 --- a/options.php +++ b/options.php @@ -876,8 +876,8 @@ function optionsframework_options() { 'type' => 'text'); $options[] = array( - 'name' => __('Cover CDN', 'sakura'),/*封面图片库*/ - 'desc' => sprintf(__('Fill in the cdn path for random picture display, without adding a slash at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to Wiki . Click here to update manifest', 'sakura'), rest_url('sakura/v1/database/update')),/*填写 cdn 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考Wiki*/ + 'name' => __('Cover manifest', 'sakura'),/*封面图片库*/ + 'desc' => sprintf(__('Fill in the manifest path for random picture display, without adding a slash at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to Wiki . Click here to update manifest', 'sakura'), rest_url('sakura/v1/database/update')),/*填写 manifest 路径 ,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考Wiki*/ 'id' => 'cover_cdn', 'std' => 'https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3', 'type' => 'text');