Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/ywmoyue/biliuwp-lite into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Nov 26, 2023
2 parents 5a0feeb + 1c4336a commit 422c57c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/BiliLite.UWP/Extensions/DynamicParseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public static RichTextBlock UserDynamicStringToRichText(this string txt, string
//处理换行
input = input.Replace("\r\n", "<LineBreak/>");
input = input.Replace("\n", "<LineBreak/>");

//处理其他控制字符
input = Regex.Replace(input, @"[\p{Cc}\p{Cf}]", string.Empty);

//处理@
input = HandelAtAndVote(input, txt, extend_json);
//处理网页🔗
Expand Down
13 changes: 11 additions & 2 deletions src/BiliLite.UWP/Models/Builders/DynamicItemDisplayModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public DynamicItemDisplayModelBuilder SetCommands(UserDynamicItemDisplayCommands
return this;
}

public DynamicItemDisplayModelBuilder SwitchType(IMapper mapper, JObject card)
public DynamicItemDisplayModelBuilder SwitchType(IMapper mapper, JObject card, JObject extendJson)
{
switch (m_displayViewModel.Type)
{
Expand Down Expand Up @@ -106,7 +106,7 @@ public DynamicItemDisplayModelBuilder SwitchType(IMapper mapper, JObject card)
originDisplayView = new DynamicItemDisplayModelBuilder()
.Init(mapper, model, cardOrigin)
.SetCommands(m_displayViewModel.UserDynamicItemDisplayCommands)
.SwitchType(mapper, cardOrigin)
.SwitchType(mapper, cardOrigin, extendJsonOrigin)
.SetCommentCount(cardOrigin)
.SetContent(cardOrigin, extendJsonOrigin)
.SetSeasonInfo(cardOrigin)
Expand All @@ -131,6 +131,15 @@ public DynamicItemDisplayModelBuilder SwitchType(IMapper mapper, JObject card)
}
};
break;

// TODO: 完全展示转发内容
case UserDynamicDisplayType.Text when (extendJson != null && extendJson.ContainsKey("")):
var ugcId = (string)extendJson[""]?["ugc"]?["ugc_id"];
if (!string.IsNullOrEmpty(ugcId))
{
card["item"]["content"] += ("\nav" + ugcId);
}
break;
}

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class CommentMemberUserSailingPendantModel
{
public int Id { get; set; }
public long Id { get; set; }

public string Name { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Pages/SettingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ private void mirrorComboboxSelectAction(object selectedValue)
case ApiHelper.GHPROXY_GIT_RAW_URL:
{
mirrorDonateText.Visibility = Visibility.Visible;
mirrorDonateUrl.NavigateUri = new Uri("https://gh-proxy.com");
mirrorDonateUrl.NavigateUri = new Uri("https://mirror.ghproxy.com/donate");
break;
}
case ApiHelper.KGITHUB_GIT_RAW_URL:
Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Services/ApiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class ApiHelper
public const string GIT_RAW_URL = "https://raw.githubusercontent.com/ywmoyue/biliuwp-lite/master";

// 镜像 GIT RAW路径
public const string GHPROXY_GIT_RAW_URL = "https://gh-proxy.com/https://raw.githubusercontent.com/ywmoyue/biliuwp-lite/master";
public const string GHPROXY_GIT_RAW_URL = "https://mirror.ghproxy.com/https://raw.githubusercontent.com/ywmoyue/biliuwp-lite/master";
public const string KGITHUB_GIT_RAW_URL = "https://raw.kkgithub.com/ywmoyue/biliuwp-lite/master";

// 哔哩哔哩API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private UserDynamicItemDisplayViewModel ConvertToDisplay(DynamicCardModel item)
DetailCommand = DetailCommand,
WatchLaterCommand = m_watchLaterVm.AddCommand,
})
.SwitchType(m_mapper, card)
.SwitchType(m_mapper, card, extendJson)
.SetCommentCount(card)
.SetContent(card, extendJson)
.SetSeasonInfo(card)
Expand Down

0 comments on commit 422c57c

Please sign in to comment.