From ed660ea3c8f265298277c1ae374a97918e4ec240 Mon Sep 17 00:00:00 2001 From: Mark Chan <45706356+WindowsMEMZ@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:46:11 +0800 Subject: [PATCH] Fix long uid crash and no data issue (#12) * Update VideoDetailView.swift * Update FollowListView.swift * Update VideoCommentsView.swift Removed an outdated `#if swift(>=5.9)` code * Merge main branch to fix/long-uid (#20) * Update status-check.yml * Delete .github/workflows/codeql.yml * Update status-check.yml * Create statuscheck-runner.yml * Update ios.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Add license comments for code files (#13) * Update ErrorGetView.swift * Update FeedbackView.swift * Update MemoryWarningView.swift * Update SignalErrorView.swift * Update AppFileManager.swift * Update CodeExt.swift * Update UIExt.swift * Update ContentView.swift * Update MainView.swift * Update SearchView.swift * Update LivePlayerView.swift * Update OfflineMainView.swift * Update AboutView.swift * Update FirstUsingView.swift * Update LoginView.swift * Update NoticeView.swift * Update SettingsView.swift * Update bMessageSendView.swift * Update ArticleView.swift * Update DownloadsView.swift * Update FavoriteView.swift * Update FollowListView.swift * Update HistoryView.swift * Update PersonAccountView.swift * Update UserDetailView.swift * Update WatchLaterView.swift * Update ImageViewerView.swift * Update UserDynamicMainView.swift * Update AudioPlayerView.swift * Update LyricerView.swift * Update VideoCommentsView.swift * Update VideoDetailView.swift * Update VideoDownloadView.swift * Update VideoPlayerView.swift * Update DarockBiliApp.swift * Update status-check.yml * Update statuscheck-runner.yml * Update status-check.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Update status-check.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Update status-check.yml * Update statuscheck-runner.yml * Update statuscheck-runner.yml * Merge next branch to main (#19) * Fix Crash Issue when Seeing User's Videos in UserDetailsView (#15) * Update UserDetailView.swift * Merge main workflows (#16) * Update status-check.yml * Update statuscheck-runner.yml * Update CodeExt.swift * Update UserDetailView.swift Fixed optional unwrap issue * Update status-check.yml * Update status-check.yml * Update status-check.yml * Update status-check.yml * Update status-check.yml * Update status-check.yml * Update UserDetailView.swift * Add local wbi sign feature (#18) * Update CodeExt.swift Added wbi calculation logic * Update MainView.swift * Update PersonAccountView.swift * Update UserDetailView.swift Might fix the article access issue at the same time. * Update CodeExt.swift * Update CodeExt.swift * Update CodeExt.swift * Update status-check.yml * Update status-check.yml * Update CodeExt.swift --- .../PersonalCenter/FollowListView.swift | 4 ++-- DarockBili Watch App/Video/VideoCommentsView.swift | 12 ------------ DarockBili Watch App/Video/VideoDetailView.swift | 2 +- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/DarockBili Watch App/PersonalCenter/FollowListView.swift b/DarockBili Watch App/PersonalCenter/FollowListView.swift index 1bd98490d..66236e0f5 100644 --- a/DarockBili Watch App/PersonalCenter/FollowListView.swift +++ b/DarockBili Watch App/PersonalCenter/FollowListView.swift @@ -119,9 +119,9 @@ struct FollowListView: View { let datas = respJson["data"]["list"] for data in datas { if pinnedUsers.contains(String(data.1["mid"].int ?? 0)) { - users.insert(["Name": data.1["uname"].string ?? "[加载失败]", "Face": data.1["face"].string ?? "E", "Sign": data.1["sign"].string ?? "[加载失败]", "UID": String(data.1["mid"].int ?? 0)], at: 0) + users.insert(["Name": data.1["uname"].string ?? "[加载失败]", "Face": data.1["face"].string ?? "E", "Sign": data.1["sign"].string ?? "[加载失败]", "UID": String(data.1["mid"].int64 ?? 0)], at: 0) } else { - users.append(["Name": data.1["uname"].string ?? "[加载失败]", "Face": data.1["face"].string ?? "E", "Sign": data.1["sign"].string ?? "[加载失败]", "UID": String(data.1["mid"].int ?? 0)]) + users.append(["Name": data.1["uname"].string ?? "[加载失败]", "Face": data.1["face"].string ?? "E", "Sign": data.1["sign"].string ?? "[加载失败]", "UID": String(data.1["mid"].int64 ?? 0)]) } } totalPage = respJson["data"]["total"].int ?? 0 / 20 + 1 diff --git a/DarockBili Watch App/Video/VideoCommentsView.swift b/DarockBili Watch App/Video/VideoCommentsView.swift index 321aab315..8d39c5d55 100644 --- a/DarockBili Watch App/Video/VideoCommentsView.swift +++ b/DarockBili Watch App/Video/VideoCommentsView.swift @@ -70,7 +70,6 @@ struct VideoCommentsView: View { var body: some View { ScrollView { LazyVStack { - #if swift(>=5.9) if #unavailable(watchOS 10) { Button(action: { isSendCommentPresented = true @@ -82,17 +81,6 @@ struct VideoCommentsView: View { }) .sheet(isPresented: $isSendCommentPresented, content: {CommentSendView(oid: oid)}) } - #else - Button(action: { - isSendCommentPresented = true - }, label: { - HStack { - Image(systemName: "square.and.pencil") - Text("发送评论") - } - }) - .sheet(isPresented: $isSendCommentPresented, content: {CommentSendView(oid: oid)}) - #endif if comments.count != 0 { ForEach(0...comments.count - 1, id: \.self) { i in VStack { diff --git a/DarockBili Watch App/Video/VideoDetailView.swift b/DarockBili Watch App/Video/VideoDetailView.swift index 3d3b0651a..2b7a91a21 100644 --- a/DarockBili Watch App/Video/VideoDetailView.swift +++ b/DarockBili Watch App/Video/VideoDetailView.swift @@ -313,7 +313,7 @@ struct VideoDetailView: View { if isSuccess { debugPrint("----------Prints from VideoDetailView.onAppear.*.requsetJSON(*/view)----------") debugPrint(respJson) - owner = ["Name": respJson["data"]["owner"]["name"].string ?? "[加载失败]", "Face": respJson["data"]["owner"]["face"].string ?? "E", "ID": String(respJson["data"]["owner"]["mid"].int ?? -1)] + owner = ["Name": respJson["data"]["owner"]["name"].string ?? "[加载失败]", "Face": respJson["data"]["owner"]["face"].string ?? "E", "ID": String(respJson["data"]["owner"]["mid"].int64 ?? -1)] stat = ["Like": String(respJson["data"]["stat"]["like"].int ?? -1), "Coin": String(respJson["data"]["stat"]["coin"].int ?? -1), "Favorite": String(respJson["data"]["stat"]["favorite"].int ?? -1)] videoDesc = respJson["data"]["desc"].string ?? "[加载失败]".replacingOccurrences(of: "\\n", with: "\n") for _ in 1...4 {