From 687db0f5ed13ab0ee4e3a9c09f85359d987a13c0 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 5 Apr 2024 20:08:25 +0200 Subject: Merge :net:sync:model and :net:sync:service-interface (#7063) --- .../java/de/danoeh/antennapod/storage/database/DBWriter.java | 10 +++------- .../danoeh/antennapod/storage/database/FeedDatabaseWriter.java | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'storage/database/src/main') diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/DBWriter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/DBWriter.java index 3866b7ec1..a9c4f4dc3 100644 --- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/DBWriter.java +++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/DBWriter.java @@ -36,7 +36,6 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.event.FavoritesEvent; import de.danoeh.antennapod.event.FeedItemEvent; import de.danoeh.antennapod.event.FeedListUpdateEvent; -import de.danoeh.antennapod.event.MessageEvent; import de.danoeh.antennapod.event.playback.PlaybackHistoryEvent; import de.danoeh.antennapod.event.QueueEvent; import de.danoeh.antennapod.event.UnreadItemsUpdateEvent; @@ -50,7 +49,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.model.feed.SortOrder; import de.danoeh.antennapod.model.playback.Playable; -import de.danoeh.antennapod.net.sync.model.EpisodeAction; +import de.danoeh.antennapod.net.sync.serviceinterface.EpisodeAction; /** * Provides methods for writing data to AntennaPod's database. @@ -114,8 +113,7 @@ public class DBWriter { // Local feed DocumentFile documentFile = DocumentFile.fromSingleUri(context, Uri.parse(media.getLocalFileUrl())); if (documentFile == null || !documentFile.exists() || !documentFile.delete()) { - EventBus.getDefault().post(new MessageEvent(context.getString(R.string.delete_local_failed))); - return false; + Log.d(TAG, "Deletion of local file failed."); } media.setLocalFileUrl(null); localDelete = true; @@ -123,9 +121,7 @@ public class DBWriter { // delete downloaded media file File mediaFile = new File(media.getLocalFileUrl()); if (mediaFile.exists() && !mediaFile.delete()) { - MessageEvent evt = new MessageEvent(context.getString(R.string.delete_failed)); - EventBus.getDefault().post(evt); - return false; + Log.d(TAG, "Deletion of downloaded file failed."); } media.setDownloaded(false); media.setLocalFileUrl(null); diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/FeedDatabaseWriter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/FeedDatabaseWriter.java index 6429c3cb5..0a61007aa 100644 --- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/FeedDatabaseWriter.java +++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/FeedDatabaseWriter.java @@ -11,7 +11,7 @@ import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedItemFilter; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.model.feed.SortOrder; -import de.danoeh.antennapod.net.sync.model.EpisodeAction; +import de.danoeh.antennapod.net.sync.serviceinterface.EpisodeAction; import de.danoeh.antennapod.net.sync.serviceinterface.SynchronizationQueueSink; import de.danoeh.antennapod.storage.preferences.UserPreferences; import org.greenrobot.eventbus.EventBus; -- cgit v1.2.3