diff options
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java | 23 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java index 7c8fe9452..7b7879409 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java @@ -109,6 +109,23 @@ public class DownloadServiceNotification { return sb.toString(); } + private String createFailedDownloadNotificationContent(List<DownloadStatus> statuses) { + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < statuses.size(); i++) { + if (statuses.get(i).isSuccessful()) { + continue; + } + sb.append("• ").append(statuses.get(i).getTitle()); + sb.append(": ").append(statuses.get(i).getReason().getErrorString(context)); + if (i != statuses.size() - 1) { + sb.append("\n"); + } + } + + return sb.toString(); + } + /** * Creates a notification at the end of the service lifecycle to notify the * user about the number of completed downloads. A report will only be @@ -156,11 +173,7 @@ public class DownloadServiceNotification { iconId = R.drawable.ic_notification_sync_error; intent = ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context); id = R.id.notification_download_report; - content = context.getResources() - .getQuantityString(R.plurals.download_report_content, - successfulDownloads, - successfulDownloads, - failedDownloads); + content = createFailedDownloadNotificationContent(reportQueue); } NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 8f89a7792..f05251cfb 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -276,10 +276,6 @@ </plurals> <string name="service_shutting_down">Service shutting down</string> <string name="download_notification_title">Downloading podcast data</string> - <plurals name="download_report_content"> - <item quantity="one">%d download succeeded, %d failed</item> - <item quantity="other">%d downloads succeeded, %d failed</item> - </plurals> <string name="download_log_title_unknown">Unknown Title</string> <string name="download_type_feed">Feed</string> <string name="download_type_media">Media file</string> |