Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load media notification images using Coil #3566

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

MiSikora
Copy link
Contributor

@MiSikora MiSikora commented Feb 7, 2025

Description

This PR changes the source of files for the Media Notification. Previously, we were using two separate sources:

  1. Coil for general-purpose use of artwork inside the app.
  2. OkHttp to fetch images inside the Content Provider when the Media Notification requested images.

I removed the direct usage of OkHttp and ensured that Coil is always the source of truth. This has two main benefits:

  • Fewer network HTTP requests due to a shared cache.
  • Consistent podcast artwork. Previously, multiple caches could get out of sync, causing issues like Wrong artwork is shown on lockscreen & notification area #3564. For example, when we performed artwork cleanup from the Appearance settings, the OkHttp cache wasn’t cleared. It wasn’t even easy to do so since we didn’t use a custom directory for it.

Fixes #1529
Fixes #3564

Testing Instructions

General Behavior

Smoke test the general artwork behavior—custom file, episodes artwork, etc. Pay special attention to the Media Notification and the lock screen.

Cache Update

  1. Subscribe to my testing podcast.
  2. Play any episode.
  3. Pause playback.
  4. In Nodeweb, set a manual override for the podcast artwork.
  5. Refresh the Nodeweb page and ensure that the updated artwork is displayed.
  6. Return to the Android app.
  7. Go to Settings > Appearance > Refresh all podcast artwork.
  8. Wait a bit.
  9. Resume the episode.
  10. Verify that the Media Notification and the lock screen display the updated artwork.
    Note: The mini player artwork doesn’t refresh automatically, as the image is cached for the episode. If you play another episode, it should update there as well.
  11. Reset the artwork in Nodeweb.

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@MiSikora MiSikora added [Type] Bug Not functioning as intended. [Area] Artwork labels Feb 7, 2025
@MiSikora MiSikora added this to the 7.83 milestone Feb 7, 2025
@MiSikora MiSikora requested a review from a team as a code owner February 7, 2025 10:26
@MiSikora MiSikora requested review from geekygecko and removed request for a team February 7, 2025 10:26
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 7, 2025

📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
App Name 📱 Mobile
Build TypedebugProd
Commit975fca9
Direct Downloadpocketcasts-app-prototype-build-pr3566-975fca9.apk
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
App Name 🚗 Automotive
Build TypedebugProd
Commit975fca9
Direct Downloadpocketcasts-automotive-prototype-build-pr3566-975fca9.apk
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
App Name ⌚ Wear
Build TypedebugProd
Commit975fca9
Direct Downloadpocketcasts-wear-prototype-build-pr3566-975fca9.apk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Area] Artwork [Type] Bug Not functioning as intended.
Projects
None yet
2 participants