marinofaggiana 3 years ago
parent
commit
f7ee4b9c44

+ 3 - 0
iOSClient/NCGlobal.swift

@@ -168,6 +168,9 @@ class NCGlobal: NSObject {
     let certificateTmp                              = "tmp.der"
     let certificateTmpV2                            = "certificatetmp.der"
     
+    // Extension
+    @objc let extensionPreview                      = "ico"
+    
     // ContentPresenter
     //
     @objc let dismissAfterSecond: TimeInterval      = 4

+ 2 - 2
iOSClient/Utility/CCUtility.m

@@ -1147,12 +1147,12 @@
 
 + (NSString *)getDirectoryProviderStorageIconOcId:(NSString *)ocId etag:(NSString *)etag
 {
-    return [NSString stringWithFormat:@"%@/%@.small.ico", [self getDirectoryProviderStorageOcId:ocId], etag];
+    return [NSString stringWithFormat:@"%@/%@.small.%@", [self getDirectoryProviderStorageOcId:ocId], etag, [NCGlobal shared].extensionPreview];
 }
 
 + (NSString *)getDirectoryProviderStoragePreviewOcId:(NSString *)ocId etag:(NSString *)etag
 {
-    return [NSString stringWithFormat:@"%@/%@.preview.ico", [self getDirectoryProviderStorageOcId:ocId], etag];
+    return [NSString stringWithFormat:@"%@/%@.preview.%@", [self getDirectoryProviderStorageOcId:ocId], etag, [NCGlobal shared].extensionPreview];
 }
 
 + (BOOL)fileProviderStorageExists:(NSString *)ocId fileNameView:(NSString *)fileNameView

+ 1 - 1
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -277,7 +277,7 @@ class NCUtilityFileSystem: NSObject {
                     if let date = CCUtility.getATime(fileURL.path) {
                         if attributes[.size] as? Double == 0 { continue }
                         if attributes[.type] as? FileAttributeType == FileAttributeType.typeDirectory { continue }
-                        if fileURL.pathExtension == "ico" { continue }
+                        if fileURL.pathExtension == NCGlobal.shared.extensionPreview { continue }
                         if meetsRequirement(date: date) {
                             let folderURL = fileURL.deletingLastPathComponent()
                             let ocId = folderURL.lastPathComponent