Cancel library progress notification after posting the result

This commit is contained in:
inorichi 2017-03-29 09:17:53 +02:00
parent e9a6f8ef46
commit 8ef3ab0d49

View file

@ -289,7 +289,6 @@ class LibraryUpdateService(
} }
// Notify result of the overall update. // Notify result of the overall update.
.doOnCompleted { .doOnCompleted {
cancelProgressNotification()
if (newUpdates.isNotEmpty()) { if (newUpdates.isNotEmpty()) {
showResultNotification(newUpdates) showResultNotification(newUpdates)
if (downloadNew && hasDownloads) { if (downloadNew && hasDownloads) {
@ -300,6 +299,8 @@ class LibraryUpdateService(
if (failedUpdates.isNotEmpty()) { if (failedUpdates.isNotEmpty()) {
Timber.e("Failed updating: ${failedUpdates.map { it.title }}") Timber.e("Failed updating: ${failedUpdates.map { it.title }}")
} }
cancelProgressNotification()
} }
} }
@ -389,10 +390,11 @@ class LibraryUpdateService(
if (previousNotification != null) { if (previousNotification != null) {
val oldUpdates = previousNotification.notification.extras val oldUpdates = previousNotification.notification.extras
.getString(Notification.EXTRA_BIG_TEXT, "") .getString(Notification.EXTRA_BIG_TEXT)
.split("\n")
newUpdates += oldUpdates if (!oldUpdates.isNullOrEmpty()) {
newUpdates += oldUpdates.split("\n")
}
} }
} }