summaryrefslogtreecommitdiff
path: root/model/src
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-03-24 21:08:06 +0100
committerGitHub <noreply@github.com>2024-03-24 21:08:06 +0100
commit4078b3475e5140e6f5f9ef924bc8ff8d9e345113 (patch)
tree46c619e1f35649f504af8789ff61d98d2a29e6d0 /model/src
parent7b390f1c9299d644ad0339e83724e1457c150410 (diff)
downloadAntennaPod-4078b3475e5140e6f5f9ef924bc8ff8d9e345113.zip
Simplify playback preferences and move to :storage:preferences (#7024)
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java14
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/playback/Playable.java9
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java6
3 files changed, 0 insertions, 29 deletions
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 571cbc128..698cdf34e 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
@@ -1,7 +1,6 @@
package de.danoeh.antennapod.model.feed;
import android.content.Context;
-import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
@@ -23,9 +22,6 @@ public class FeedMedia implements Playable {
public static final int PLAYABLE_TYPE_FEEDMEDIA = 1;
public static final String FILENAME_PREFIX_EMBEDDED_COVER = "metadata-retriever:";
- public static final String PREF_MEDIA_ID = "FeedMedia.PrefMediaId";
- private static final String PREF_FEED_ID = "FeedMedia.PrefFeedId";
-
/**
* Indicates we've checked on the size of the item via the network
* and got an invalid response. Using Integer.MIN_VALUE because
@@ -304,16 +300,6 @@ public class FeedMedia implements Playable {
}
@Override
- public void writeToPreferences(Editor prefEditor) {
- if (item != null && item.getFeed() != null) {
- prefEditor.putLong(PREF_FEED_ID, item.getFeed().getId());
- } else {
- prefEditor.putLong(PREF_FEED_ID, 0L);
- }
- prefEditor.putLong(PREF_MEDIA_ID, id);
- }
-
- @Override
public String getEpisodeTitle() {
if (item == null) {
return null;
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 e48be9aec..8bf1c4e20 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
@@ -1,7 +1,6 @@
package de.danoeh.antennapod.model.playback;
import android.content.Context;
-import android.content.SharedPreferences;
import android.os.Parcelable;
import androidx.annotation.Nullable;
@@ -18,14 +17,6 @@ public interface Playable extends Parcelable, Serializable {
int INVALID_TIME = -1;
/**
- * Save information about the playable in a preference so that it can be
- * restored later via PlaybackPreferences.createInstanceFromPreferences.
- * Implementations must NOT call commit() after they have written the values
- * to the preferences file.
- */
- void writeToPreferences(SharedPreferences.Editor prefEditor);
-
- /**
* Returns the title of the episode that this playable represents
*/
String getEpisodeTitle();
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 8c3cd7ce4..b963f3de1 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
@@ -1,7 +1,6 @@
package de.danoeh.antennapod.model.playback;
import android.content.Context;
-import android.content.SharedPreferences;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@@ -121,11 +120,6 @@ public class RemoteMedia implements Playable {
}
@Override
- public void writeToPreferences(SharedPreferences.Editor prefEditor) {
- //it seems pointless to do it, since the session should be kept by the remote device.
- }
-
- @Override
public String getEpisodeTitle() {
return episodeTitle;
}