Replace preference getter functions with properties (#3091)

This commit is contained in:
AntsyLich
2026-03-20 14:57:01 +06:00
committed by GitHub
parent 2f9edb551f
commit 87665736a9
126 changed files with 816 additions and 722 deletions
@@ -141,14 +141,14 @@ class MangaScreenModel(
private val filteredChapters: List<ChapterList.Item>?
get() = successState?.processedChapters
val chapterSwipeStartAction = libraryPreferences.swipeToEndAction().get()
val chapterSwipeEndAction = libraryPreferences.swipeToStartAction().get()
var autoTrackState = trackPreferences.autoUpdateTrackOnMarkRead().get()
val chapterSwipeStartAction = libraryPreferences.swipeToEndAction.get()
val chapterSwipeEndAction = libraryPreferences.swipeToStartAction.get()
var autoTrackState = trackPreferences.autoUpdateTrackOnMarkRead.get()
private val skipFiltered by readerPreferences.skipFiltered().asState(screenModelScope)
private val skipFiltered by readerPreferences.skipFiltered.asState(screenModelScope)
val isUpdateIntervalEnabled =
LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in libraryPreferences.autoUpdateMangaRestrictions().get()
LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in libraryPreferences.autoUpdateMangaRestrictions.get()
private val selectedPositions: Array<Int> = arrayOf(-1, -1) // first and last selected index in list
private val selectedChapterIds: HashSet<Long> = HashSet()
@@ -230,7 +230,7 @@ class MangaScreenModel(
excludedScanlators = getExcludedScanlators.await(mangaId),
isRefreshingData = needRefreshInfo || needRefreshChapter,
dialog = null,
hideMissingChapters = libraryPreferences.hideMissingChapters().get(),
hideMissingChapters = libraryPreferences.hideMissingChapters.get(),
)
}
@@ -338,7 +338,7 @@ class MangaScreenModel(
// Now check if user previously set categories, when available
val categories = getCategories()
val defaultCategoryId = libraryPreferences.defaultCategory().get().toLong()
val defaultCategoryId = libraryPreferences.defaultCategory.get().toLong()
val defaultCategory = categories.find { it.id == defaultCategoryId }
when {
// Default category set
@@ -99,7 +99,7 @@ data class TrackInfoDialogHomeScreen(
val context = LocalContext.current
val screenModel = rememberScreenModel { Model(mangaId, sourceId) }
val dateFormat = remember { UiPreferences.dateFormat(Injekt.get<UiPreferences>().dateFormat().get()) }
val dateFormat = remember { UiPreferences.dateFormat(Injekt.get<UiPreferences>().dateFormat.get()) }
val state by screenModel.state.collectAsState()
TrackInfoDialogHome(