summaryrefslogtreecommitdiff
path: root/playback
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-04-05 19:20:27 +0200
committerGitHub <noreply@github.com>2024-04-05 19:20:27 +0200
commit92ab575b150ab49ca85e0ac994558142e49c9e68 (patch)
tree422dcd76895a4ba06ed02723ff61351435c0fe49 /playback
parent2143ab135182434911d4554a8ef08115eaa0d2d0 (diff)
downloadAntennaPod-92ab575b150ab49ca85e0ac994558142e49c9e68.zip
Delete core module (#7060)
Diffstat (limited to 'playback')
-rw-r--r--playback/service/build.gradle2
-rw-r--r--playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java12
-rw-r--r--playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceTaskManager.java2
3 files changed, 7 insertions, 9 deletions
diff --git a/playback/service/build.gradle b/playback/service/build.gradle
index b8c47df8e..219565696 100644
--- a/playback/service/build.gradle
+++ b/playback/service/build.gradle
@@ -9,7 +9,6 @@ android {
}
dependencies {
- implementation project(':core')
implementation project(':event')
implementation project(':model')
implementation project(':net:common')
@@ -24,6 +23,7 @@ dependencies {
implementation project(':ui:i18n')
implementation project(':ui:notifications')
implementation project(':ui:widget')
+ implementation project(':ui:chapters')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.core:core:$coreVersion"
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
index dfcb67e51..8932a36d2 100644
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
@@ -77,9 +77,7 @@ import de.danoeh.antennapod.storage.preferences.SleepTimerPreferences;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.playback.service.internal.PlaybackServiceTaskManager.SleepTimer;
-import de.danoeh.antennapod.core.util.ChapterUtils;
-import de.danoeh.antennapod.core.util.FeedUtil;
-import de.danoeh.antennapod.core.util.IntentUtils;
+import de.danoeh.antennapod.ui.common.IntentUtils;
import de.danoeh.antennapod.net.common.NetworkUtils;
import de.danoeh.antennapod.event.MessageEvent;
import de.danoeh.antennapod.event.PlayerErrorEvent;
@@ -1147,9 +1145,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
// Delete episode if enabled
FeedPreferences.AutoDeleteAction action =
item.getFeed().getPreferences().getCurrentAutoDelete();
+ boolean autoDeleteEnabledGlobally = UserPreferences.isAutoDelete()
+ && (!item.getFeed().isLocalFeed() || UserPreferences.isAutoDeleteLocal());
boolean shouldAutoDelete = action == FeedPreferences.AutoDeleteAction.ALWAYS
- || (action == FeedPreferences.AutoDeleteAction.GLOBAL
- && FeedUtil.shouldAutoDeleteItemsOnThatFeed(item.getFeed()));
+ || (action == FeedPreferences.AutoDeleteAction.GLOBAL && autoDeleteEnabledGlobally);
if (shouldAutoDelete && (!item.isTagged(FeedItem.TAG_FAVORITE)
|| !UserPreferences.shouldFavoriteKeepEpisode())) {
DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media);
@@ -1889,8 +1888,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
return;
}
- int nextChapter = ChapterUtils.getCurrentChapterIndex(
- mediaPlayer.getPlayable(), mediaPlayer.getPosition()) + 1;
+ int nextChapter = Chapter.getAfterPosition(chapters, mediaPlayer.getPosition()) + 1;
if (chapters.size() < nextChapter + 1) {
// We are on the last chapter, just fallback to the next episode
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceTaskManager.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceTaskManager.java
index 71e68c873..e21499bba 100644
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceTaskManager.java
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceTaskManager.java
@@ -9,7 +9,7 @@ import android.util.Log;
import de.danoeh.antennapod.event.playback.SleepTimerUpdatedEvent;
import de.danoeh.antennapod.storage.preferences.SleepTimerPreferences;
-import de.danoeh.antennapod.core.util.ChapterUtils;
+import de.danoeh.antennapod.ui.chapters.ChapterUtils;
import de.danoeh.antennapod.ui.widget.WidgetUpdater;
import io.reactivex.disposables.Disposable;
import org.greenrobot.eventbus.EventBus;