summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2022-01-03 14:37:45 +0100
committerByteHamster <info@bytehamster.com>2022-01-03 14:37:45 +0100
commitcc5e04102cac9fb57fa58e784f6922f0d8a80535 (patch)
treea3f6b4153c60d60db067abc8a530d1300993bb04
parent413df734953dbfbaffac312745f7a467c3ec41ff (diff)
downloadantennapod-cc5e04102cac9fb57fa58e784f6922f0d8a80535.zip
Print more episode details in error message
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
index 412914329..c60a2a4b6 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
@@ -435,10 +435,9 @@ public final class DBTasks {
item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false,
"The podcast host appears to have added the same episode twice. "
+ "AntennaPod still refreshed the feed and attempted to repair it."
- + "{" + possibleDuplicate.getTitle() + "} with ID "
- + possibleDuplicate.getItemIdentifier()
- + " seems to be the same as {" + item.getTitle() + "} with ID "
- + item.getItemIdentifier(), false));
+ + "\n\nOriginal episode:\n" + duplicateEpisodeDetails(item)
+ + "\n\nSecond episode that is also in the feed:\n"
+ + duplicateEpisodeDetails(possibleDuplicate), false));
continue;
}
@@ -451,10 +450,9 @@ public final class DBTasks {
item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false,
"The podcast host changed the ID of an existing episode instead of just "
+ "updating the episode itself. AntennaPod still refreshed the feed and "
- + "attempted to repair it.\n\n"
- + "{" + oldItem.getTitle() + "} with ID " + oldItem.getItemIdentifier()
- + " seems to be the same as {" + item.getTitle() + "} with ID "
- + item.getItemIdentifier(), false));
+ + "attempted to repair it."
+ + "\n\nOriginal episode:\n" + duplicateEpisodeDetails(oldItem)
+ + "\n\nNow the feed contains:\n" + duplicateEpisodeDetails(item), false));
oldItem.setItemIdentifier(item.getItemIdentifier());
if (oldItem.isPlayed() && oldItem.getMedia() != null) {
@@ -542,6 +540,12 @@ public final class DBTasks {
return resultFeed;
}
+ private static String duplicateEpisodeDetails(FeedItem item) {
+ return "Title: " + item.getTitle()
+ + "\nID: " + item.getItemIdentifier()
+ + ((item.getMedia() == null) ? "" : "\nURL: " + item.getMedia().getDownload_url());
+ }
+
/**
* Searches the FeedItems of a specific Feed for a given string.
*