From 973d280ece56d832d01dfdc51a130ea6e51acfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=90=E7=92=90=E9=A3=9E?= Date: Thu, 12 Oct 2023 16:43:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20wps-cn=20=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=9C=A8=20-v=20=E8=BE=93=E5=87=BA=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E2=80=9D=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E2=80=9C=E8=BE=93=E5=87=BA=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/local/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/local/mod.rs b/src/local/mod.rs index 86999dc..ab4baf2 100644 --- a/src/local/mod.rs +++ b/src/local/mod.rs @@ -1,4 +1,5 @@ use std::{fmt::Display, path::Path}; +use crate::ALIAS; pub mod config; pub mod notification; @@ -77,7 +78,13 @@ impl Display for CheckUpType { bundle_id, } => { let dealed_app_name = app_name.to_lowercase().replace(' ', "-"); - write!(f, "检查更新方式为 HomeBrew,获取到的 bundle_id 为: {bundle_id},默认的信息获取链接为: https://formulae.brew.sh/api/cask/{dealed_app_name}.json") + let alias_keys = ALIAS.keys(); + let file_name = if !alias_keys.into_iter().any(|x| x == &bundle_id.to_string()) { + &dealed_app_name + } else { + &ALIAS[bundle_id] + }; + write!(f, "检查更新方式为 HomeBrew,获取到的 bundle_id 为: {bundle_id},默认的信息获取链接为: https://formulae.brew.sh/api/cask/{file_name}.json") } } }