mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 05:26:48 +00:00
Fixed wallpaper representations upgrade
This commit is contained in:
parent
d76ae96f0c
commit
b6e2e46264
@ -139,8 +139,16 @@ public func upgradedAccounts(accountManager: AccountManager, rootPath: String) -
|
|||||||
if let path = mediaBox.completedResourcePath(file.file.resource), let data = try? Data(contentsOf: URL(fileURLWithPath: path), options: .mappedRead) {
|
if let path = mediaBox.completedResourcePath(file.file.resource), let data = try? Data(contentsOf: URL(fileURLWithPath: path), options: .mappedRead) {
|
||||||
accountManager.mediaBox.storeResourceData(file.file.resource.id, data: data)
|
accountManager.mediaBox.storeResourceData(file.file.resource.id, data: data)
|
||||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedScaledImageRepresentation(size: CGSize(width: 720.0, height: 720.0), mode: .aspectFit), complete: true, fetch: true).start()
|
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedScaledImageRepresentation(size: CGSize(width: 720.0, height: 720.0), mode: .aspectFit), complete: true, fetch: true).start()
|
||||||
|
if file.isPattern {
|
||||||
|
if let color = file.settings.color, let intensity = file.settings.intensity {
|
||||||
|
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedPatternWallpaperRepresentation(color: color, intensity: intensity), complete: true, fetch: true).start()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if file.settings.blur {
|
||||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedBlurredWallpaperRepresentation(), complete: true, fetch: true).start()
|
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedBlurredWallpaperRepresentation(), complete: true, fetch: true).start()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case let .image(representations, _):
|
case let .image(representations, _):
|
||||||
for representation in representations {
|
for representation in representations {
|
||||||
let resource = representation.resource
|
let resource = representation.resource
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user