Print more episode details in error message

This commit is contained in:
ByteHamster 2022-01-03 14:37:45 +01:00
parent 413df73495
commit cc5e04102c
1 changed files with 12 additions and 8 deletions

View File

@ -435,10 +435,9 @@ public final class DBTasks {
item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false, item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false,
"The podcast host appears to have added the same episode twice. " "The podcast host appears to have added the same episode twice. "
+ "AntennaPod still refreshed the feed and attempted to repair it." + "AntennaPod still refreshed the feed and attempted to repair it."
+ "{" + possibleDuplicate.getTitle() + "} with ID " + "\n\nOriginal episode:\n" + duplicateEpisodeDetails(item)
+ possibleDuplicate.getItemIdentifier() + "\n\nSecond episode that is also in the feed:\n"
+ " seems to be the same as {" + item.getTitle() + "} with ID " + duplicateEpisodeDetails(possibleDuplicate), false));
+ item.getItemIdentifier(), false));
continue; continue;
} }
@ -451,10 +450,9 @@ public final class DBTasks {
item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false, item.getTitle(), DownloadError.ERROR_PARSER_EXCEPTION_DUPLICATE, false,
"The podcast host changed the ID of an existing episode instead of just " "The podcast host changed the ID of an existing episode instead of just "
+ "updating the episode itself. AntennaPod still refreshed the feed and " + "updating the episode itself. AntennaPod still refreshed the feed and "
+ "attempted to repair it.\n\n" + "attempted to repair it."
+ "{" + oldItem.getTitle() + "} with ID " + oldItem.getItemIdentifier() + "\n\nOriginal episode:\n" + duplicateEpisodeDetails(oldItem)
+ " seems to be the same as {" + item.getTitle() + "} with ID " + "\n\nNow the feed contains:\n" + duplicateEpisodeDetails(item), false));
+ item.getItemIdentifier(), false));
oldItem.setItemIdentifier(item.getItemIdentifier()); oldItem.setItemIdentifier(item.getItemIdentifier());
if (oldItem.isPlayed() && oldItem.getMedia() != null) { if (oldItem.isPlayed() && oldItem.getMedia() != null) {
@ -542,6 +540,12 @@ public final class DBTasks {
return resultFeed; 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. * Searches the FeedItems of a specific Feed for a given string.
* *