mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Build fixes and remove possibly unneeded settings?
This commit is contained in:
		| @@ -5,7 +5,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga | ||||
| import eu.kanade.tachiyomi.source.CatalogueSource | ||||
| import eu.kanade.tachiyomi.source.model.FilterList | ||||
| import eu.kanade.tachiyomi.source.model.SManga | ||||
| import eu.kanade.tachiyomi.ui.smartsearch.SmartSearchPresenter | ||||
| import eu.kanade.tachiyomi.util.await | ||||
| import info.debatty.java.stringsimilarity.NormalizedLevenshtein | ||||
| import kotlin.coroutines.CoroutineContext | ||||
| @@ -45,7 +44,7 @@ class SmartSearchEngine( | ||||
|                     searchResults.mangas.map { | ||||
|                         val cleanedMangaTitle = cleanSmartSearchTitle(it.title) | ||||
|                         val normalizedDistance = normalizedLevenshtein.similarity(cleanedTitle, cleanedMangaTitle) | ||||
|                         SmartSearchPresenter.SearchEntry(it, normalizedDistance) | ||||
|                         SearchEntry(it, normalizedDistance) | ||||
|                     }.filter { (_, normalizedDistance) -> | ||||
|                         normalizedDistance >= MIN_SMART_ELIGIBLE_THRESHOLD | ||||
|                     } | ||||
| @@ -65,7 +64,7 @@ class SmartSearchEngine( | ||||
|  | ||||
|             searchResults.mangas.map { | ||||
|                 val normalizedDistance = normalizedLevenshtein.similarity(title, it.title) | ||||
|                 SmartSearchPresenter.SearchEntry(it, normalizedDistance) | ||||
|                 SearchEntry(it, normalizedDistance) | ||||
|             }.filter { (_, normalizedDistance) -> | ||||
|                 normalizedDistance >= MIN_NORMAL_ELIGIBLE_THRESHOLD | ||||
|             } | ||||
| @@ -191,3 +190,5 @@ class SmartSearchEngine( | ||||
|         private val consecutiveSpacesRegex = Regex(" +") | ||||
|     } | ||||
| } | ||||
|  | ||||
| data class SearchEntry(val manga: SManga, val dist: Double) | ||||
|   | ||||
| @@ -168,11 +168,6 @@ class MainActivity : BaseActivity<MainActivityBinding>() { | ||||
|             } | ||||
|  | ||||
|             initWhenIdle { | ||||
|                 // Migrate metadata if empty (EH) | ||||
|                 if(!preferences.migrateLibraryAsked().getOrDefault()) { | ||||
|                     MetadataFetchDialog().askMigration(this, false) | ||||
|                 } | ||||
|  | ||||
|                 // Upload settings | ||||
|                 if(preferences.enableExhentai().getOrDefault() | ||||
|                         && preferences.eh_showSettingsUploadWarning().getOrDefault()) | ||||
|   | ||||
| @@ -104,9 +104,9 @@ class MigrationBottomSheetDialog( | ||||
|  | ||||
|     private fun setFlags() { | ||||
|         var flags = 0 | ||||
|         if(mig_chapters.isChecked) flags = flags or MigrationFlags.CHAPTERS | ||||
|         if(mig_categories.isChecked) flags = flags or MigrationFlags.CATEGORIES | ||||
|         if(mig_tracking.isChecked) flags = flags or MigrationFlags.TRACK | ||||
|         if (mig_chapters.isChecked) flags = flags or MigrationFlags.CHAPTERS | ||||
|         if (mig_categories.isChecked) flags = flags or MigrationFlags.CATEGORIES | ||||
|         if (mig_tracking.isChecked) flags = flags or MigrationFlags.TRACK | ||||
|         preferences.migrateFlags().set(flags) | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -23,7 +23,6 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Target | ||||
| 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.ui.migration.MetadataFetchDialog | ||||
| import eu.kanade.tachiyomi.util.preference.defaultValue | ||||
| import eu.kanade.tachiyomi.util.preference.onClick | ||||
| import eu.kanade.tachiyomi.util.preference.preference | ||||
| @@ -112,42 +111,7 @@ class SettingsAdvancedController : SettingsController() { | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         // --> EXH | ||||
|         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 { | ||||
|                     db.inTransaction { | ||||
|                         db.deleteAllSearchMetadata().executeAsBlocking() | ||||
|                         db.deleteAllSearchTags().executeAsBlocking() | ||||
|                         db.deleteAllSearchTitle().executeAsBlocking() | ||||
|                     } | ||||
|  | ||||
|                     context.toast("Library metadata cleared!") | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         // <-- EXH | ||||
|         preferenceCategory { | ||||
|             title = "Developer tools" | ||||
|             isPersistent = false | ||||
|   | ||||
| @@ -10,7 +10,7 @@ | ||||
|         android:id="@+id/card" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="220dp" | ||||
|         android:background="@drawable/card_background" | ||||
|         android:background="?attr/colorSurface" | ||||
|         app:layout_constraintDimensionRatio="0.75" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
| @@ -58,7 +58,7 @@ | ||||
|             app:layout_constraintTop_toTopOf="parent" | ||||
|             android:layout_marginTop="4dp"/> | ||||
|  | ||||
|         <eu.kanade.tachiyomi.widget.PTSansTextView | ||||
|         <com.google.android.material.textview.MaterialTextView | ||||
|             android:id="@+id/title" | ||||
|             style="@style/TextAppearance.Regular.Body1.Light" | ||||
|             android:layout_width="match_parent" | ||||
| @@ -72,7 +72,6 @@ | ||||
|             android:shadowDx="0" | ||||
|             android:shadowDy="0" | ||||
|             android:shadowRadius="4" | ||||
|             app:typeface="ptsansNarrowBold" | ||||
|             tools:text="Sample name" /> | ||||
|  | ||||
|         <ProgressBar | ||||
|   | ||||
| @@ -56,7 +56,7 @@ | ||||
|         app:layout_constraintHorizontal_bias="0.5" | ||||
|         app:layout_constraintStart_toEndOf="@+id/migration_manga_card_to" | ||||
|         app:layout_constraintTop_toTopOf="parent" | ||||
|         app:srcCompat="@drawable/ic_more_vert_black_24dp" | ||||
|         app:srcCompat="@drawable/ic_more_vert_24dp" | ||||
|         android:visibility="invisible"/> | ||||
|  | ||||
|  | ||||
| @@ -68,5 +68,5 @@ | ||||
|         app:layout_constraintEnd_toEndOf="@+id/migration_menu" | ||||
|         app:layout_constraintStart_toStartOf="@+id/migration_menu" | ||||
|         app:layout_constraintTop_toTopOf="@+id/migration_menu" | ||||
|         app:srcCompat="@drawable/baseline_close_24" /> | ||||
|         app:srcCompat="@drawable/ic_close_24dp" /> | ||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||
		Reference in New Issue
	
	Block a user