Skip to content

Commit ea29eec

Browse files
committed
feat(TcBackendStreamData): 新增 Webrtc 類別及屬性
- 在 `TcBackendStreamData.cs` 中,新增了 `Webrtc` 類別及其屬性,並將 `Source` 和 `Mobilesource` 的類型從可為空的布林值 (`bool?`) 改為非空的布林值 (`bool`)。此外,移除了 `Streams` 類別中的 `Mobilesource` 屬性,提升資料結構的清晰度。 - 在 `TwitcastingClient.cs` 中,修改了日誌記錄的錯誤訊息,將 `GetBackendStreamDataAsync` 改為 `GetNewStreamDataAsync`,以反映方法名稱的變更,增強代碼的可讀性和維護性。
1 parent da8cf68 commit ea29eec

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

Discord Stream Notify Bot/HttpClients/TwitCasting/TcBackendStreamData.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ public class TcBackendStreamData
1313

1414
[JsonProperty("llfmp4")]
1515
public Llfmp4 Llfmp4 { get; set; }
16+
17+
[JsonProperty("webrtc")]
18+
public Webrtc Webrtc { get; set; }
1619
}
1720

1821
public class Fmp4
@@ -24,10 +27,10 @@ public class Fmp4
2427
public string Proto { get; set; }
2528

2629
[JsonProperty("source")]
27-
public bool? Source { get; set; }
30+
public bool Source { get; set; }
2831

2932
[JsonProperty("mobilesource")]
30-
public bool? Mobilesource { get; set; }
33+
public bool Mobilesource { get; set; }
3134
}
3235

3336
public class Hls
@@ -39,7 +42,7 @@ public class Hls
3942
public string Proto { get; set; }
4043

4144
[JsonProperty("source")]
42-
public bool? Source { get; set; }
45+
public bool Source { get; set; }
4346
}
4447

4548
public class Llfmp4
@@ -62,10 +65,25 @@ public class Streams
6265
[JsonProperty("main")]
6366
public string Main { get; set; }
6467

65-
[JsonProperty("mobilesource")]
66-
public string Mobilesource { get; set; }
67-
6868
[JsonProperty("base")]
6969
public string Base { get; set; }
7070
}
71+
72+
public class Webrtc
73+
{
74+
[JsonProperty("streams")]
75+
public Streams Streams { get; set; }
76+
77+
[JsonProperty("app")]
78+
public App App { get; set; }
79+
}
80+
81+
public class App
82+
{
83+
[JsonProperty("mode")]
84+
public string Mode { get; set; }
85+
86+
[JsonProperty("url")]
87+
public string Url { get; set; }
88+
}
7189
}

Discord Stream Notify Bot/HttpClients/TwitCasting/TwitcastingClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public TwitcastingClient(HttpClient httpClient, BotConfig botConfig)
7070
}
7171
catch (Exception ex)
7272
{
73-
Log.Error($"TwitCastingClient.GetBackendStreamDataAsync: {ex}");
73+
Log.Error($"TwitCastingClient.GetNewStreamDataAsync: {ex}");
7474
return null;
7575
}
7676
}

0 commit comments

Comments
 (0)