From b420caaf32fab4509b55927a7307f554570984bb Mon Sep 17 00:00:00 2001 From: yicheng <11733500+yichengchen@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:59:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BilibiliLive/Module/Live/LiveViewController.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/BilibiliLive/Module/Live/LiveViewController.swift b/BilibiliLive/Module/Live/LiveViewController.swift index 6feb203..feb6050 100644 --- a/BilibiliLive/Module/Live/LiveViewController.swift +++ b/BilibiliLive/Module/Live/LiveViewController.swift @@ -87,12 +87,18 @@ struct LiveRoom: DisplayData, Codable { let title: String let room_id: Int let uname: String - let keyframe: URL? + let keyframe: String? let face: URL? let cover_from_user: URL? var ownerName: String { uname } - var pic: URL? { keyframe } + var pic: URL? { + if let keyframe { + return URL(string: keyframe) + } + return nil + } + var avatar: URL? { face } } @@ -161,6 +167,6 @@ struct AreaLiveRoom: DisplayData, Codable, PlayableData { var aid: Int { 0 } func toLiveRoom() -> LiveRoom { - return LiveRoom(title: title, room_id: roomid, uname: uname, keyframe: system_cover, face: face, cover_from_user: user_cover) + return LiveRoom(title: title, room_id: roomid, uname: uname, keyframe: system_cover.absoluteString, face: face, cover_from_user: user_cover) } }