Skip to content

Commit 58bcc54

Browse files
Merge pull request #17230 from nextcloud/previewUsesFileId
Preview endpoint only accepts fileId
2 parents fe38105 + 3682158 commit 58bcc54

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/com/nextcloud/utils/extensions/OwnCloudClientExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ fun OwnCloudClient.toNextcloudClient(context: Context): NextcloudClient = OwnClo
2121
isFollowRedirects
2222
)
2323

24-
fun OwnCloudClient.getPreviewEndpoint(remoteId: String, x: Int, y: Int): String = baseUri
24+
fun OwnCloudClient.getPreviewEndpoint(localFileId: Long, x: Int, y: Int): String = baseUri
2525
.toString() +
2626
"/index.php/core/preview?fileId=" +
27-
remoteId +
27+
localFileId +
2828
"&x=" + (x / 2) + "&y=" + (y / 2) +
2929
"&a=1&mode=cover&forceIcon=0"

app/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ public static Bitmap doResizedImageInBackground(OCFile file, FileDataStorageMana
12861286
GetMethod getMethod = null;
12871287

12881288
try {
1289-
String uri = OwnCloudClientExtensionsKt.getPreviewEndpoint(mClient, file.getRemoteId(), pxW, pxH);
1289+
String uri = OwnCloudClientExtensionsKt.getPreviewEndpoint(mClient, file.getLocalId(), pxW, pxH);
12901290
Log_OC.d(TAG, "generating resized image: " + file.getFileName() + " URI: " + uri);
12911291

12921292
getMethod = new GetMethod(uri);

0 commit comments

Comments
 (0)