Skip to content

fix(artwork): resolve server-relative artwork URLs #306

Closed

Description

@Quick104

Local artwork storage returns signed root-relative URLs such as /api/v2/artwork/posters/example.jpg?exp=...&sig=.... The shared image component currently passes artwork strings directly to Coil, and the shared image loader has no server-relative URL mapping. These URLs need the supplying server's origin before the network request.

Resolve root-relative artwork URLs centrally, preserving the encoded path and signature query. Keep absolute S3 URLs unchanged and associate each resolved request with the server that supplied its data. Cover both phone and TV consumers, including direct image requests outside the shared component.

Relevant source files:

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/ui/components/ThumbhashImage.kt: builds ImageRequest with .data(url).
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/images/SiloImageLoader.kt: shared Coil configuration currently registers the network fetcher without a relative-URL mapper.
  • shared/src/androidMain/kotlin/org/siloserver/silo/network/SiloOkHttp.kt: artwork's imageClient has no base-URL resolution.
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/MediaRow.kt: builds a backdrop request directly with .data(backdropUrl).
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/cast/SiloCastOverlay.kt: also uses AsyncImage; include its artwork input in the audit.
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SiloPlayerFactory.kt: passes artwork into setArtworkUri; verify this input reaches an absolute URL too.

Add a session-scoped GET /api/v2/images/capabilities probe and decode optional storage_backend (local or s3) and delivery (server or direct). No existing image-capability probe was found in shared Kotlin sources. Older responses without these fields must remain usable; resolve returned relative URLs independently of probe timing.

Test relative signed URLs, encoded keys, absolute S3 URLs, absent capability fields, and switching between servers with identical relative keys. Verify phone and TV posters/backdrops on local storage and S3. Root-relative paths resolve from the URL origin; do not append them beneath a configured base path. Confirm media-session artwork uses the same resolution and that external image requests receive no Silo login credentials.

Source inspection identified these gaps; client device reproduction remains part of the follow-up.

Related issue: Silo-Server/silo-server#935

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions