* Refactor updateSuccessState
- Convert to inline function
- Use when for type safety if we add other MangaScreenState types
* Replace equivalent expressions with updateSuccessState
* Replace safe cast in MangaScreen
(cherry picked from commit cf777d989339a5190966b537aa493c5984d36a93)
State approach doesn't work well for client-side routed apps like MangaDex.
Fixes#9576
(cherry picked from commit 39a7356ed15b111fd940fc4bb8059f7130a1542e)
There seems to be little value in this feature, and juggling flag masks is annoying.
Per-category sorting is still a thing, but could be refactored away from the flag in the feature.
(cherry picked from commit 405a75438a61770a12292cc87c0fa36e16668124)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/library/LibrarySettingsDialog.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
# domain/src/main/java/tachiyomi/domain/category/interactor/SetDisplayModeForCategory.kt
# domain/src/main/java/tachiyomi/domain/category/interactor/SetSortModeForCategory.kt
Redundant with predictive back, but also just sort of pointless since it doesn't help
with any sort of app state retention.
(cherry picked from commit 8f4bc71cf7b99fe0b0d2ea68dfca0140477686cc)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsGeneralScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
* Replace RxJava in extension installer
Replace common downloadsRelay with Map of individual StateFlows
* Drop RxRelay dependency
* Simplify updateAllExtensions
* Simplify addDownloadState/removeDownloadState
Use immutable Map functions instead of converting to MutableMap
(cherry picked from commit 0ac38297f4bdeb83b2d9c8919b89520e9722f35e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
Still limits to things within the past 3 months though.
Closes#9554
(cherry picked from commit 4c65c2311e09bf5dcb77327c415a6fddd12123c5)
# Conflicts:
# data/src/main/java/tachiyomi/data/updates/UpdatesRepositoryImpl.kt
# domain/src/main/java/tachiyomi/domain/updates/interactor/GetUpdates.kt
* Add Grace Period value and settings
* Add functions to calculate nextUpdate
* update per review
* Move more into SetMangaUpdateInterval, keep wrapper
(cherry picked from commit c90f3449108a8362fea1ee9070979b5a14be9be5)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
# domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt
Related to #7813. It still starts below the status bar, but it looks a bit less weird.
(cherry picked from commit 899fe57f154c01d9dab46863641d1094267c991d)
Closes#9442 because I just removed the rounding entirely...
(cherry picked from commit 929a881943bd0a08b2209ee478be1fcd6539de7b)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt
The Dialog is handling it anyway, so this doesn't really do anything useful.
We might need to add this back if Dialog actually handles edge-to-edge properly.
(cherry picked from commit e3b27209246c60e2de7033976573681352fee7f9)
* Rename removeFromQueueByPredicate to removeFromQueueIf
Follow-up to PR comment in #9511
* Make Download hashCode stable
Mutating pages would previously change the Download hashCode, which
breaks HashMap lookups.
* Convert Donwloader subscription to coroutine
Replace downloadsRelay with activeDownloadsFlow. Instead of managing
a PublishRelay independent from the queue, derive a Flow of active
downloads directly from the queue StateFlow. (This will allow
updating the queue without pausing the downloader, to be done in a
follow-up PR.)
When a download completes successfully, the downloads is removed from
queueState. This updates activeDownloadsFlow and causes the
downloaderJob start the download job for the next active download.
When a download fails, the download is left in the queue, so
queueState is not modified. To make activeDownloadsFlow update
without a change to queueState, use transformLatest and use the
Download statusFlows to suspend until a download reaches the ERROR
state.
To avoid stopping and starting downloads every time
activeDownloadsFlow emits a new value, maintain a map of current
download Jobs and only start/stop jobs in the difference between
downloadJobs and activeDownloads. To make sure all child download
jobs are cancelled when the top-level downloader job is cancelled,
use supervisorScope.
* Remove obsolete main thread references in Downloader
Thread safety of the queue state used to be guaranteed by running all
queue mutation on the main thread, but this has not been true for
some time. Since the queue state is now backed by a StateFlow,
queueState can be safely updated by any thread.
(cherry picked from commit 3ae1e37c40fcfa43798377d2d9b8af58ec4498db)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt