Initial downloads list implementation

This commit is contained in:
Ali
2022-02-11 23:49:38 +04:00
parent e87cf3710f
commit c8bc4b7f12
39 changed files with 816 additions and 139 deletions

View File

@@ -7,6 +7,17 @@ protocol TelegramCloudMediaResource: TelegramMediaResource {
func apiInputLocation(fileReference: Data?) -> Api.InputFileLocation?
}
public func extractMediaResourceDebugInfo(resource: MediaResource) -> String? {
if let resource = resource as? TelegramCloudMediaResource {
guard let inputLocation = resource.apiInputLocation(fileReference: nil) else {
return nil
}
return String(describing: inputLocation)
} else {
return nil
}
}
public protocol TelegramMultipartFetchableResource: TelegramMediaResource {
var datacenterId: Int { get }
}