Another fix for mass migration
Also fixing some deprecated code (cherry picked from commit 2535ea92ebc97bad9f30e9e48493629df6db28a3)
This commit is contained in:
parent
00d2d4f969
commit
01175e687c
@ -163,8 +163,10 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
val localManga = smartSearchEngine.networkToLocalManga(searchResult, source.id)
|
val localManga = smartSearchEngine.networkToLocalManga(searchResult, source.id)
|
||||||
val chapters = source.fetchChapterList(localManga).toSingle().await(
|
val chapters = source.fetchChapterList(localManga).toSingle().await(
|
||||||
Schedulers.io())
|
Schedulers.io())
|
||||||
withContext(Dispatchers.IO) {
|
try {
|
||||||
syncChaptersWithSource(db, chapters, localManga, source)
|
syncChaptersWithSource(db, chapters, localManga, source)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
return@async null
|
||||||
}
|
}
|
||||||
manga.progress.send(validSources.size to processedSources.incrementAndGet())
|
manga.progress.send(validSources.size to processedSources.incrementAndGet())
|
||||||
localManga to chapters.size
|
localManga to chapters.size
|
||||||
@ -260,8 +262,10 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun noMigration() {
|
override fun noMigration() {
|
||||||
activity?.toast(R.string.no_migrations)
|
launchUI {
|
||||||
router.popCurrentController()
|
activity?.toast(R.string.no_migrations)
|
||||||
|
router.popCurrentController()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemClick(position: Int, item: MenuItem) {
|
override fun onMenuItemClick(position: Int, item: MenuItem) {
|
||||||
|
@ -39,7 +39,7 @@ class MigrationProcessAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun sourceFinished() {
|
fun sourceFinished() {
|
||||||
if (mangasSkipped() == itemCount || itemCount == 0) menuItemListener.noMigration()
|
if (itemCount == 0) menuItemListener.noMigration()
|
||||||
if (allMangasDone()) menuItemListener.enableButtons()
|
if (allMangasDone()) menuItemListener.enableButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
style="@style/TextAppearance.Regular.SubHeading"
|
style="@style/TextAppearance.Regular.SubHeading"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:padding="@dimen/material_component_text_fields_padding_above_and_below_label"
|
android:padding="@dimen/material_component_text_fields_padding_above_and_below_label"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/source_card"
|
app:layout_constraintBottom_toTopOf="@+id/source_card"
|
||||||
app:layout_constraintHeight_default="wrap"
|
app:layout_constrainedHeight="true"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="Title" />
|
tools:text="Title" />
|
||||||
|
|
||||||
@ -32,11 +32,11 @@
|
|||||||
android:id="@+id/source_card"
|
android:id="@+id/source_card"
|
||||||
style="@style/Theme.Widget.CardView.Item"
|
style="@style/Theme.Widget.CardView.Item"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="144dp"
|
android:minHeight="144dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHeight_default="wrap"
|
app:layout_constrainedHeight="true"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
@ -1,28 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/list_item_selector"
|
android:background="@drawable/list_item_selector"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="4dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
android:paddingBottom="8dp">
|
android:paddingStart="4dp"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress"
|
android:id="@+id/progress"
|
||||||
style="?android:attr/progressBarStyleSmall"
|
style="?android:attr/progressBarStyleSmall"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHeight_default="wrap"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintWidth_default="wrap" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/itemImage"
|
android:id="@+id/itemImage"
|
||||||
@ -40,13 +41,13 @@
|
|||||||
android:id="@+id/tvTitle"
|
android:id="@+id/tvTitle"
|
||||||
style="@style/TextAppearance.Regular.Caption"
|
style="@style/TextAppearance.Regular.Caption"
|
||||||
android:layout_width="104dp"
|
android:layout_width="104dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHeight_default="wrap"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/itemImage"
|
app:layout_constraintTop_toBottomOf="@+id/itemImage"
|
||||||
tools:text="Sample title" />
|
tools:text="Sample title" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user