changed the "Use Episode Cover" setting to only apply to list items. (#4908)

This commit is contained in:
Geist5000 2021-02-15 16:04:03 +01:00 committed by GitHub
parent 394122dade
commit aaeea78b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 10 deletions

View File

@ -164,7 +164,7 @@ public class CoverFragment extends Fragment {
new RoundedCorners((int) (16 * getResources().getDisplayMetrics().density)));
RequestBuilder<Drawable> cover = Glide.with(this)
.load(ImageResourceUtils.getImageLocation(media))
.load(ImageResourceUtils.getEpisodeImageLocation(media))
.error(Glide.with(this)
.load(ImageResourceUtils.getFallbackImageLocation(media))
.apply(options))

View File

@ -206,7 +206,7 @@ public class ExternalPlayerFragment extends Fragment {
.dontAnimate();
Glide.with(getActivity())
.load(ImageResourceUtils.getImageLocation(media))
.load(ImageResourceUtils.getEpisodeListImageLocation(media))
.error(Glide.with(getActivity())
.load(ImageResourceUtils.getFallbackImageLocation(media))
.apply(options))

View File

@ -299,7 +299,7 @@ public class ItemFragment extends Fragment {
.dontAnimate();
Glide.with(getActivity())
.load(ImageResourceUtils.getImageLocation(item))
.load(ImageResourceUtils.getEpisodeImageLocation(item))
.error(Glide.with(getActivity())
.load(ImageResourceUtils.getFallbackImageLocation(item))
.apply(options))

View File

@ -121,7 +121,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
if (coverHolder.getVisibility() == View.VISIBLE) {
new CoverLoader(activity)
.withUri(ImageResourceUtils.getImageLocation(item))
.withUri(ImageResourceUtils.getEpisodeListImageLocation(item))
.withFallbackUri(item.getFeed().getImageLocation())
.withPlaceholderView(placeholder)
.withCoverView(cover)

View File

@ -13,7 +13,18 @@ public final class ImageResourceUtils {
private ImageResourceUtils() {
}
public static String getImageLocation(ImageResource resource) {
/**
* returns the image location, does prefer the episode cover if available.
*/
public static String getEpisodeImageLocation(ImageResource resource) {
return resource.getImageLocation();
}
/**
* returns the image location, does prefer the episode cover if available and enabled in settings.
*/
public static String getEpisodeListImageLocation(ImageResource resource) {
if (UserPreferences.getUseEpisodeCoverSetting()) {
return resource.getImageLocation();

View File

@ -113,7 +113,7 @@ public class NewEpisodesNotification {
try {
return Glide.with(context)
.asBitmap()
.load(ImageResourceUtils.getImageLocation(feed))
.load(ImageResourceUtils.getEpisodeListImageLocation(feed))
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.apply(new RequestOptions().centerCrop())
.submit(iconSize, iconSize)

View File

@ -1306,7 +1306,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, p.getEpisodeTitle());
builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE, p.getFeedTitle());
String imageLocation = ImageResourceUtils.getImageLocation(p);
String imageLocation = ImageResourceUtils.getEpisodeImageLocation(p);
if (!TextUtils.isEmpty(imageLocation)) {
if (UserPreferences.setLockscreenBackground()) {

View File

@ -75,7 +75,7 @@ public class PlaybackServiceNotificationBuilder {
try {
icon = Glide.with(context)
.asBitmap()
.load(ImageResourceUtils.getImageLocation(playable))
.load(ImageResourceUtils.getEpisodeImageLocation(playable))
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.apply(new RequestOptions().centerCrop())
.submit(iconSize, iconSize)

View File

@ -90,7 +90,7 @@ public abstract class WidgetUpdater {
try {
icon = Glide.with(context)
.asBitmap()
.load(ImageResourceUtils.getImageLocation(widgetState.media))
.load(ImageResourceUtils.getEpisodeImageLocation(widgetState.media))
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.submit(iconSize, iconSize)
.get(500, TimeUnit.MILLISECONDS);

View File

@ -457,7 +457,7 @@
<string name="pref_episode_cache_title">Episode Cache</string>
<string name="pref_episode_cache_summary">Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached.</string>
<string name="pref_episode_cover_title">Use Episode Cover</string>
<string name="pref_episode_cover_summary">Use the episode specific cover whenever available. If unchecked, the app will always use the podcast cover image.</string>
<string name="pref_episode_cover_summary">Use the episode specific cover in lists whenever available. If unchecked, the app will always use the podcast cover image.</string>
<string name="pref_show_remain_time_title">Show Remaining Time</string>
<string name="pref_show_remain_time_summary">Display remaining time of episodes when checked. If unchecked, display total duration of episodes.</string>
<string name="pref_theme_title_use_system">Use system theme</string>