mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix fetch
This commit is contained in:
parent
95fb0dda7b
commit
a7788b5ecf
@ -1110,7 +1110,8 @@ private final class NotificationServiceHandler {
|
||||
fetchResource = downloadNotificationSound.resource as? TelegramMultipartFetchableResource
|
||||
|
||||
if let resource = fetchResource {
|
||||
if let _ = strongSelf.stateManager?.postbox.mediaBox.completedResourcePath(resource) {
|
||||
if let path = strongSelf.stateManager?.postbox.mediaBox.completedResourcePath(resource), let data = try? Data(contentsOf: URL(fileURLWithPath: path)) {
|
||||
fetchNotificationSoundSignal = .single(data)
|
||||
} else {
|
||||
let intervals: Signal<[(Range<Int>, MediaBoxFetchPriority)], NoError> = .single([(0 ..< Int(Int32.max), MediaBoxFetchPriority.maximum)])
|
||||
fetchNotificationSoundSignal = Signal { subscriber in
|
||||
@ -1172,7 +1173,7 @@ private final class NotificationServiceHandler {
|
||||
if let notificationSoundData = notificationSoundData {
|
||||
Logger.shared.log("NotificationService \(episode)", "Did fetch notificationSoundData")
|
||||
|
||||
if let (_, filePath, fileName) = downloadNotificationSound {
|
||||
if let (_, filePath, _) = downloadNotificationSound {
|
||||
let _ = try? notificationSoundData.write(to: URL(fileURLWithPath: filePath))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user