mirror of
https://github.com/mihonapp/mihon.git
synced 2025-03-13 08:10:07 +01:00
Fix migration dialog showing on startup even with no manga
This commit is contained in:
parent
08dffda2a1
commit
bcc2ec1668
@ -170,7 +170,7 @@ class MainActivity : BaseActivity() {
|
||||
|
||||
// Migrate metadata to Realm (EH)
|
||||
if(!preferences.migrateLibraryAsked2().getOrDefault())
|
||||
MetadataFetchDialog().askMigration(this)
|
||||
MetadataFetchDialog().askMigration(this, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ class SettingsEhController : SettingsController() {
|
||||
|
||||
onClick {
|
||||
activity?.let {
|
||||
MetadataFetchDialog().askMigration(it)
|
||||
MetadataFetchDialog().askMigration(it, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,9 +83,13 @@ class MetadataFetchDialog {
|
||||
}
|
||||
}
|
||||
|
||||
fun askMigration(activity: Activity) {
|
||||
fun askMigration(activity: Activity, explicit: Boolean) {
|
||||
var extra = ""
|
||||
db.getLibraryMangas().asRxSingle().subscribe {
|
||||
if(!explicit && it.isEmpty()) {
|
||||
//Do not open dialog on startup if no manga
|
||||
preferenceHelper.migrateLibraryAsked2().set(true)
|
||||
} else {
|
||||
//Not logged in but have ExHentai galleries
|
||||
if (!preferenceHelper.enableExhentai().getOrDefault()) {
|
||||
it.find { isExSource(it.source) }?.let {
|
||||
@ -110,6 +114,7 @@ class MetadataFetchDialog {
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user