mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-21 00:11:13 +01:00
Various changes
This commit is contained in:
@@ -4,9 +4,6 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import exh.*
|
||||
import exh.metadata.metadataClass
|
||||
import exh.metadata.models.ExGalleryMetadata
|
||||
import exh.metadata.models.NHentaiMetadata
|
||||
import exh.metadata.models.PervEdenGalleryMetadata
|
||||
import exh.metadata.models.SearchableGalleryMetadata
|
||||
import exh.metadata.syncMangaIds
|
||||
import exh.search.SearchEngine
|
||||
@@ -89,7 +86,7 @@ class LibraryCategoryAdapter(val view: LibraryCategoryView) :
|
||||
val meta: RealmResults<out SearchableGalleryMetadata> = if (it.value.isNotEmpty())
|
||||
searchEngine.filterResults(it.value.where(),
|
||||
parsedQuery,
|
||||
it.value.first().titleFields)
|
||||
it.value.first()!!.titleFields)
|
||||
.findAllSorted(SearchableGalleryMetadata::mangaId.name).apply {
|
||||
totalFilteredSize += size
|
||||
}
|
||||
@@ -132,7 +129,7 @@ class LibraryCategoryAdapter(val view: LibraryCategoryView) :
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.w(e, "Could not filter manga!", manga.manga)
|
||||
Timber.w(e, "Could not filter manga! %s", manga.manga)
|
||||
}
|
||||
|
||||
//Fallback to regular filter
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.support.v7.preference.PreferenceScreen
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.bluelinelabs.conductor.RouterTransaction
|
||||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
|
||||
@@ -16,6 +17,9 @@ import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import eu.kanade.tachiyomi.ui.library.LibraryController
|
||||
import eu.kanade.tachiyomi.util.toast
|
||||
import exh.ui.migration.MetadataFetchDialog
|
||||
import exh.util.realmTrans
|
||||
import io.realm.Realm
|
||||
import rx.Observable
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import rx.schedulers.Schedulers
|
||||
@@ -69,6 +73,38 @@ class SettingsAdvancedController : SettingsController() {
|
||||
|
||||
onClick { LibraryUpdateService.start(context, target = Target.TRACKING) }
|
||||
}
|
||||
preferenceCategory {
|
||||
title = "Gallery metadata"
|
||||
isPersistent = false
|
||||
|
||||
preference {
|
||||
title = "Migrate library metadata"
|
||||
isPersistent = false
|
||||
key = "ex_migrate_library"
|
||||
summary = "Fetch the library metadata to enable tag searching in the library. This button will be visible even if you have already fetched the metadata"
|
||||
|
||||
onClick {
|
||||
activity?.let {
|
||||
MetadataFetchDialog().askMigration(it, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Clear library metadata"
|
||||
isPersistent = false
|
||||
key = "ex_clear_metadata"
|
||||
summary = "Clear all library metadata. Disables tag searching in the library"
|
||||
|
||||
onClick {
|
||||
realmTrans {
|
||||
it.deleteAll()
|
||||
}
|
||||
|
||||
context.toast("Library metadata cleared!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearChapterCache() {
|
||||
|
||||
@@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.setting
|
||||
import android.support.v7.preference.PreferenceScreen
|
||||
import com.bluelinelabs.conductor.RouterTransaction
|
||||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
|
||||
import exh.ui.migration.MetadataFetchDialog
|
||||
import exh.ui.login.LoginController
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
|
||||
@@ -124,23 +123,5 @@ class SettingsEhController : SettingsController() {
|
||||
"tr_20"
|
||||
)
|
||||
}.dependency = "enable_exhentai"
|
||||
|
||||
preferenceCategory {
|
||||
title = "Advanced"
|
||||
isPersistent = false
|
||||
|
||||
preference {
|
||||
title = "Migrate library metadata"
|
||||
isPersistent = false
|
||||
key = "ex_migrate_library"
|
||||
summary = "Fetch the library metadata to enable tag searching in the library. This button will be visible even if you have already fetched the metadata"
|
||||
|
||||
onClick {
|
||||
activity?.let {
|
||||
MetadataFetchDialog().askMigration(it, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@ class SettingsMainController : SettingsController() {
|
||||
titleRes = R.string.pref_category_eh
|
||||
onClick { navigateTo(SettingsEhController()) }
|
||||
}
|
||||
preference {
|
||||
iconRes = R.drawable.eh_ic_nhlogo_color
|
||||
iconTint = tintColor
|
||||
titleRes = R.string.pref_category_nh
|
||||
onClick { navigateTo(SettingsNhController()) }
|
||||
}
|
||||
preference {
|
||||
iconRes = R.drawable.ic_code_black_24dp
|
||||
iconTint = tintColor
|
||||
|
||||
21
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsNhController.kt
Executable file
21
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsNhController.kt
Executable file
@@ -0,0 +1,21 @@
|
||||
package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.support.v7.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys
|
||||
|
||||
/**
|
||||
* EH Settings fragment
|
||||
*/
|
||||
|
||||
class SettingsNhController : SettingsController() {
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
title = "nhentai"
|
||||
|
||||
switchPreference {
|
||||
title = "Use high-quality thumbnails"
|
||||
summary = "May slow down search results"
|
||||
key = PreferenceKeys.eh_nh_useHighQualityThumbs
|
||||
defaultValue = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user