marinofaggiana 5 years ago
parent
commit
62a5ae3e68
1 changed files with 8 additions and 2 deletions
  1. 8 2
      iOSClient/Networking/NCCommunication.swift

+ 8 - 2
iOSClient/Networking/NCCommunication.swift

@@ -92,8 +92,14 @@ class NCCommunication: NSObject {
                     let elements = xml["d:multistatus", "d:response"]
                     for element in elements {
                         let file = NCFile()
-                        if let href = element["d:href"].text { file.path = href.removingPercentEncoding ?? "" }
-                        if let getetag = element["d:getetag"].text { file.etag = getetag.replacingOccurrences(of: "\"", with: "")}
+                        if let href = element["d:href"].text {
+                            file.path = href.removingPercentEncoding ?? ""
+                        }
+                        let propstat = element["d:propstat"][0]
+                        if let getetag = propstat["d:prop", "d:getetag"].text {
+                            file.etag = getetag.replacingOccurrences(of: "\"", with: "")
+                        }
+                        
                         files.append(file)
                     }
                 }