diff --git a/android/src/main/kotlin/ca/gosyer/jui/android/data/update/UpdateCheckWorker.kt b/android/src/main/kotlin/ca/gosyer/jui/android/data/update/UpdateCheckWorker.kt index fc70aeaa..56777c1a 100644 --- a/android/src/main/kotlin/ca/gosyer/jui/android/data/update/UpdateCheckWorker.kt +++ b/android/src/main/kotlin/ca/gosyer/jui/android/data/update/UpdateCheckWorker.kt @@ -68,7 +68,7 @@ class UpdateCheckWorker(private val context: Context, workerParams: WorkerParame .setConstraints(constraints) .build() - WorkManager.getInstance(context).enqueueUniquePeriodicWork(TAG, ExistingPeriodicWorkPolicy.REPLACE, request) + WorkManager.getInstance(context).enqueueUniquePeriodicWork(TAG, ExistingPeriodicWorkPolicy.UPDATE, request) } fun cancelTask(context: Context) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 77b37377..c36d5e7a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,12 +25,12 @@ materialDialogs = "0.9.1" # Android androidGradle = "7.4.1" core = "1.9.0" -appCompat = "1.7.0-alpha01" +appCompat = "1.7.0-alpha02" activityCompose = "1.6.1" -work = "2.7.1" +work = "2.8.0" # Android Lifecycle -lifecycle = "2.6.0-alpha05" +lifecycle = "2.6.0-beta01" # Swing darklaf = "3.0.2" @@ -39,11 +39,11 @@ darklaf = "3.0.2" ksp = "1.8.0-1.0.9" # Dependency Injection -kotlinInject = "0.5.1" +kotlinInject = "0.6.1" # Network ktor = "2.2.3" -ktorfit = "1.0.0-beta17" +ktorfit = "1.0.0-beta18" # Logging slf4j = "2.0.6" @@ -58,7 +58,7 @@ appDirs = "1.2.1" multiplatformSettings = "1.0.0-alpha01" # Utility -desugarJdkLibs = "1.2.2" +desugarJdkLibs = "2.0.2" aboutLibraries = "10.5.2" dateTime = "0.4.0" immutableCollections = "0.3.5" diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/downloads/DownloadsScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/downloads/DownloadsScreenViewModel.kt index cf9b1bd5..b95a1c84 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/downloads/DownloadsScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/downloads/DownloadsScreenViewModel.kt @@ -27,6 +27,7 @@ import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -39,7 +40,7 @@ class DownloadsScreenViewModel @Inject constructor( private val stopChapterDownload: StopChapterDownload, private val reorderChapterDownload: ReorderChapterDownload, private val contextWrapper: ContextWrapper, - standalone: Boolean + @Assisted standalone: Boolean ) : ViewModel(contextWrapper) { private val uiScope = if (standalone) { MainScope() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt index 0f134860..c61ca3b4 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt @@ -48,6 +48,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.toList import kotlinx.coroutines.launch +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -95,7 +96,7 @@ class LibraryScreenViewModel @Inject constructor( private val updateCategory: UpdateCategory, libraryPreferences: LibraryPreferences, contextWrapper: ContextWrapper, - private val savedStateHandle: SavedStateHandle + @Assisted private val savedStateHandle: SavedStateHandle ) : ViewModel(contextWrapper) { private val library = Library(MutableStateFlow(persistentListOf()), mutableMapOf()) val categories = library.categories.asStateFlow() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/main/components/LibraryUpdatesViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/main/components/LibraryUpdatesViewModel.kt index 2f45e2ed..6a35b773 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/main/components/LibraryUpdatesViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/main/components/LibraryUpdatesViewModel.kt @@ -14,13 +14,14 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.MainScope import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.asStateFlow +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging class LibraryUpdatesViewModel @Inject constructor( private val libraryUpdateService: LibraryUpdateService, private val contextWrapper: ContextWrapper, - standalone: Boolean + @Assisted standalone: Boolean ) : ViewModel(contextWrapper) { private val uiScope = if (standalone) { MainScope() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/manga/MangaScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/manga/MangaScreenViewModel.kt index 164a824f..3a68ea78 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/manga/MangaScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/manga/MangaScreenViewModel.kt @@ -52,6 +52,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -75,7 +76,7 @@ class MangaScreenViewModel @Inject constructor( private val batchChapterDownload: BatchChapterDownload, uiPreferences: UiPreferences, contextWrapper: ContextWrapper, - private val params: Params + @Assisted private val params: Params ) : ViewModel(contextWrapper) { private val _manga = MutableStateFlow(null) val manga = _manga.asStateFlow() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/ReaderMenuViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/ReaderMenuViewModel.kt index da565a74..df13a96f 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/ReaderMenuViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/ReaderMenuViewModel.kt @@ -65,6 +65,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -80,7 +81,7 @@ class ReaderMenuViewModel @Inject constructor( private val updateChapterMeta: UpdateChapterMeta, private val chapterCache: ChapterCache, contextWrapper: ContextWrapper, - private val params: Params + @Assisted private val params: Params ) : ViewModel(contextWrapper) { override val scope = MainScope() private val _manga = MutableStateFlow(null) diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/SourceScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/SourceScreenViewModel.kt index 7bee5f4a..c401454a 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/SourceScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/SourceScreenViewModel.kt @@ -27,6 +27,7 @@ import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -51,8 +52,8 @@ class SourceScreenViewModel( libraryPreferences: LibraryPreferences, getSourcePager: (suspend (page: Int) -> MangaPage?) -> SourcePager, contextWrapper: ContextWrapper, - savedStateHandle: SavedStateHandle, - params: Params + @Assisted savedStateHandle: SavedStateHandle, + @Assisted params: Params ) : this( params.source, getLatestManga, diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/SourceFiltersViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/SourceFiltersViewModel.kt index 594dd940..428cb258 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/SourceFiltersViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/SourceFiltersViewModel.kt @@ -26,6 +26,7 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.supervisorScope +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -40,8 +41,8 @@ class SourceFiltersViewModel( getFilterList: GetFilterList, setSourceFilter: SetSourceFilter, contextWrapper: ContextWrapper, - savedStateHandle: SavedStateHandle, - params: Params + @Assisted savedStateHandle: SavedStateHandle, + @Assisted params: Params ) : this( params.sourceId, getFilterList, diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt index 6e36857b..4452ece1 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt @@ -39,6 +39,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -47,8 +48,8 @@ class GlobalSearchViewModel @Inject constructor( private val getSearchManga: GetSearchManga, catalogPreferences: CatalogPreferences, contextWrapper: ContextWrapper, - private val savedStateHandle: SavedStateHandle, - params: Params + @Assisted private val savedStateHandle: SavedStateHandle, + @Assisted params: Params ) : ViewModel(contextWrapper) { private val _query by savedStateHandle.getStateFlow { params.initialQuery } val query = _query.asStateFlow() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/home/SourceHomeScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/home/SourceHomeScreenViewModel.kt index c9870c2f..b651fe49 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/home/SourceHomeScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/home/SourceHomeScreenViewModel.kt @@ -30,6 +30,7 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.stateIn +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -37,7 +38,7 @@ class SourceHomeScreenViewModel @Inject constructor( private val getSourceList: GetSourceList, catalogPreferences: CatalogPreferences, contextWrapper: ContextWrapper, - private val savedStateHandle: SavedStateHandle + @Assisted private val savedStateHandle: SavedStateHandle ) : ViewModel(contextWrapper) { private val _isLoading = MutableStateFlow(true) val isLoading = _isLoading.asStateFlow() diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/settings/SourceSettingsScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/settings/SourceSettingsScreenViewModel.kt index 63a46394..7fabc377 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/settings/SourceSettingsScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/settings/SourceSettingsScreenViewModel.kt @@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.supervisorScope +import me.tatarka.inject.annotations.Assisted import me.tatarka.inject.annotations.Inject import org.lighthousegames.logging.logging @@ -31,7 +32,7 @@ class SourceSettingsScreenViewModel @Inject constructor( private val getSourceSettings: GetSourceSettings, private val setSourceSetting: SetSourceSetting, contextWrapper: ContextWrapper, - private val params: Params + @Assisted private val params: Params ) : ViewModel(contextWrapper) { private val _loading = MutableStateFlow(true) val loading = _loading.asStateFlow()