Skip to content

Commit

Permalink
修复视频可能重复下载的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
WindowsMEMZ authored May 27, 2024
1 parent 83fdea6 commit f6e70c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MeowBili/Video/VideoDownloadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct VideoDownloadView: View {
@AppStorage("SESSDATA") var sessdata = ""
@AppStorage("bili_jct") var biliJct = ""
@State var isLoading = true
@State var isInitialized = false
var body: some View {
NavigationStack {
List {
Expand Down Expand Up @@ -65,6 +66,10 @@ struct VideoDownloadView: View {
}
}
.onAppear {
if isInitialized {
return
}
isInitialized = true
DispatchQueue(label: "com.darock.DarockBili.VideoDownload", qos: .background).async {
let headers: HTTPHeaders = [
"cookie": "SESSDATA=\(sessdata)",
Expand Down

0 comments on commit f6e70c9

Please sign in to comment.