Sparse message list improvements

This commit is contained in:
Ali
2021-10-12 22:41:10 +04:00
parent 9ad9720707
commit 7c63fe30ea
23 changed files with 968 additions and 55 deletions

View File

@@ -36,7 +36,7 @@ public final class MeshAnimationCache {
let item = Item()
self.items[resource.id] = item
let path = self.mediaBox.cachedRepresentationPathForId(resource.id.stringRepresentation, representationId: "mesh-animation", keepDuration: .shortLived)
let path = self.mediaBox.cachedRepresentationPathForId(resource.id.stringRepresentation, representationId: "mesh-animation", keepDuration: .general)
if let data = try? Data(contentsOf: URL(fileURLWithPath: path)) {
let animation = MeshAnimation.read(buffer: MeshReadBuffer(data: data))
item.readyPath = path
@@ -68,7 +68,7 @@ public final class MeshAnimationCache {
if let animation = generateMeshAnimation(data: jsonData) {
let buffer = MeshWriteBuffer()
animation.write(buffer: buffer)
mediaBox.storeCachedResourceRepresentation(resource, representationId: "mesh-animation", keepDuration: .shortLived, data: buffer.makeData(), completion: { path in
mediaBox.storeCachedResourceRepresentation(resource, representationId: "mesh-animation", keepDuration: .general, data: buffer.makeData(), completion: { path in
subscriber.putNext((animation, path))
subscriber.putCompletion()
})