mirror of
https://github.com/cranci1/Sora.git
synced 2026-03-11 17:45:37 +00:00
boom shakalaka (#160)
* now if the user leaves mediainfoview on chunk 51-100 it will remember it and put him back the next time same with seasons * fixed memory leak from urldelegate --------- Co-authored-by: cranci <100066266+cranci1@users.noreply.github.com>
This commit is contained in:
parent
193b16fc8c
commit
a348c9a63a
2 changed files with 8 additions and 1 deletions
|
|
@ -111,7 +111,11 @@ extension JSContext {
|
|||
}
|
||||
}
|
||||
Logger.shared.log("Redirect value is \(redirect.boolValue)", type: "Error")
|
||||
let task = URLSession.fetchData(allowRedirects: redirect.boolValue).downloadTask(with: request) { tempFileURL, response, error in
|
||||
let session = URLSession.fetchData(allowRedirects: redirect.boolValue)
|
||||
|
||||
let task = session.downloadTask(with: request) { tempFileURL, response, error in
|
||||
defer { session.finishTasksAndInvalidate() }
|
||||
|
||||
let callReject: (String) -> Void = { message in
|
||||
DispatchQueue.main.async {
|
||||
reject.call(withArguments: [message])
|
||||
|
|
|
|||
|
|
@ -9,9 +9,12 @@ import Foundation
|
|||
|
||||
class FetchDelegate: NSObject, URLSessionTaskDelegate {
|
||||
private let allowRedirects: Bool
|
||||
|
||||
init(allowRedirects: Bool) {
|
||||
self.allowRedirects = allowRedirects
|
||||
}
|
||||
deinit { Logger.shared.log("FetchDelegate deallocated", type: "Debug")
|
||||
}
|
||||
|
||||
func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) {
|
||||
if(allowRedirects) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue