Jul 14 - Using CDN - update

This commit is contained in:
Nguyen Ngo
2026-07-14 15:40:16 -04:00
parent 6fbd3d1437
commit 2a0b264a5c
8 changed files with 162 additions and 49 deletions
+13 -4
View File
@@ -497,9 +497,13 @@ struct IssueDetailView: View {
// Resolution Photos (server-side, read display)
if !issue.resultPhotoServerPaths.isEmpty {
Section("Resolution Photos (\(issue.resultPhotoServerPaths.count))") {
ForEach(issue.resultPhotoServerPaths, id: \.self) { relativePath in
let paths = issue.resultPhotoServerPaths
let urls = issue.resultPhotoServerUrls
ForEach(paths.indices, id: \.self) { idx in
RetryablePhotoView(
url: URL(string: ServerConfig.current + "/static/" + relativePath)
url: ServerConfig.mediaURL(
absolute: idx < urls.count ? urls[idx] : nil,
path: paths[idx])
)
}
}
@@ -571,9 +575,13 @@ struct IssueDetailView: View {
// Synced: show server photos only
if !issue.photoServerPaths.isEmpty {
Section("Photos (\(issue.photoServerPaths.count))") {
ForEach(issue.photoServerPaths, id: \.self) { relativePath in
let paths = issue.photoServerPaths
let urls = issue.photoServerUrls
ForEach(paths.indices, id: \.self) { idx in
RetryablePhotoView(
url: URL(string: ServerConfig.current + "/static/" + relativePath)
url: ServerConfig.mediaURL(
absolute: idx < urls.count ? urls[idx] : nil,
path: paths[idx])
)
}
}
@@ -748,6 +756,7 @@ struct IssueDetailView: View {
// Refresh resolution photos from server
if !detail.resultPhotos.isEmpty {
issue.resultPhotoServerPaths = detail.resultPhotos
issue.resultPhotoServerUrls = detail.resultPhotoUrls
}
try? context.save()
} catch {