Skip to content

Fix Space thumbnail preview URLs#174

Open
zerox80 wants to merge 1 commit into
opencloud-eu:mainfrom
zerox80:zerox80/fix-space-thumbnail-previews
Open

Fix Space thumbnail preview URLs#174
zerox80 wants to merge 1 commit into
opencloud-eu:mainfrom
zerox80:zerox80/fix-space-thumbnail-previews

Conversation

@zerox80
Copy link
Copy Markdown
Contributor

@zerox80 zerox80 commented May 24, 2026

Summary

Fixes #171.

This updates Android thumbnail preview URL generation so files inside Spaces use the Space WebDAV endpoint instead of the legacy /webdav path. Space files now resolve previews through /dav/spaces/{spaceId}/..., matching the backend thumbnail routes for SpacesThumbnail.

Root cause

ThumbnailsRequester always built file preview URLs as {baseUrl}/webdav{remotePath}?preview=1. That works for personal files, but images inside Space subfolders need to be requested via the Space WebDAV URL, e.g. /dav/spaces/{spaceId}/{folder}/image.jpg?preview=1.

Backend context: services/webdav/pkg/service/v0/service.go registers both /dav/spaces/{id} and /remote.php/dav/spaces/{id} for Space thumbnail requests.

Changes

  • Use OCFileWithSyncInfo.space.root.webDavUrl when available.
  • Fall back to {accountBaseUrl}/dav/spaces/{spaceId} for Space files without attached Space metadata.
  • Keep personal files on {accountBaseUrl}/webdav.
  • Add focused unit coverage for personal URLs, Space-root URLs, Space-ID fallback URLs, and encoded subfolder paths.

Validation

  • ./gradlew.bat :opencloudApp:testOriginalDebugUnitTest --tests eu.opencloud.android.presentation.thumbnails.ThumbnailsRequesterTest --no-daemon
  • ./gradlew.bat detekt --no-daemon
  • ./gradlew.bat assembleDebug --no-daemon

@zerox80 zerox80 marked this pull request as ready for review May 24, 2026 07:22
@zerox80 zerox80 force-pushed the zerox80/fix-space-thumbnail-previews branch from 8894208 to 5c49dae Compare May 24, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thumbnails not displayed for files in Space subfolders due to hardcoded /webdav/ path

1 participant