* 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)
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
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
* Implemented local cover encryption and made coil capable of reading encrypted cover archives
* add check that the file is not an image before determining that it is a zip file
Issues:
- Apache implementation relies on methods unavailable on lower Android API levels
- Using input stream implementation doesn't seem to read some files properly, but using
ZipFile implementation still requires reading the entire thing into memory
(cherry picked from commit 6f59c6c6bb12f1ef123abd418001c7a86d43ef7a)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt
I feel like this needs to be aligned with the browse screen/deduped somehow, but that can happen separately.
Fixes#9444
(cherry picked from commit 1b25290d399037fe2d9744a899f86ca128699f8e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt
Fetch each source image URL immediately before downloading each image
instead of fetching all URLs and then downloading all images.
Source image URLs may change, so the downloader may fail if there is
too long a delay between fetching the image URL and downloading the
image.
(cherry picked from commit bbe0ab1dd0b51bcb91ff0a7f78555b078d73201e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt