Skip to content

Commit

Permalink
优化弹幕录制逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Sep 7, 2024
1 parent fb1e1c4 commit b871d04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Core/RuntimeObject/Download/Basics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public static void LiveChatListener_MessageReceived(object? sender, Core.LiveCha
case DanmuMessageEventArgs Danmu:
{
string[] BlockWords = Core.Config.Core_RunConfig._BlockBarrageList.Split('|');
if (BlockWords.Any(Danmu.Message.Contains))
if (BlockWords.Any(word => !string.IsNullOrEmpty(word) && Danmu.Message.Contains(word)))
{
return;
}
Expand Down Expand Up @@ -492,7 +492,7 @@ public static void LiveChatListener_MessageReceived(object? sender, Core.LiveCha
case SendGiftEventArgs sendGiftEventArgs:
{
string[] BlockWords = Core.Config.Core_RunConfig._BlockBarrageList.Split('|');
if (BlockWords.Any(sendGiftEventArgs.GiftName.Contains))
if (BlockWords.Any(word => !string.IsNullOrEmpty(word) && sendGiftEventArgs.GiftName.Contains(word)))
{
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void LiveChatListener_MessageReceived(object? sender, Core.LiveChat.Mess
case DanmuMessageEventArgs Danmu:
{
string[] BlockWords = Core.Config.Core_RunConfig._BlockBarrageList.Split('|');
if (BlockWords.Any(Danmu.Message.Contains))
if (BlockWords.Any(word => !string.IsNullOrEmpty(word) && Danmu.Message.Contains(word)))
{
return;
}
Expand All @@ -98,7 +98,7 @@ private void LiveChatListener_MessageReceived(object? sender, Core.LiveChat.Mess
case SendGiftEventArgs sendGiftEventArgs:
{
string[] BlockWords = Core.Config.Core_RunConfig._BlockBarrageList.Split('|');
if (BlockWords.Any(sendGiftEventArgs.GiftName.Contains))
if (BlockWords.Any(word => !string.IsNullOrEmpty(word) && sendGiftEventArgs.GiftName.Contains(word)))
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Desktop/Views/Windows/VlcPlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void LiveChatListener_MessageReceived(object? sender, Core.LiveChat.Mess
case DanmuMessageEventArgs Danmu:
{
string[] BlockWords = Core.Config.Core_RunConfig._BlockBarrageList.Split('|');
if (BlockWords.Any(Danmu.Message.Contains))
if (BlockWords.Any(word => !string.IsNullOrEmpty(word) && Danmu.Message.Contains(word)))
{
return;
}
Expand Down

0 comments on commit b871d04

Please sign in to comment.