diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/RemoteMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/RemoteMedia.java index 7de1a7812..5a9afaeaf 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/RemoteMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/RemoteMedia.java @@ -27,18 +27,18 @@ public class RemoteMedia implements Playable { public static final int PLAYABLE_TYPE_REMOTE_MEDIA = 3; - private String downloadUrl; - private String itemIdentifier; - private String feedUrl; - private String feedTitle; - private String episodeTitle; - private String episodeLink; - private String feedAuthor; - private String imageUrl; - private String feedLink; - private String mimeType; - private Date pubDate; - private String notes; + private final String downloadUrl; + private final String itemIdentifier; + private final String feedUrl; + private final String feedTitle; + private final String episodeTitle; + private final String episodeLink; + private final String feedAuthor; + private final String imageUrl; + private final String feedLink; + private final String mimeType; + private final Date pubDate; + private final String notes; private List chapters; private int duration; private int position; @@ -46,7 +46,8 @@ public class RemoteMedia implements Playable { public RemoteMedia(String downloadUrl, String itemId, String feedUrl, String feedTitle, String episodeTitle, String episodeLink, String feedAuthor, - String imageUrl, String feedLink, String mimeType, Date pubDate) { + String imageUrl, String feedLink, String mimeType, Date pubDate, + String notes) { this.downloadUrl = downloadUrl; this.itemIdentifier = itemId; this.feedUrl = feedUrl; @@ -58,6 +59,7 @@ public class RemoteMedia implements Playable { this.feedLink = feedLink; this.mimeType = mimeType; this.pubDate = pubDate; + this.notes = notes; } public RemoteMedia(FeedItem item) { @@ -68,14 +70,15 @@ public class RemoteMedia implements Playable { this.episodeTitle = item.getTitle(); this.episodeLink = item.getLink(); this.feedAuthor = item.getFeed().getAuthor(); - this.imageUrl = item.getImageUrl(); + if (!TextUtils.isEmpty(item.getImageUrl())) { + this.imageUrl = item.getImageUrl(); + } else { + this.imageUrl = item.getFeed().getImageUrl(); + } this.feedLink = item.getFeed().getLink(); this.mimeType = item.getMedia().getMime_type(); this.pubDate = item.getPubDate(); - } - - public void setNotes(String notes) { - this.notes = notes; + this.notes = item.getDescription(); } public String getEpisodeIdentifier() { @@ -294,8 +297,7 @@ public class RemoteMedia implements Playable { public RemoteMedia createFromParcel(Parcel in) { RemoteMedia result = new RemoteMedia(in.readString(), in.readString(), in.readString(), in.readString(), in.readString(), in.readString(), in.readString(), in.readString(), - in.readString(), in.readString(), new Date(in.readLong())); - result.setNotes(in.readString()); + in.readString(), in.readString(), new Date(in.readLong()), in.readString()); result.setDuration(in.readInt()); result.setPosition(in.readInt()); result.setLastPlayedTime(in.readLong()); diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java index ab638b568..2c9772298 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java @@ -225,6 +225,7 @@ public class CastUtils { if (!imageList.isEmpty()) { imageUrl = imageList.get(0).getUrl().toString(); } + String notes = metadata.getString(KEY_EPISODE_NOTES); result = new RemoteMedia(media.getContentId(), metadata.getString(KEY_EPISODE_IDENTIFIER), metadata.getString(KEY_FEED_URL), @@ -235,11 +236,8 @@ public class CastUtils { imageUrl, metadata.getString(KEY_FEED_WEBSITE), media.getContentType(), - metadata.getDate(MediaMetadata.KEY_RELEASE_DATE).getTime()); - String notes = metadata.getString(KEY_EPISODE_NOTES); - if (!TextUtils.isEmpty(notes)) { - ((RemoteMedia) result).setNotes(notes); - } + metadata.getDate(MediaMetadata.KEY_RELEASE_DATE).getTime(), + notes); Log.d(TAG, "Converted MediaInfo into RemoteMedia"); } if (result.getDuration() == 0 && media.getStreamDuration() > 0) {