This commit is contained in:
cranci1 2025-06-25 10:58:16 +02:00
parent 9bafb790cf
commit 4b4bb0ad7b
2 changed files with 6 additions and 11 deletions

View file

@ -5,11 +5,11 @@
// Created by Francesco on 05/01/25. // Created by Francesco on 05/01/25.
// //
import JavaScriptCore
import Foundation
import SwiftUI
import AVKit import AVKit
import SwiftUI
import Foundation
import AVFoundation import AVFoundation
import JavaScriptCore
typealias Module = ScrapingModule typealias Module = ScrapingModule
@ -42,7 +42,6 @@ class JSController: NSObject, ObservableObject {
func setupContext() { func setupContext() {
context.setupJavaScriptEnvironment() context.setupJavaScriptEnvironment()
// Inject async Promise bridge for extractChapters with debug logging
let asyncChaptersHelper = """ let asyncChaptersHelper = """
function extractChaptersWithCallback(href, callback) { function extractChaptersWithCallback(href, callback) {
try { try {
@ -67,7 +66,6 @@ class JSController: NSObject, ObservableObject {
} }
""" """
context.evaluateScript(asyncChaptersHelper) context.evaluateScript(asyncChaptersHelper)
// Print JS exceptions to Xcode console
context.exceptionHandler = { context, exception in context.exceptionHandler = { context, exception in
print("[JS Exception]", exception?.toString() ?? "unknown") print("[JS Exception]", exception?.toString() ?? "unknown")
} }
@ -101,10 +99,6 @@ class JSController: NSObject, ObservableObject {
self?.processDownloadQueue() self?.processDownloadQueue()
} }
} }
} else {
Logger.shared.log("No queued downloads to process or queue is already being processed")
} }
} }
} }

View file

@ -244,7 +244,7 @@ struct SettingsViewPlayer: View {
icon: "pip", icon: "pip",
title: NSLocalizedString("Show PiP Button", comment: ""), title: NSLocalizedString("Show PiP Button", comment: ""),
isOn: $pipButtonVisible, isOn: $pipButtonVisible,
showDivider: false showDivider: true
) )
SettingsPickerRow( SettingsPickerRow(
@ -252,7 +252,8 @@ struct SettingsViewPlayer: View {
title: NSLocalizedString("Completion Percentage", comment: ""), title: NSLocalizedString("Completion Percentage", comment: ""),
options: [60.0, 70.0, 80.0, 90.0, 95.0, 100.0], options: [60.0, 70.0, 80.0, 90.0, 95.0, 100.0],
optionToString: { "\(Int($0))%" }, optionToString: { "\(Int($0))%" },
selection: $remainingTimePercentage selection: $remainingTimePercentage,
showDivider: false
) )
} }