forked from shadowfacts/Tusker
Use development URLSession in more places
This commit is contained in:
parent
093994b474
commit
f2a9f890ff
|
@ -96,7 +96,7 @@ final class ImageCache: @unchecked Sendable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func fetch(url: URL) async -> FetchResult {
|
private func fetch(url: URL) async -> FetchResult {
|
||||||
guard let (data, _) = try? await URLSession.shared.data(from: url) else {
|
guard let (data, _) = try? await URLSession.appDefault.data(from: url) else {
|
||||||
return .none
|
return .none
|
||||||
}
|
}
|
||||||
guard let image = UIImage(data: data) else {
|
guard let image = UIImage(data: data) else {
|
||||||
|
|
|
@ -222,7 +222,7 @@ class ConversationViewController: UIViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isLikelyMastodonRemoteStatus(url: url),
|
if isLikelyMastodonRemoteStatus(url: url),
|
||||||
let (_, response) = try? await URLSession.shared.data(from: url, delegate: RedirectBlocker()),
|
let (_, response) = try? await URLSession.appDefault.data(from: url, delegate: RedirectBlocker()),
|
||||||
let location = (response as? HTTPURLResponse)?.value(forHTTPHeaderField: "location") {
|
let location = (response as? HTTPURLResponse)?.value(forHTTPHeaderField: "location") {
|
||||||
effectiveURL = location
|
effectiveURL = location
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -98,7 +98,7 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource {
|
||||||
case .unknown:
|
case .unknown:
|
||||||
return LoadingGalleryContentViewController(caption: nil) {
|
return LoadingGalleryContentViewController(caption: nil) {
|
||||||
do {
|
do {
|
||||||
let (data, _) = try await URLSession.shared.data(from: attachment.url)
|
let (data, _) = try await URLSession.appDefault.data(from: attachment.url)
|
||||||
let url = FileManager.default.temporaryDirectory.appendingPathComponent(attachment.url.lastPathComponent)
|
let url = FileManager.default.temporaryDirectory.appendingPathComponent(attachment.url.lastPathComponent)
|
||||||
try data.write(to: url)
|
try data.write(to: url)
|
||||||
return FallbackGalleryNavigationController(url: url)
|
return FallbackGalleryNavigationController(url: url)
|
||||||
|
|
|
@ -511,7 +511,7 @@ extension AttachmentView: UIContextMenuInteractionDelegate {
|
||||||
} else if self.attachment.kind == .gifv || self.attachment.kind == .video {
|
} else if self.attachment.kind == .gifv || self.attachment.kind == .video {
|
||||||
itemSource = VideoActivityItemSource(asset: AVAsset(url: self.attachment.url), url: self.attachment.url)
|
itemSource = VideoActivityItemSource(asset: AVAsset(url: self.attachment.url), url: self.attachment.url)
|
||||||
itemData = Task {
|
itemData = Task {
|
||||||
try? await URLSession.shared.data(from: self.attachment.url).0
|
try? await URLSession.appDefault.data(from: self.attachment.url).0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue