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.
.doOnCompleted {
cancelProgressNotification()
if (newUpdates.isNotEmpty()) {
showResultNotification(newUpdates)
if (downloadNew && hasDownloads) {
@ -300,6 +299,8 @@ class LibraryUpdateService(
if (failedUpdates.isNotEmpty()) {
Timber.e("Failed updating: ${failedUpdates.map { it.title }}")
}
cancelProgressNotification()
}
}
@ -389,10 +390,11 @@ class LibraryUpdateService(
if (previousNotification != null) {
val oldUpdates = previousNotification.notification.extras
.getString(Notification.EXTRA_BIG_TEXT, "")
.split("\n")
.getString(Notification.EXTRA_BIG_TEXT)
newUpdates += oldUpdates
if (!oldUpdates.isNullOrEmpty()) {
newUpdates += oldUpdates.split("\n")
}
}
}