Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Handle non-JSON v3 file URL 404s

Neeraj Guptab401f3e6efe0
diff --git a/mobile/apps/photos/changes/legacy-museum-file-url-404.md b/mobile/apps/photos/changes/legacy-museum-file-url-404.md
new file mode 100644
index 0000000000..6cd0ac74b3
--- /dev/null
+++ b/mobile/apps/photos/changes/legacy-museum-file-url-404.md
@@ -0,0 +1 @@
+- Fixed remote photos not loading on older self-hosted Ente servers.
diff --git a/mobile/apps/photos/lib/module/download/file_url.dart b/mobile/apps/photos/lib/module/download/file_url.dart
index a87f99275d..73afc4ab4e 100644
--- a/mobile/apps/photos/lib/module/download/file_url.dart
+++ b/mobile/apps/photos/lib/module/download/file_url.dart
@@ -29,7 +29,7 @@ class FileUrl {
return null;
}
- final response = await dio.get<Map<String, dynamic>>(
+ final response = await dio.get<Object?>(
_v3Path(fileID, type),
options: Options(
headers: headers,
@@ -43,7 +43,7 @@ class FileUrl {
_v3RetryAfter = DateTime.now().add(_v3RetryDelay);
return null;
}
- return response.data!["url"] as String;
+ return (response.data as Map<String, dynamic>)["url"] as String;
}
static String getLegacyUrl(int fileID, FileUrlType type) {