Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DarockBili.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
8CA7CCBC2B77B40B008E587F /* VideoPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPlayerView.swift; sourceTree = "<group>"; };
8CA7CCC02B77B44E008E587F /* VideoDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoDownloadView.swift; sourceTree = "<group>"; };
8CA7CCC22B77B45F008E587F /* VideoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoDetailView.swift; sourceTree = "<group>"; };
8CA7CCC42B77B47A008E587F /* AudioPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioPlayerView.swift; sourceTree = "<group>"; };
8CA7CCC42B77B47A008E587F /* AudioPlayerView.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = AudioPlayerView.swift; sourceTree = "<group>"; };
8CA7CCC72B77B49D008E587F /* ImageViewerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewerView.swift; sourceTree = "<group>"; };
8CA7CCC92B77B4B2008E587F /* UserDynamicMainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDynamicMainView.swift; sourceTree = "<group>"; };
8CA7CCCB2B77B4CA008E587F /* DynamicDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicDetailView.swift; sourceTree = "<group>"; };
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -9892,6 +9892,16 @@
}
}
},
"快进 %llds" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "%llds Backward"
}
}
}
},
"快进 10 秒" : {
"localizations" : {
"en" : {
Expand All @@ -9902,6 +9912,16 @@
}
}
},
"快退 %llds" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "%llds Forward"
}
}
}
},
"快退 10 秒" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -9993,6 +10013,7 @@
}
},
"手记建议" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
Expand Down Expand Up @@ -11326,4 +11347,4 @@
}
},
"version" : "1.0"
}
}
12 changes: 12 additions & 0 deletions MeowBili/MeowBiliApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
++:+++=:.:::..:::::-*==+**###############*+=:::---+%--=======================--+++++#++++**+-:::::::
+++++=::::..--:::::-##*++=++***##***++=+*===+*****%=-=========================-++++**++**+--------::




Xcode哥😭,求你了🙏别把fatal往main抛,闭包,精确到闭包就行求你了🙏我在也不跑了哥,我真的太痒了,求你了,我听话,我以后再也不闹了🤐,求你了哥,给我定位到闭包吧,我现在身体痒的要死😫,求求你了🙏,哥,你就最后再给我一次吧我求求你了🙏哥,你要什么我都给你,你再给我一集🤌就好,我现在身体里像是有蚂蚁在爬😫,太痒了 哥,给我一集吧,最后一次,我发誓✋,真的是最后一次了
| main
|
Expand Down Expand Up @@ -389,7 +392,7 @@
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Task {
do {
try await COKChecker.shared.appStartupAutoCheck()

Check notice on line 395 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L395

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
let manager = RKCFeedbackManager(projectName: "喵哩喵哩")
let feedbackIds = UserDefaults.standard.stringArray(forKey: "RadarFBIDs") ?? [String]()
for id in feedbackIds {
Expand All @@ -399,9 +402,9 @@
if _slowPath(lastReply.isInternalHidden),
let state = lastReply.UpdateCorvusState,
state == "true" {
try await COKUpdater.shared.updateCOStatus(true)

Check notice on line 405 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L405

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
COKChecker.shared._applyWatermarkNow()

Check notice on line 406 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L406

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
COKChecker.shared.cachedCheckStatus = true

Check notice on line 407 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L407

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
break
}
}
Expand Down Expand Up @@ -433,7 +436,7 @@

Task {
do {
try await COKChecker.shared.appStartupAutoCheck()

Check notice on line 439 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L439

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
let manager = RKCFeedbackManager(projectName: "喵哩喵哩")
let feedbackIds = UserDefaults.standard.stringArray(forKey: "RadarFBIDs") ?? [String]()
for id in feedbackIds {
Expand All @@ -443,9 +446,9 @@
if _slowPath(lastReply.isInternalHidden),
let state = lastReply.UpdateCorvusState,
state == "true" {
try await COKUpdater.shared.updateCOStatus(true)

Check notice on line 449 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L449

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
COKChecker.shared._applyWatermarkNow()

Check notice on line 450 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L450

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
COKChecker.shared.cachedCheckStatus = true

Check notice on line 451 in MeowBili/MeowBiliApp.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/MeowBiliApp.swift#L451

'shared' is deprecated: Shared instance has been deprecated, use init(caller:) instead.
break
}
}
Expand All @@ -469,3 +472,12 @@
}
}
}


func _currentGlobalSystemTime() -> String {
let currentDate = Date()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "HH:mm:ss"
let formattedDate = dateFormatter.string(from: currentDate)
return formattedDate
}
119 changes: 98 additions & 21 deletions MeowBili/Video/AudioPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@AppStorage("DedeUserID__ckMd5") var dedeUserID__ckMd5 = ""
@AppStorage("SESSDATA") var sessdata = ""
@AppStorage("bili_jct") var biliJct = ""
@AppStorage("isFastFowardUsedBefore") var isFastFowardUsedBefore = false
@Namespace var coverScaleNamespace
@State var currentPlaybackTime = globalAudioPlayer.currentTime().seconds
@State var currentItemTotalTime = 0.0
Expand All @@ -46,30 +47,101 @@
@State var playbackBehavior = PlaybackBehavior.pause
@State var backgroundImageUrl: URL?
@State var videoName = ""
@State var backwardTaps = 0
@State var backwardTapsSnapshot = 0
@State var forwardTaps = 0 //双击屏幕右侧的点击计数器
@State var forwardTapsSnapshop = 0
@State var forwardTimer: Timer?
@State var backwardTimer: Timer?
var body: some View {
NavigationStack {
ZStack {
if let backgroundImageUrl {
WebImage(url: backgroundImageUrl, options: [.progressiveLoad, .scaleDownLargeImages])
.placeholder {
RoundedRectangle(cornerRadius: 14)
.frame(width: 120, height: 80)
.foregroundColor(Color(hex: 0x3D3D3D))
.redacted(reason: .placeholder)
HStack {
Rectangle()
.frame(width: 45)
.opacity(kViewMinimumRenderableOpacity)
.onTapGesture(perform: {
if currentPlaybackTime - 10 > 0 {
forwardTaps = 0
backwardTaps += 1
backwardTapsSnapshot = backwardTaps
if backwardTaps > 1 {
globalAudioPlayer.seek(to: CMTime(seconds: currentPlaybackTime - 10, preferredTimescale: 60000),
toleranceBefore: .zero,
toleranceAfter: .zero)
}
}
})
Spacer()
Rectangle()
.frame(width: 45)
.opacity(kViewMinimumRenderableOpacity)
.onTapGesture(perform: {
if currentPlaybackTime + 10 < currentItemTotalTime {
backwardTaps = 0
forwardTaps += 1
forwardTapsSnapshop = forwardTaps
if forwardTaps > 1 {
globalAudioPlayer.seek(to: CMTime(seconds: currentPlaybackTime + 10, preferredTimescale: 60000),
toleranceBefore: .zero,
toleranceAfter: .zero)
}
}
})
}
.ignoresSafeArea(.container)
.frame(height: 120)
.offset(y: -20)
.onChange(of: forwardTaps, perform: { value in

Check notice on line 95 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L95

Unused Closure Parameter Violation: Unused parameter in a closure should be replaced with _ (unused_closure_parameter)

Check notice on line 95 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L95

'onChange(of:perform:)' was deprecated in watchOS 10.0: Use `onChange` with a two or zero parameter action closure instead.
if forwardTaps != 0 {
forwardTimer?.invalidate()
forwardTimer = Timer.scheduledTimer(withTimeInterval: 0.75, repeats: false) { value in

Check notice on line 98 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L98

Unused Closure Parameter Violation: Unused parameter in a closure should be replaced with _ (unused_closure_parameter)
if forwardTapsSnapshop == forwardTaps {
forwardTaps = 0
}
forwardTapsSnapshop = forwardTaps
}
.resizable()
.cornerRadius(10)
.scaledToFit()
.frame(width: 120, height: 80)
.shadow(color: .black.opacity(0.5), radius: 5, x: 1, y: 2)
.offset(y: -24)
} else {
RoundedRectangle(cornerRadius: 14)
.frame(width: 120, height: 80)
.foregroundColor(Color(hex: 0x3D3D3D))
.redacted(reason: .placeholder)
.offset(y: -24)
}
})
.onChange(of: backwardTaps, perform: { value in

Check notice on line 106 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L106

'onChange(of:perform:)' was deprecated in watchOS 10.0: Use `onChange` with a two or zero parameter action closure instead.

Check notice on line 106 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L106

Unused Closure Parameter Violation: Unused parameter in a closure should be replaced with _ (unused_closure_parameter)
if backwardTaps != 0 {
backwardTimer?.invalidate()
backwardTimer = Timer.scheduledTimer(withTimeInterval: 0.75, repeats: false) { _ in
// if forwardTapsSnapshop == forwardTaps {
// forwardTaps = 0
// }
if backwardTapsSnapshot == backwardTaps {
backwardTaps = 0
}
// forwardTapsSnapshop = forwardTaps

}
}
})
Group {
if let backgroundImageUrl {
WebImage(url: backgroundImageUrl, options: [.progressiveLoad, .scaleDownLargeImages])
.placeholder {
RoundedRectangle(cornerRadius: 14)
.frame(width: 120, height: 80)
.foregroundColor(Color(hex: 0x3D3D3D))
.redacted(reason: .placeholder)
}
.resizable()
.cornerRadius(10)
.scaledToFit()
.frame(width: 120, height: 80)
.shadow(color: .black.opacity(0.5), radius: 5, x: 1, y: 2)
.offset(y: -24)
} else {
RoundedRectangle(cornerRadius: 14)
.frame(width: 120, height: 80)
.foregroundColor(Color(hex: 0x3D3D3D))
.redacted(reason: .placeholder)
.offset(y: -24)
}
}

// Audio Controls
VStack {
Spacer()
Expand Down Expand Up @@ -136,6 +208,11 @@
if isPlaying {
globalAudioPlayer.pause()
} else {
if currentItemTotalTime == currentPlaybackTime {
globalAudioPlayer.seek(to: CMTime(seconds: 0, preferredTimescale: 60000),
toleranceBefore: .zero,
toleranceAfter: .zero)
}
globalAudioPlayer.play()
}
}, label: {
Expand Down Expand Up @@ -165,7 +242,7 @@
}
.ignoresSafeArea()
}
.navigationTitle(videoName)
.navigationTitle(backwardTaps > 1 ? (Text("快退 \(10*(backwardTaps-1))s")) : (forwardTaps > 1 ? Text("快进 \(10*(forwardTaps-1))s") : Text(videoName)))
.modifier(BlurBackground(imageUrl: backgroundImageUrl))
}
.onAppear {
Expand Down Expand Up @@ -224,7 +301,7 @@
Circle()
.fill(Color.gray)
.scaleEffect(configuration.isPressed ? 0.9 : 1)
.opacity(configuration.isPressed ? 0.4 : 0.0100000002421438702673861521)
.opacity(configuration.isPressed ? 0.4 : kViewMinimumRenderableOpacity)
configuration.label
.scaleEffect(configuration.isPressed ? 0.9 : 1)
}
Expand Down Expand Up @@ -338,7 +415,7 @@
globalAudioPlayer.seek(to: .zero)
globalAudioPlayer.play()
}
}

Check notice on line 418 in MeowBili/Video/AudioPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/AudioPlayerView.swift#L418

Closure End Indentation Violation: Closure end should have the same indentation as the line that started it; expected 4, got 8 (closure_end_indentation)
}

enum PlaybackBehavior: String {
Expand Down