Browse Source

fix cache video proxy

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 3 years ago
parent
commit
a9fa06a58c

+ 1 - 0
iOSClient/AppDelegate.swift

@@ -606,6 +606,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         if serverVersionMajor > 0 {
             NCCommunicationCommon.shared.setup(nextcloudVersion: serverVersionMajor)
         }
+        NCKTVHTTPCache.shared.restartProxy(user: user, password: password)
     }
 
     @objc func deleteAccount(_ account: String, wipe: Bool) {

+ 1 - 1
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -429,7 +429,7 @@ class NCPlayer: NSObject {
             if error == nil {
                 NCManageDatabase.shared.addLocalFile(metadata: self.metadata)
                 let urlVideo = NCKTVHTTPCache.shared.getVideoURL(metadata: self.metadata)
-                if let url = urlVideo.url, self.metadata.ocId == self.detailView?.metadata?.ocId {
+                if let url = urlVideo.url {
                     self.url = url
                     self.isProxy = urlVideo.isProxy
                     if requiredConvert {

+ 0 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -156,7 +156,6 @@ class NCViewerMedia: UIViewController {
 
         if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
 
-            NCKTVHTTPCache.shared.restartProxy(user: appDelegate.user, password: appDelegate.password)
             let urlVideo = NCKTVHTTPCache.shared.getVideoURL(metadata: metadata)
 
             if let url = urlVideo.url {