Skip to content

fix: square thumbnail not turn back after off#279

Merged
koiverse merged 1 commit intokoiverse:devfrom
sang765:fix/square-thumbnail
Feb 7, 2026
Merged

fix: square thumbnail not turn back after off#279
koiverse merged 1 commit intokoiverse:devfrom
sang765:fix/square-thumbnail

Conversation

@sang765
Copy link
Copy Markdown
Contributor

@sang765 sang765 commented Feb 1, 2026

Description

Fixed an issue where video thumbnails (from YouTube) were not properly reverting to their natural 16:9 aspect ratio when the "Crop thumbnail to 1:1" setting was disabled.

Changes

  • Updated ItemThumbnail and LocalThumbnail components in Items.kt:
    • Changed contentScale of AsyncImage to be conditional:
      • ContentScale.Crop when the square crop should be applied.
      • ContentScale.Fit when the square crop should not be applied (allowing 16:9 images to be letterboxed instead of cropped).
    • Renamed the internal variable shouldCropSquare to shouldApplySquareCrop for better clarity.
    • Maintained the conditional aspectRatio(1f) modifier on the image to ensure correct layout within the 1:1 container.

These changes ensure that YouTube video thumbnails are displayed correctly according to the user's preference, while non-video thumbnails remain unaffected by the toggle. This also aligns the implementation with the pattern already used in the player's Thumbnail.kt.

Verification Checklist

  • Video thumbnails display in 1:1 with cropped content when "Crop to 1:1" is enabled.
  • Video thumbnails display in 1:1 with 16:9 content (letterboxed) when "Crop to 1:1" is disabled.
  • Non-video thumbnails are unaffected by the setting (remain consistent).
  • The cropThumbnailToSquare preference works correctly and updates the UI immediately.
  • Player thumbnails continue to work as expected.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved thumbnail scaling behavior to conditionally apply crop or fit scaling based on square-crop settings, ensuring thumbnails display correctly across different contexts.

@koiverse koiverse merged commit 92adcd1 into koiverse:dev Feb 7, 2026
1 check passed
@sang765 sang765 deleted the fix/square-thumbnail branch February 7, 2026 15:50
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.

2 participants