diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImage.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImage.kt index 02d537c7c6d..4087cd88fb9 100644 --- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImage.kt +++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImage.kt @@ -1,6 +1,8 @@ package au.com.shiftyjelly.pocketcasts.repositories.images +import android.content.Context import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.utils.Util object PodcastImage { @@ -31,7 +33,9 @@ object PodcastImage { return String.format(STATIC_ARTWORK_JPG_URL, Settings.SERVER_STATIC_URL, size, uuid) } - fun getLargeArtworkUrl(uuid: String): String { - return getArtworkUrl(960, uuid) + fun getLargeArtworkUrl(uuid: String, context: Context): String { + // The watch's smaller screen does not need such large images + val size = if (Util.isWearOs(context)) 480 else 960 + return getArtworkUrl(size, uuid) } } diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImageLoader.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImageLoader.kt index 05604bebb6f..4fc5b727458 100644 --- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImageLoader.kt +++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImageLoader.kt @@ -84,7 +84,11 @@ open class PodcastImageLoader( fun loadCoil(podcastUuid: String?, size: Int? = null, placeholder: Boolean = true, onComplete: () -> Unit = {}): ImageRequest.Builder { if (podcastUuid == null) return loadNoPodcastCoil() - val url = if (size != null) PodcastImage.getArtworkUrl(size = size, uuid = podcastUuid) else PodcastImage.getLargeArtworkUrl(uuid = podcastUuid) + val url = if (size != null) { + PodcastImage.getArtworkUrl(size = size, uuid = podcastUuid) + } else { + PodcastImage.getLargeArtworkUrl(uuid = podcastUuid, context = context) + } val placeholderDrawable = if (placeholder) placeholderResId() else 0 var builder = ImageRequest.Builder(context) @@ -184,7 +188,7 @@ open class PodcastImageLoader( private fun cacheSubscribedArtworkRequest(podcast: Podcast): ImageRequest { return ImageRequest.Builder(context) - .data(PodcastImage.getLargeArtworkUrl(podcast.uuid)) + .data(PodcastImage.getLargeArtworkUrl(uuid = podcast.uuid, context = context)) .memoryCachePolicy(CachePolicy.DISABLED) .build() }