mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
No need to search cache here
This commit is contained in:
@@ -1704,10 +1704,10 @@ public final class MediaBox {
|
|||||||
public func removeCachedResources(_ ids: [MediaResourceId], force: Bool = false, notify: Bool = false) -> Signal<Float, NoError> {
|
public func removeCachedResources(_ ids: [MediaResourceId], force: Bool = false, notify: Bool = false) -> Signal<Float, NoError> {
|
||||||
return Signal { subscriber in
|
return Signal { subscriber in
|
||||||
self.dataQueue.async {
|
self.dataQueue.async {
|
||||||
let uniqueIds = Set(ids.map { $0.stringRepresentation })
|
//let uniqueIds = Set(ids.map { $0.stringRepresentation })
|
||||||
var pathsToDelete: [String] = []
|
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) {
|
if let enumerator = FileManager.default.enumerator(at: URL(fileURLWithPath: "\(self.basePath)/\(cacheType)"), includingPropertiesForKeys: [], options: [.skipsSubdirectoryDescendants], errorHandler: nil) {
|
||||||
while let item = enumerator.nextObject() {
|
while let item = enumerator.nextObject() {
|
||||||
guard let url = item as? NSURL, let path = url.path, let fileName = url.lastPathComponent else {
|
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
|
var count: Int = 0
|
||||||
let totalCount = ids.count * 3 + pathsToDelete.count
|
let totalCount = ids.count * 3 + pathsToDelete.count
|
||||||
|
|||||||
Reference in New Issue
Block a user