Skip to content

Commit

Permalink
fix: fix TwitcastingService for channel name secondary node support
Browse files Browse the repository at this point in the history
- Refactor the `getChannelName` method in `TwitcastingService.cs` to accommodate for a possible secondary node selection.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Jun 11, 2024
1 parent d0378b9 commit d1b5d91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ScopedServices/PlatformService/TwitcastingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ public override async Task UpdateChannelDataAsync(Channel channel, CancellationT
}

string? getChannelName()
=> htmlDoc.DocumentNode.SelectSingleNode("//span[@class='tw-user-nav-name']").InnerText;
{
HtmlNode? nameNode1 = htmlDoc.DocumentNode.SelectSingleNode("//span[@class='tw-user-nav-name']");
HtmlNode? nameNode2 = htmlDoc.DocumentNode.SelectSingleNode("//span[@class='tw-user-nav2-name']");
return nameNode1?.InnerText ?? nameNode2?.InnerText;
}
}

private async Task<(bool Live, string? Id)> GetTwitcastingLiveStatusAsync(Channel channel, CancellationToken cancellation = default)
Expand Down

0 comments on commit d1b5d91

Please sign in to comment.