Skip to content

Commit

Permalink
优化标题解析格式,防止发标题特殊符号当作路径分割符
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jul 1, 2024
1 parent 98eba71 commit 6eb955e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Core/RuntimeObject/RoomInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ private static RoomCardClass ToRoomCard(UidsInfo_Class.Data data, RoomCardClass
RoomCardClass card = new RoomCardClass()
{
UID = data.uid,
Title = new() { Value = data.title, ExpirationTime = DateTime.Now.AddSeconds(30) },
Title = new() { Value = data.title.Replace("/","-").Replace("\\","-"), ExpirationTime = DateTime.Now.AddSeconds(30) },
RoomId = data.room_id,
live_time = new() { Value = data.live_time, ExpirationTime = DateTime.Now.AddSeconds(30) },
live_status = new() { Value = data.live_status, ExpirationTime = DateTime.Now.AddSeconds(3) },
Expand Down Expand Up @@ -931,7 +931,7 @@ private static RoomCardClass ToRoomCard(UidsInfo_Class.Data data, RoomCardClass
else
{
OldCard.UID = data.uid;
OldCard.Title = new() { Value = data.title, ExpirationTime = DateTime.Now.AddSeconds(30) };
OldCard.Title = new() { Value = data.title.Replace("/","-").Replace("\\","-"), ExpirationTime = DateTime.Now.AddSeconds(30) };
OldCard.RoomId = data.room_id;
OldCard.live_time = new() { Value = data.live_time, ExpirationTime = DateTime.Now.AddSeconds(30) };

Expand Down Expand Up @@ -1070,7 +1070,7 @@ private static RoomCardClass ToRoomCard(UserInfo userInfo, RoomCardClass OldCard
Name = userInfo.data.name,
url = new() { Value = $"https://live.bilibili.com/{userInfo.data.live_room.roomid}", ExpirationTime = DateTime.MaxValue },
roomStatus = new() { Value = userInfo.data.live_room.liveStatus, ExpirationTime = DateTime.Now.AddSeconds(3) },
Title = new() { Value = userInfo.data.live_room.title, ExpirationTime = DateTime.Now.AddSeconds(30) },
Title = new() { Value = userInfo.data.live_room.title.Replace("/","-").Replace("\\","-"), ExpirationTime = DateTime.Now.AddSeconds(30) },
cover_from_user = new() { Value = userInfo.data.live_room.cover, ExpirationTime = DateTime.Now.AddMinutes(10) },
face = new() { Value = userInfo.data.face, ExpirationTime = DateTime.MaxValue },
sex = new() { Value = userInfo.data.sex, ExpirationTime = DateTime.MaxValue },
Expand All @@ -1086,7 +1086,7 @@ private static RoomCardClass ToRoomCard(UserInfo userInfo, RoomCardClass OldCard
OldCard.Name = userInfo.data.name;
OldCard.url = new() { Value = $"https://live.bilibili.com/{userInfo.data.live_room.roomid}", ExpirationTime = DateTime.MaxValue };
OldCard.roomStatus = new() { Value = userInfo.data.live_room.liveStatus, ExpirationTime = DateTime.Now.AddSeconds(3) };
OldCard.Title = new() { Value = userInfo.data.live_room.title, ExpirationTime = DateTime.Now.AddSeconds(30) };
OldCard.Title = new() { Value = userInfo.data.live_room.title.Replace("/","-").Replace("\\","-"), ExpirationTime = DateTime.Now.AddSeconds(30) };
OldCard.cover_from_user = new() { Value = userInfo.data.live_room.cover, ExpirationTime = DateTime.Now.AddMinutes(10) };
OldCard.face = new() { Value = userInfo.data.face, ExpirationTime = DateTime.MaxValue };
OldCard.sex = new() { Value = userInfo.data.sex, ExpirationTime = DateTime.MaxValue };
Expand Down

0 comments on commit 6eb955e

Please sign in to comment.