diff options
author | quails4Eva <dpetchey@gmail.com> | 2024-03-03 19:17:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-03 20:17:22 +0100 |
commit | 60f3d77eb2d41d49ad6fd999c39f5792f804a17e (patch) | |
tree | 63482639471c4a6c3592663477519af9fdcd6ec0 /model/src/main | |
parent | 3c77d43e76535465ef5c9976835d42439797fd8f (diff) | |
download | AntennaPod-60f3d77eb2d41d49ad6fd999c39f5792f804a17e.zip |
Skip silence setting per feed (#6910)
Diffstat (limited to 'model/src/main')
-rw-r--r-- | model/src/main/java/de/danoeh/antennapod/model/feed/FeedPreferences.java | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedPreferences.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedPreferences.java index 39b6e2bdd..02f09693e 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedPreferences.java +++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedPreferences.java @@ -59,6 +59,25 @@ public class FeedPreferences implements Serializable { } } + public enum SkipSilence { + OFF(0), GLOBAL(1), AGGRESSIVE(2); + + public final int code; + + SkipSilence(int code) { + this.code = code; + } + + public static SkipSilence fromCode(int code) { + for (SkipSilence s : values()) { + if (s.code == code) { + return s; + } + } + return GLOBAL; + } + } + @NonNull private FeedFilter filter; private long feedID; @@ -72,6 +91,7 @@ public class FeedPreferences implements Serializable { private float feedPlaybackSpeed; private int feedSkipIntro; private int feedSkipEnding; + private SkipSilence feedSkipSilence; private boolean showEpisodeNotification; private final Set<String> tags = new HashSet<>(); @@ -79,13 +99,14 @@ public class FeedPreferences implements Serializable { VolumeAdaptionSetting volumeAdaptionSetting, NewEpisodesAction newEpisodesAction, String username, String password) { this(feedID, autoDownload, true, autoDeleteAction, volumeAdaptionSetting, username, password, - new FeedFilter(), SPEED_USE_GLOBAL, 0, 0, false, newEpisodesAction, new HashSet<>()); + new FeedFilter(), SPEED_USE_GLOBAL, 0, 0, SkipSilence.GLOBAL, + false, newEpisodesAction, new HashSet<>()); } public FeedPreferences(long feedID, boolean autoDownload, boolean keepUpdated, AutoDeleteAction autoDeleteAction, VolumeAdaptionSetting volumeAdaptionSetting, String username, String password, @NonNull FeedFilter filter, - float feedPlaybackSpeed, int feedSkipIntro, int feedSkipEnding, + float feedPlaybackSpeed, int feedSkipIntro, int feedSkipEnding, SkipSilence feedSkipSilence, boolean showEpisodeNotification, NewEpisodesAction newEpisodesAction, Set<String> tags) { this.feedID = feedID; @@ -99,6 +120,7 @@ public class FeedPreferences implements Serializable { this.feedPlaybackSpeed = feedPlaybackSpeed; this.feedSkipIntro = feedSkipIntro; this.feedSkipEnding = feedSkipEnding; + this.feedSkipSilence = feedSkipSilence; this.showEpisodeNotification = showEpisodeNotification; this.newEpisodesAction = newEpisodesAction; this.tags.addAll(tags); @@ -241,6 +263,14 @@ public class FeedPreferences implements Serializable { return feedSkipEnding; } + public void setFeedSkipSilence(SkipSilence skipSilence) { + feedSkipSilence = skipSilence; + } + + public SkipSilence getFeedSkipSilence() { + return feedSkipSilence; + } + public Set<String> getTags() { return tags; } |