diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-23 11:27:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 11:27:55 +0100 |
commit | f6b45e7162ce3909cb2b04a4124e71aad22240c6 (patch) | |
tree | 9aa8a0b64b399c99da4e8d82ad4dae146a10564f /model/src | |
parent | f20ce1fc690788273bb779663a4f3211f47a0973 (diff) | |
download | AntennaPod-f6b45e7162ce3909cb2b04a4124e71aad22240c6.zip |
Rename FeedMedia methods to no longer have underscores (#7017)
Diffstat (limited to 'model/src')
5 files changed, 25 insertions, 35 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java b/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java index 0ea7dd1b7..80ef8547f 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java +++ b/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java @@ -133,7 +133,7 @@ public class Feed { if (filter != null) { this.itemfilter = new FeedItemFilter(filter); } else { - this.itemfilter = new FeedItemFilter(new String[0]); + this.itemfilter = new FeedItemFilter(); } setSortOrder(sortOrder); this.lastUpdateFailed = lastUpdateFailed; @@ -455,22 +455,22 @@ public class Feed { return id; } - public String getFile_url() { + public String getLocalFileUrl() { return localFileUrl; } - public void setFile_url(String fileUrl) { + public void setLocalFileUrl(String fileUrl) { this.localFileUrl = fileUrl; if (fileUrl == null) { downloaded = false; } } - public String getDownload_url() { + public String getDownloadUrl() { return downloadUrl; } - public void setDownload_url(String downloadUrl) { + public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; } @@ -511,12 +511,6 @@ public class Feed { return itemfilter; } - public void setItemFilter(String[] properties) { - if (properties != null) { - this.itemfilter = new FeedItemFilter(properties); - } - } - @Nullable public SortOrder getSortOrder() { return sortOrder; diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java index 25ea9330c..9cc71eb1d 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java +++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java @@ -182,8 +182,8 @@ public class FeedItem implements Serializable { return itemIdentifier; } else if (title != null && !title.isEmpty()) { return title; - } else if (hasMedia() && media.getDownload_url() != null) { - return media.getDownload_url(); + } else if (hasMedia() && media.getDownloadUrl() != null) { + return media.getDownloadUrl(); } else { return link; } @@ -325,7 +325,7 @@ public class FeedItem implements Serializable { if (imageUrl != null) { return imageUrl; } else if (media != null && media.hasEmbeddedPicture()) { - return FeedMedia.FILENAME_PREFIX_EMBEDDED_COVER + media.getLocalMediaUrl(); + return FeedMedia.FILENAME_PREFIX_EMBEDDED_COVER + media.getLocalFileUrl(); } else if (feed != null) { return feed.getImageUrl(); } else { diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java index 9d9c2246a..7cd2d4953 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java +++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java @@ -239,7 +239,7 @@ public class FeedMedia implements Playable { return (CHECKED_ON_SIZE_BUT_UNKNOWN == this.size); } - public String getMime_type() { + public String getMimeType() { return mimeType; } @@ -355,7 +355,7 @@ public class FeedMedia implements Playable { } @Override - public String getLocalMediaUrl() { + public String getLocalFileUrl() { return localFileUrl; } @@ -364,6 +364,10 @@ public class FeedMedia implements Playable { return downloadUrl; } + public String getDownloadUrl() { + return downloadUrl; + } + public int getStartPosition() { return startPosition; } @@ -402,18 +406,10 @@ public class FeedMedia implements Playable { this.id = id; } - public String getFile_url() { - return localFileUrl; - } - public boolean isDownloaded() { return downloaded; } - public String getDownload_url() { - return downloadUrl; - } - public long getItemId() { return itemID; } @@ -470,7 +466,7 @@ public class FeedMedia implements Playable { if (item != null) { return item.getImageLocation(); } else if (hasEmbeddedPicture()) { - return FILENAME_PREFIX_EMBEDDED_COVER + getLocalMediaUrl(); + return FILENAME_PREFIX_EMBEDDED_COVER + getLocalFileUrl(); } else { return null; } @@ -487,9 +483,9 @@ public class FeedMedia implements Playable { } } - public void setFile_url(String file_url) { - this.localFileUrl = file_url; - if (file_url == null) { + public void setLocalFileUrl(String fileUrl) { + this.localFileUrl = fileUrl; + if (fileUrl == null) { downloaded = false; } } @@ -500,7 +496,7 @@ public class FeedMedia implements Playable { return; } try (MediaMetadataRetrieverCompat mmr = new MediaMetadataRetrieverCompat()) { - mmr.setDataSource(getLocalMediaUrl()); + mmr.setDataSource(getLocalFileUrl()); byte[] image = mmr.getEmbeddedPicture(); if (image != null) { hasEmbeddedPicture = Boolean.TRUE; diff --git a/model/src/main/java/de/danoeh/antennapod/model/playback/Playable.java b/model/src/main/java/de/danoeh/antennapod/model/playback/Playable.java index 30f37cf60..e48be9aec 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/playback/Playable.java +++ b/model/src/main/java/de/danoeh/antennapod/model/playback/Playable.java @@ -88,7 +88,7 @@ public interface Playable extends Parcelable, Serializable { * Returns an url to a local file that can be played or null if this file * does not exist. */ - String getLocalMediaUrl(); + String getLocalFileUrl(); /** * Returns an url to a file that can be streamed by the player or null if diff --git a/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java b/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java index d4d91c79c..8c3cd7ce4 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java +++ b/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java @@ -62,9 +62,9 @@ public class RemoteMedia implements Playable { } public RemoteMedia(FeedItem item) { - this.downloadUrl = item.getMedia().getDownload_url(); + this.downloadUrl = item.getMedia().getDownloadUrl(); this.itemIdentifier = item.getItemIdentifier(); - this.feedUrl = item.getFeed().getDownload_url(); + this.feedUrl = item.getFeed().getDownloadUrl(); this.feedTitle = item.getFeed().getTitle(); this.episodeTitle = item.getTitle(); this.episodeLink = item.getLink(); @@ -75,7 +75,7 @@ public class RemoteMedia implements Playable { this.imageUrl = item.getFeed().getImageUrl(); } this.feedLink = item.getFeed().getLink(); - this.mimeType = item.getMedia().getMime_type(); + this.mimeType = item.getMedia().getMimeType(); this.pubDate = item.getPubDate(); this.notes = item.getDescription(); } @@ -175,7 +175,7 @@ public class RemoteMedia implements Playable { } @Override - public String getLocalMediaUrl() { + public String getLocalFileUrl() { return null; } @@ -300,7 +300,7 @@ public class RemoteMedia implements Playable { return false; } Feed feed = fi.getFeed(); - return feed != null && TextUtils.equals(feedUrl, feed.getDownload_url()); + return feed != null && TextUtils.equals(feedUrl, feed.getDownloadUrl()); } return false; } |