mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-22 11:08:54 +02:00
Merge branch 'master' into sync-part-final
This commit is contained in:
@@ -14,7 +14,7 @@ class CreateCategoryWithName(
|
||||
|
||||
private val initialFlags: Long
|
||||
get() {
|
||||
val sort = preferences.librarySortingMode().get()
|
||||
val sort = preferences.sortingMode().get()
|
||||
return sort.type.flag or sort.direction.flag
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@ class ResetCategoryFlags(
|
||||
) {
|
||||
|
||||
suspend fun await() {
|
||||
val sort = preferences.librarySortingMode().get()
|
||||
val sort = preferences.sortingMode().get()
|
||||
categoryRepository.updateAllFlags(sort.type + sort.direction)
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,6 @@ class SetDisplayMode(
|
||||
) {
|
||||
|
||||
fun await(display: LibraryDisplayMode) {
|
||||
preferences.libraryDisplayMode().set(display)
|
||||
preferences.displayMode().set(display)
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class SetSortModeForCategory(
|
||||
),
|
||||
)
|
||||
} else {
|
||||
preferences.librarySortingMode().set(LibrarySort(type, direction))
|
||||
preferences.sortingMode().set(LibrarySort(type, direction))
|
||||
categoryRepository.updateAllFlags(flags)
|
||||
}
|
||||
}
|
||||
|
@@ -11,24 +11,24 @@ class LibraryPreferences(
|
||||
private val preferenceStore: PreferenceStore,
|
||||
) {
|
||||
|
||||
fun libraryDisplayMode() = preferenceStore.getObject("pref_display_mode_library", LibraryDisplayMode.default, LibraryDisplayMode.Serializer::serialize, LibraryDisplayMode.Serializer::deserialize)
|
||||
fun displayMode() = preferenceStore.getObject("pref_display_mode_library", LibraryDisplayMode.default, LibraryDisplayMode.Serializer::serialize, LibraryDisplayMode.Serializer::deserialize)
|
||||
|
||||
fun librarySortingMode() = preferenceStore.getObject("library_sorting_mode", LibrarySort.default, LibrarySort.Serializer::serialize, LibrarySort.Serializer::deserialize)
|
||||
fun sortingMode() = preferenceStore.getObject("library_sorting_mode", LibrarySort.default, LibrarySort.Serializer::serialize, LibrarySort.Serializer::deserialize)
|
||||
|
||||
fun portraitColumns() = preferenceStore.getInt("pref_library_columns_portrait_key", 0)
|
||||
|
||||
fun landscapeColumns() = preferenceStore.getInt("pref_library_columns_landscape_key", 0)
|
||||
|
||||
fun libraryUpdateInterval() = preferenceStore.getInt("pref_library_update_interval_key", 0)
|
||||
fun libraryUpdateLastTimestamp() = preferenceStore.getLong("library_update_last_timestamp", 0L)
|
||||
fun lastUpdatedTimestamp() = preferenceStore.getLong("library_update_last_timestamp", 0L)
|
||||
fun autoUpdateInterval() = preferenceStore.getInt("pref_library_update_interval_key", 0)
|
||||
|
||||
fun libraryUpdateDeviceRestriction() = preferenceStore.getStringSet(
|
||||
fun autoUpdateDeviceRestrictions() = preferenceStore.getStringSet(
|
||||
"library_update_restriction",
|
||||
setOf(
|
||||
DEVICE_ONLY_ON_WIFI,
|
||||
),
|
||||
)
|
||||
fun libraryUpdateMangaRestriction() = preferenceStore.getStringSet(
|
||||
fun autoUpdateMangaRestrictions() = preferenceStore.getStringSet(
|
||||
"library_update_manga_restriction",
|
||||
setOf(
|
||||
MANGA_HAS_UNREAD,
|
||||
@@ -95,9 +95,9 @@ class LibraryPreferences(
|
||||
|
||||
fun categorizedDisplaySettings() = preferenceStore.getBoolean("categorized_display", false)
|
||||
|
||||
fun libraryUpdateCategories() = preferenceStore.getStringSet("library_update_categories", emptySet())
|
||||
fun updateCategories() = preferenceStore.getStringSet("library_update_categories", emptySet())
|
||||
|
||||
fun libraryUpdateCategoriesExclude() = preferenceStore.getStringSet("library_update_categories_exclude", emptySet())
|
||||
fun updateCategoriesExclude() = preferenceStore.getStringSet("library_update_categories_exclude", emptySet())
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -148,7 +148,6 @@ class LibraryPreferences(
|
||||
const val DEVICE_ONLY_ON_WIFI = "wifi"
|
||||
const val DEVICE_NETWORK_NOT_METERED = "network_not_metered"
|
||||
const val DEVICE_CHARGING = "ac"
|
||||
const val DEVICE_BATTERY_NOT_LOW = "battery_not_low"
|
||||
|
||||
const val MANGA_NON_COMPLETED = "manga_ongoing"
|
||||
const val MANGA_HAS_UNREAD = "manga_fully_read"
|
||||
|
@@ -6,20 +6,19 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import rx.Observable
|
||||
|
||||
@Suppress("OverridingDeprecatedMember")
|
||||
class StubSource(
|
||||
override val id: Long,
|
||||
override val lang: String,
|
||||
override val name: String,
|
||||
) : Source {
|
||||
|
||||
val isInvalid: Boolean = name.isBlank() || lang.isBlank()
|
||||
private val isInvalid: Boolean = name.isBlank() || lang.isBlank()
|
||||
|
||||
override suspend fun getMangaDetails(manga: SManga): SManga {
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getMangaDetails"))
|
||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getMangaDetails"))
|
||||
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
@@ -28,7 +27,7 @@ class StubSource(
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
@@ -37,7 +36,7 @@ class StubSource(
|
||||
throw SourceNotInstalledException()
|
||||
}
|
||||
|
||||
@Deprecated("Use the 1.x API instead", replaceWith = ReplaceWith("getPageList"))
|
||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getPageList"))
|
||||
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
|
||||
return Observable.error(SourceNotInstalledException())
|
||||
}
|
||||
|
Reference in New Issue
Block a user