Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Remove some usages of global scope

Cette révision appartient à :
arkon 2022-08-29 15:15:18 -04:00
Parent 43c195e14a
révision 8efb20439a
5 fichiers modifiés avec 5 ajouts et 7 suppressions

Voir le fichier

@ -595,7 +595,7 @@ open class BrowseSourceController(bundle: Bundle) :
override fun onItemLongClick(position: Int) {
val activity = activity ?: return
val manga = (adapter?.getItem(position) as? SourceItem?)?.manga ?: return
launchIO {
viewScope.launchIO {
val duplicateManga = presenter.getDuplicateLibraryManga(manga)
withUIContext {
@ -631,7 +631,7 @@ open class BrowseSourceController(bundle: Bundle) :
private fun addToLibrary(newManga: Manga, position: Int) {
val activity = activity ?: return
launchIO {
viewScope.launchIO {
val categories = presenter.getCategories()
val defaultCategoryId = preferences.defaultCategory()
val defaultCategory = categories.find { it.id == defaultCategoryId.toLong() }

Voir le fichier

@ -194,7 +194,7 @@ open class BrowseSourcePresenter(
if (!hasNextPage()) return
nextPageJob?.cancel()
nextPageJob = launchIO {
nextPageJob = presenterScope.launchIO {
try {
pager.requestNextPage()
} catch (e: Throwable) {

Voir le fichier

@ -920,7 +920,7 @@ class MangaPresenter(
fun trackingSearch(query: String, service: TrackService) {
searchTrackerJob?.cancel()
searchTrackerJob = launchIO {
searchTrackerJob = presenterScope.launchIO {
try {
val results = service.search(query)
withUIContext { view?.onTrackingSearchResults(results) }

Voir le fichier

@ -249,7 +249,7 @@ class ReaderPresenter(
fun init(mangaId: Long, initialChapterId: Long) {
if (!needsInit()) return
launchIO {
presenterScope.launchIO {
try {
val manga = getManga.await(mangaId)
withUIContext {

Voir le fichier

@ -21,8 +21,6 @@ class TrackLoginDialog(
private val service = Injekt.get<TrackManager>().getService(args.getLong("serviceId"))!!
constructor(service: TrackService) : this(service, null)
constructor(service: TrackService, @StringRes usernameLabelRes: Int?) :
this(usernameLabelRes, bundleOf("serviceId" to service.id))