|
|
@ -81,7 +81,6 @@ class LibraryUpdateService(
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private var subscription: Subscription? = null
|
|
|
|
private var subscription: Subscription? = null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Pending intent of action that cancels the library update
|
|
|
|
* Pending intent of action that cancels the library update
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -108,14 +107,19 @@ class LibraryUpdateService(
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Cached progress notification to avoid creating a lot.
|
|
|
|
* Cached progress notification to avoid creating a lot.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private val progressNotification by lazy { NotificationCompat.Builder(this, Notifications.CHANNEL_LIBRARY)
|
|
|
|
private val progressNotification by lazy {
|
|
|
|
|
|
|
|
NotificationCompat.Builder(this, Notifications.CHANNEL_LIBRARY)
|
|
|
|
.setContentTitle(getString(R.string.app_name))
|
|
|
|
.setContentTitle(getString(R.string.app_name))
|
|
|
|
.setSmallIcon(R.drawable.ic_refresh_white_24dp_img)
|
|
|
|
.setSmallIcon(R.drawable.ic_refresh_white_24dp_img)
|
|
|
|
.setLargeIcon(notificationBitmap)
|
|
|
|
.setLargeIcon(notificationBitmap)
|
|
|
|
.setOngoing(true)
|
|
|
|
.setOngoing(true)
|
|
|
|
.setOnlyAlertOnce(true)
|
|
|
|
.setOnlyAlertOnce(true)
|
|
|
|
.setColor(ContextCompat.getColor(this, R.color.colorAccent))
|
|
|
|
.setColor(ContextCompat.getColor(this, R.color.colorAccent))
|
|
|
|
.addAction(R.drawable.ic_clear_grey_24dp_img, getString(android.R.string.cancel), cancelIntent)
|
|
|
|
.addAction(
|
|
|
|
|
|
|
|
R.drawable.ic_clear_grey_24dp_img,
|
|
|
|
|
|
|
|
getString(android.R.string.cancel),
|
|
|
|
|
|
|
|
cancelIntent
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -172,8 +176,7 @@ class LibraryUpdateService(
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
context.startForegroundService(intent)
|
|
|
|
context.startForegroundService(intent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (target == Target.CHAPTERS) category?.id?.let {
|
|
|
|
if (target == Target.CHAPTERS) category?.id?.let {
|
|
|
|
instance?.addCategory(it)
|
|
|
|
instance?.addCategory(it)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -212,7 +215,8 @@ class LibraryUpdateService(
|
|
|
|
val selectedScheme = preferences.libraryUpdatePrioritization().getOrDefault()
|
|
|
|
val selectedScheme = preferences.libraryUpdatePrioritization().getOrDefault()
|
|
|
|
val mangas =
|
|
|
|
val mangas =
|
|
|
|
getMangaToUpdate(categoryId, Target.CHAPTERS).sortedWith(
|
|
|
|
getMangaToUpdate(categoryId, Target.CHAPTERS).sortedWith(
|
|
|
|
rankingScheme[selectedScheme])
|
|
|
|
rankingScheme[selectedScheme]
|
|
|
|
|
|
|
|
)
|
|
|
|
categoryIds.add(categoryId)
|
|
|
|
categoryIds.add(categoryId)
|
|
|
|
addManga(mangas)
|
|
|
|
addManga(mangas)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -228,9 +232,9 @@ class LibraryUpdateService(
|
|
|
|
var listToUpdate = if (categoryId != -1) {
|
|
|
|
var listToUpdate = if (categoryId != -1) {
|
|
|
|
categoryIds.add(categoryId)
|
|
|
|
categoryIds.add(categoryId)
|
|
|
|
db.getLibraryMangas().executeAsBlocking().filter { it.category == categoryId }
|
|
|
|
db.getLibraryMangas().executeAsBlocking().filter { it.category == categoryId }
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
val categoriesToUpdate =
|
|
|
|
val categoriesToUpdate = preferences.libraryUpdateCategories().getOrDefault().map(String::toInt)
|
|
|
|
preferences.libraryUpdateCategories().getOrDefault().map(String::toInt)
|
|
|
|
categoryIds.addAll(categoriesToUpdate)
|
|
|
|
categoryIds.addAll(categoriesToUpdate)
|
|
|
|
if (categoriesToUpdate.isNotEmpty())
|
|
|
|
if (categoriesToUpdate.isNotEmpty())
|
|
|
|
db.getLibraryMangas().executeAsBlocking()
|
|
|
|
db.getLibraryMangas().executeAsBlocking()
|
|
|
@ -259,7 +263,8 @@ class LibraryUpdateService(
|
|
|
|
super.onCreate()
|
|
|
|
super.onCreate()
|
|
|
|
startForeground(Notifications.ID_LIBRARY_PROGRESS, progressNotification.build())
|
|
|
|
startForeground(Notifications.ID_LIBRARY_PROGRESS, progressNotification.build())
|
|
|
|
wakeLock = (getSystemService(Context.POWER_SERVICE) as PowerManager).newWakeLock(
|
|
|
|
wakeLock = (getSystemService(Context.POWER_SERVICE) as PowerManager).newWakeLock(
|
|
|
|
PowerManager.PARTIAL_WAKE_LOCK, "LibraryUpdateService:WakeLock")
|
|
|
|
PowerManager.PARTIAL_WAKE_LOCK, "LibraryUpdateService:WakeLock"
|
|
|
|
|
|
|
|
)
|
|
|
|
wakeLock.acquire(TimeUnit.MINUTES.toMillis(30))
|
|
|
|
wakeLock.acquire(TimeUnit.MINUTES.toMillis(30))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -307,41 +312,44 @@ class LibraryUpdateService(
|
|
|
|
val mangaList =
|
|
|
|
val mangaList =
|
|
|
|
getMangaToUpdate(intent, target).sortedWith(rankingScheme[selectedScheme])
|
|
|
|
getMangaToUpdate(intent, target).sortedWith(rankingScheme[selectedScheme])
|
|
|
|
// Update favorite manga. Destroy service when completed or in case of an error.
|
|
|
|
// Update favorite manga. Destroy service when completed or in case of an error.
|
|
|
|
if (target == Target.CHAPTERS) {
|
|
|
|
if (target == Target.DETAILS) {
|
|
|
|
updateChapters(mangaList, startId)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
// Update either chapter list or manga details.
|
|
|
|
// Update either chapter list or manga details.
|
|
|
|
subscription = Observable.defer {
|
|
|
|
subscription = Observable.defer {
|
|
|
|
when (target) {
|
|
|
|
updateDetails(mangaList)
|
|
|
|
Target.DETAILS -> updateDetails(mangaList)
|
|
|
|
|
|
|
|
else -> updateTrackings(mangaList)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.subscribeOn(Schedulers.io()).subscribe({}, {
|
|
|
|
}.subscribeOn(Schedulers.io()).subscribe({}, {
|
|
|
|
Timber.e(it)
|
|
|
|
Timber.e(it)
|
|
|
|
stopSelf(startId)
|
|
|
|
stopSelf(startId)
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
stopSelf(startId)
|
|
|
|
stopSelf(startId)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
launchTarget(target, mangaList, startId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return START_REDELIVER_INTENT
|
|
|
|
return START_REDELIVER_INTENT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun updateChapters(mangaToAdd: List<LibraryManga>, startId: Int) {
|
|
|
|
private fun launchTarget(target: Target, mangaToAdd: List<LibraryManga>, startId: Int) {
|
|
|
|
val handler = CoroutineExceptionHandler { _, exception ->
|
|
|
|
val handler = CoroutineExceptionHandler { _, exception ->
|
|
|
|
Timber.e(exception)
|
|
|
|
Timber.e(exception)
|
|
|
|
// Boolean to determine if user wants to automatically download new chapters.
|
|
|
|
|
|
|
|
stopSelf(startId)
|
|
|
|
stopSelf(startId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (target == Target.CHAPTERS) {
|
|
|
|
job = GlobalScope.launch(handler) {
|
|
|
|
job = GlobalScope.launch(handler) {
|
|
|
|
updateChaptersJob(mangaToAdd)
|
|
|
|
updateChaptersJob(mangaToAdd)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
job = GlobalScope.launch(handler) {
|
|
|
|
|
|
|
|
updateTrackings(mangaToAdd)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
job?.invokeOnCompletion { stopSelf(startId) }
|
|
|
|
job?.invokeOnCompletion { stopSelf(startId) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private suspend fun updateChaptersJob(mangaToAdd: List<LibraryManga>) {
|
|
|
|
private suspend fun updateChaptersJob(mangaToAdd: List<LibraryManga>) {
|
|
|
|
// List containing categories that get included in downloads.
|
|
|
|
// List containing categories that get included in downloads.
|
|
|
|
val categoriesToDownload = preferences.downloadNewCategories().getOrDefault().map(String::toInt)
|
|
|
|
val categoriesToDownload =
|
|
|
|
|
|
|
|
preferences.downloadNewCategories().getOrDefault().map(String::toInt)
|
|
|
|
// Boolean to determine if user wants to automatically download new chapters.
|
|
|
|
// Boolean to determine if user wants to automatically download new chapters.
|
|
|
|
val downloadNew = preferences.downloadNew().getOrDefault()
|
|
|
|
val downloadNew = preferences.downloadNew().getOrDefault()
|
|
|
|
// Boolean to determine if DownloadManager has downloads
|
|
|
|
// Boolean to determine if DownloadManager has downloads
|
|
|
@ -370,8 +378,7 @@ class LibraryUpdateService(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.subscribeOn(Schedulers.io()).subscribe {}
|
|
|
|
.subscribeOn(Schedulers.io()).subscribe {}
|
|
|
|
}
|
|
|
|
} else if (downloadNew && hasDownloads) {
|
|
|
|
else if (downloadNew && hasDownloads) {
|
|
|
|
|
|
|
|
DownloadService.start(this)
|
|
|
|
DownloadService.start(this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,7 +386,11 @@ class LibraryUpdateService(
|
|
|
|
cancelProgressNotification()
|
|
|
|
cancelProgressNotification()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private suspend fun updateMangaChapters(manga: LibraryManga, progess: Int, shouldDownload: Boolean):
|
|
|
|
private suspend fun updateMangaChapters(
|
|
|
|
|
|
|
|
manga: LibraryManga,
|
|
|
|
|
|
|
|
progess: Int,
|
|
|
|
|
|
|
|
shouldDownload: Boolean
|
|
|
|
|
|
|
|
):
|
|
|
|
Boolean {
|
|
|
|
Boolean {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
var hasDownloads = false
|
|
|
|
var hasDownloads = false
|
|
|
@ -406,8 +417,7 @@ class LibraryUpdateService(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return hasDownloads
|
|
|
|
return hasDownloads
|
|
|
|
}
|
|
|
|
} catch (e: Exception) {
|
|
|
|
catch (e: Exception) {
|
|
|
|
|
|
|
|
Timber.e("Failed updating: ${manga.title}: $e")
|
|
|
|
Timber.e("Failed updating: ${manga.title}: $e")
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -475,36 +485,31 @@ class LibraryUpdateService(
|
|
|
|
* Method that updates the metadata of the connected tracking services. It's called in a
|
|
|
|
* Method that updates the metadata of the connected tracking services. It's called in a
|
|
|
|
* background thread, so it's safe to do heavy operations or network calls here.
|
|
|
|
* background thread, so it's safe to do heavy operations or network calls here.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private fun updateTrackings(mangaToUpdate: List<LibraryManga>): Observable<LibraryManga> {
|
|
|
|
|
|
|
|
|
|
|
|
private suspend fun updateTrackings(mangaToUpdate: List<LibraryManga>) {
|
|
|
|
// Initialize the variables holding the progress of the updates.
|
|
|
|
// Initialize the variables holding the progress of the updates.
|
|
|
|
var count = 0
|
|
|
|
var count = 0
|
|
|
|
|
|
|
|
|
|
|
|
val loggedServices = trackManager.services.filter { it.isLogged }
|
|
|
|
val loggedServices = trackManager.services.filter { it.isLogged }
|
|
|
|
|
|
|
|
|
|
|
|
// Emit each manga and update it sequentially.
|
|
|
|
mangaToUpdate.forEach { manga ->
|
|
|
|
return Observable.from(mangaToUpdate)
|
|
|
|
showProgressNotification(manga, count++, mangaToUpdate.size)
|
|
|
|
// Notify manga that will update.
|
|
|
|
|
|
|
|
.doOnNext { showProgressNotification(it, count++, mangaToUpdate.size) }
|
|
|
|
|
|
|
|
// Update the tracking details.
|
|
|
|
|
|
|
|
.concatMap { manga ->
|
|
|
|
|
|
|
|
val tracks = db.getTracks(manga).executeAsBlocking()
|
|
|
|
val tracks = db.getTracks(manga).executeAsBlocking()
|
|
|
|
|
|
|
|
|
|
|
|
Observable.from(tracks)
|
|
|
|
tracks.forEach { track ->
|
|
|
|
.concatMap { track ->
|
|
|
|
|
|
|
|
val service = trackManager.getService(track.sync_id)
|
|
|
|
val service = trackManager.getService(track.sync_id)
|
|
|
|
if (service != null && service in loggedServices) {
|
|
|
|
if (service != null && service in loggedServices) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
service.refresh(track)
|
|
|
|
service.refresh(track)
|
|
|
|
.doOnNext { db.insertTrack(it).executeAsBlocking() }
|
|
|
|
db.insertTrack(track).executeAsBlocking()
|
|
|
|
.onErrorReturn { track }
|
|
|
|
} catch (e: Exception) {
|
|
|
|
} else {
|
|
|
|
Timber.e(e)
|
|
|
|
Observable.empty()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.map { manga }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.doOnCompleted {
|
|
|
|
|
|
|
|
cancelProgressNotification()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cancelProgressNotification()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -515,10 +520,12 @@ class LibraryUpdateService(
|
|
|
|
* @param total the total progress.
|
|
|
|
* @param total the total progress.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private fun showProgressNotification(manga: Manga, current: Int, total: Int) {
|
|
|
|
private fun showProgressNotification(manga: Manga, current: Int, total: Int) {
|
|
|
|
notificationManager.notify(Notifications.ID_LIBRARY_PROGRESS, progressNotification
|
|
|
|
notificationManager.notify(
|
|
|
|
|
|
|
|
Notifications.ID_LIBRARY_PROGRESS, progressNotification
|
|
|
|
.setContentTitle(manga.currentTitle())
|
|
|
|
.setContentTitle(manga.currentTitle())
|
|
|
|
.setProgress(total, current, false)
|
|
|
|
.setProgress(total, current, false)
|
|
|
|
.build())
|
|
|
|
.build()
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -539,15 +546,17 @@ class LibraryUpdateService(
|
|
|
|
.asBitmap().load(manga).dontTransform().centerCrop().circleCrop()
|
|
|
|
.asBitmap().load(manga).dontTransform().centerCrop().circleCrop()
|
|
|
|
.override(256, 256).submit().get()
|
|
|
|
.override(256, 256).submit().get()
|
|
|
|
setLargeIcon(icon)
|
|
|
|
setLargeIcon(icon)
|
|
|
|
|
|
|
|
} catch (e: Exception) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e: Exception) { }
|
|
|
|
|
|
|
|
setGroupAlertBehavior(GROUP_ALERT_SUMMARY)
|
|
|
|
setGroupAlertBehavior(GROUP_ALERT_SUMMARY)
|
|
|
|
setContentTitle(manga.currentTitle())
|
|
|
|
setContentTitle(manga.currentTitle())
|
|
|
|
color = ContextCompat.getColor(this@LibraryUpdateService, R.color.colorAccent)
|
|
|
|
color = ContextCompat.getColor(this@LibraryUpdateService, R.color.colorAccent)
|
|
|
|
val chaptersNames = if (chapterNames.size > 5) {
|
|
|
|
val chaptersNames = if (chapterNames.size > 5) {
|
|
|
|
"${chapterNames.take(4).joinToString(", ")}, " +
|
|
|
|
"${chapterNames.take(4).joinToString(", ")}, " +
|
|
|
|
resources.getQuantityString(R.plurals.notification_and_n_more,
|
|
|
|
resources.getQuantityString(
|
|
|
|
(chapterNames.size - 4), (chapterNames.size - 4))
|
|
|
|
R.plurals.notification_and_n_more,
|
|
|
|
|
|
|
|
(chapterNames.size - 4), (chapterNames.size - 4)
|
|
|
|
|
|
|
|
)
|
|
|
|
} else chapterNames.joinToString(", ")
|
|
|
|
} else chapterNames.joinToString(", ")
|
|
|
|
setContentText(chaptersNames)
|
|
|
|
setContentText(chaptersNames)
|
|
|
|
setStyle(NotificationCompat.BigTextStyle().bigText(chaptersNames))
|
|
|
|
setStyle(NotificationCompat.BigTextStyle().bigText(chaptersNames))
|
|
|
@ -558,32 +567,48 @@ class LibraryUpdateService(
|
|
|
|
this@LibraryUpdateService, manga, chapters.first()
|
|
|
|
this@LibraryUpdateService, manga, chapters.first()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
addAction(R.drawable.ic_glasses_black_24dp, getString(R.string.action_mark_as_read),
|
|
|
|
addAction(
|
|
|
|
NotificationReceiver.markAsReadPendingBroadcast(this@LibraryUpdateService,
|
|
|
|
R.drawable.ic_glasses_black_24dp, getString(R.string.action_mark_as_read),
|
|
|
|
manga, chapters, Notifications.ID_NEW_CHAPTERS))
|
|
|
|
NotificationReceiver.markAsReadPendingBroadcast(
|
|
|
|
addAction(R.drawable.ic_book_white_24dp, getString(R.string.action_view_chapters),
|
|
|
|
this@LibraryUpdateService,
|
|
|
|
NotificationReceiver.openChapterPendingActivity(this@LibraryUpdateService,
|
|
|
|
manga, chapters, Notifications.ID_NEW_CHAPTERS
|
|
|
|
manga, Notifications.ID_NEW_CHAPTERS))
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
addAction(
|
|
|
|
|
|
|
|
R.drawable.ic_book_white_24dp, getString(R.string.action_view_chapters),
|
|
|
|
|
|
|
|
NotificationReceiver.openChapterPendingActivity(
|
|
|
|
|
|
|
|
this@LibraryUpdateService,
|
|
|
|
|
|
|
|
manga, Notifications.ID_NEW_CHAPTERS
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
setAutoCancel(true)
|
|
|
|
setAutoCancel(true)
|
|
|
|
}, manga.id.hashCode()))
|
|
|
|
}, manga.id.hashCode()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NotificationManagerCompat.from(this).apply {
|
|
|
|
NotificationManagerCompat.from(this).apply {
|
|
|
|
|
|
|
|
|
|
|
|
notify(Notifications.ID_NEW_CHAPTERS, notification(Notifications.CHANNEL_NEW_CHAPTERS) {
|
|
|
|
notify(
|
|
|
|
|
|
|
|
Notifications.ID_NEW_CHAPTERS,
|
|
|
|
|
|
|
|
notification(Notifications.CHANNEL_NEW_CHAPTERS) {
|
|
|
|
setSmallIcon(R.drawable.ic_tachi)
|
|
|
|
setSmallIcon(R.drawable.ic_tachi)
|
|
|
|
setLargeIcon(notificationBitmap)
|
|
|
|
setLargeIcon(notificationBitmap)
|
|
|
|
setContentTitle(getString(R.string.notification_new_chapters))
|
|
|
|
setContentTitle(getString(R.string.notification_new_chapters))
|
|
|
|
color = ContextCompat.getColor(applicationContext, R.color.colorAccent)
|
|
|
|
color = ContextCompat.getColor(applicationContext, R.color.colorAccent)
|
|
|
|
if (updates.size > 1) {
|
|
|
|
if (updates.size > 1) {
|
|
|
|
setContentText(resources.getQuantityString(R.plurals
|
|
|
|
setContentText(
|
|
|
|
|
|
|
|
resources.getQuantityString(
|
|
|
|
|
|
|
|
R.plurals
|
|
|
|
.notification_new_chapters_text,
|
|
|
|
.notification_new_chapters_text,
|
|
|
|
updates.size, updates.size))
|
|
|
|
updates.size, updates.size
|
|
|
|
setStyle(NotificationCompat.BigTextStyle().bigText(updates.keys.joinToString("\n") {
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
setStyle(
|
|
|
|
|
|
|
|
NotificationCompat.BigTextStyle()
|
|
|
|
|
|
|
|
.bigText(updates.keys.joinToString("\n") {
|
|
|
|
it.currentTitle().chop(45)
|
|
|
|
it.currentTitle().chop(45)
|
|
|
|
}))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
else {
|
|
|
|
} else {
|
|
|
|
setContentText(updates.keys.first().currentTitle().chop(45))
|
|
|
|
setContentText(updates.keys.first().currentTitle().chop(45))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
priority = NotificationCompat.PRIORITY_HIGH
|
|
|
|
priority = NotificationCompat.PRIORITY_HIGH
|
|
|
|