mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 00:19:10 +01:00
Fixes for extension notifcatinos + Confirm exit for migrations
This commit is contained in:
parent
a435c00290
commit
640bd8d9ba
@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.notification
|
||||
import rx.Observable
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import rx.schedulers.Schedulers
|
||||
import timber.log.Timber
|
||||
import uy.kohesive.injekt.Injekt
|
||||
@ -24,7 +25,6 @@ class ExtensionUpdateJob : Job() {
|
||||
val extensionManager: ExtensionManager = Injekt.get()
|
||||
extensionManager.findAvailableExtensions()
|
||||
|
||||
Observable.defer {
|
||||
extensionManager.getInstalledExtensionsObservable().map { list ->
|
||||
val pendingUpdates = list.filter { it.hasUpdate }
|
||||
if (pendingUpdates.isNotEmpty()) {
|
||||
@ -56,8 +56,9 @@ class ExtensionUpdateJob : Job() {
|
||||
}
|
||||
}
|
||||
Result.SUCCESS
|
||||
}
|
||||
}.subscribeOn(Schedulers.io())
|
||||
}.take(1)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe({
|
||||
}, {
|
||||
Timber.e(it)
|
||||
|
@ -14,6 +14,7 @@ import androidx.core.graphics.ColorUtils
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
@ -130,6 +131,13 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
sourceManager.get(value) as? CatalogueSource }
|
||||
if (config == null) return
|
||||
for(manga in mangas) {
|
||||
if (migrationsJob?.isCancelled == true) {
|
||||
break
|
||||
}
|
||||
// in case it was removed
|
||||
if (manga.mangaId !in config.mangaIds) {
|
||||
continue
|
||||
}
|
||||
if(!manga.searchResult.initialized && manga.migrationJob.isActive) {
|
||||
val mangaObj = manga.manga()
|
||||
|
||||
@ -243,7 +251,9 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
|
||||
override fun updateCount() {
|
||||
launchUI {
|
||||
setTitle()
|
||||
if (router.backstack.last().controller() == this@MigrationListController) {
|
||||
setTitle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,6 +379,24 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleBack(): Boolean {
|
||||
activity?.let {
|
||||
MaterialDialog.Builder(it).title(R.string.stop_migration)
|
||||
.positiveText(R.string.yes)
|
||||
.negativeText(R.string.no)
|
||||
.onPositive { _, _ ->
|
||||
router.popCurrentController()
|
||||
migrationsJob?.cancel()
|
||||
}
|
||||
.show()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDestroyView(view: View) {
|
||||
super.onDestroyView(view)
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
inflater.inflate(R.menu.migration_list, menu)
|
||||
}
|
||||
|
@ -436,9 +436,11 @@
|
||||
<string name="skipping_x">(skipping %1$d)</string>
|
||||
<string name="x_migrations">%1$s manga migrated</string>
|
||||
<string name="no">No</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="error_fetching_migration">No chapters found, this manga cannot be used for
|
||||
migration</string>
|
||||
<string name="no_alternatives_found">No Alternatives Found</string>
|
||||
<string name="stop_migration">Stop migrating?</string>
|
||||
|
||||
<!-- Tracking Screen -->
|
||||
<string name="manga_tracking_tab">Tracking</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user