From 08f49fdaad7cf4037c42754bc18945e040eda7ab Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 13 Feb 2023 21:26:12 +0400 Subject: [PATCH] No need to search cache here --- submodules/Postbox/Sources/MediaBox.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/submodules/Postbox/Sources/MediaBox.swift b/submodules/Postbox/Sources/MediaBox.swift index 287bb9c68f..43d72b141c 100644 --- a/submodules/Postbox/Sources/MediaBox.swift +++ b/submodules/Postbox/Sources/MediaBox.swift @@ -1704,10 +1704,10 @@ public final class MediaBox { public func removeCachedResources(_ ids: [MediaResourceId], force: Bool = false, notify: Bool = false) -> Signal { return Signal { subscriber in self.dataQueue.async { - let uniqueIds = Set(ids.map { $0.stringRepresentation }) - var pathsToDelete: [String] = [] + //let uniqueIds = Set(ids.map { $0.stringRepresentation }) + let pathsToDelete: [String] = [] - for cacheType in ["cache", "short-cache"] { + /*for cacheType in ["cache", "short-cache"] { if let enumerator = FileManager.default.enumerator(at: URL(fileURLWithPath: "\(self.basePath)/\(cacheType)"), includingPropertiesForKeys: [], options: [.skipsSubdirectoryDescendants], errorHandler: nil) { while let item = enumerator.nextObject() { guard let url = item as? NSURL, let path = url.path, let fileName = url.lastPathComponent else { @@ -1722,7 +1722,7 @@ public final class MediaBox { } } } - } + }*/ var count: Int = 0 let totalCount = ids.count * 3 + pathsToDelete.count