1:1 translation from the RxJava implementation, should match the
previous behavior.
Dropped the return value from functions of the form
```
fun foo(t: T, ...): Observable<T>
```
where the Observable produced the original argument `t`.
The caller already has the result if necessary.
While this conversion is not flow-based overall, some sections use
flows to use the flatMapMerge and retryWhen operators.
Removed RetryWithDelay as it was only used here.
Inlined fetchAllImageUrlsFromPageList instead of converting it to a
suspending equivalent. fetchAllImageUrlsFromPageList is no longer
used in the app, but was not removed as it is part of source-api.
(However, it does not seem to be used exposed in extensions-lib or
used in tachiyomi-extensions.)
runBlocking is used as a temporary stop-gap.
(cherry picked from commit fa61c8fe6fb4966f5d23f643759f0e4229b8f016)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
When restarting a download, the page count would display as 0 until
the first page download completion, after all the existing pages were
rechecked.
To fix, calculate downloadedImages from pages instead of relying on
the downloader to reset and increment the count.
(cherry picked from commit 779df32e98f2a020ca6a4f79c0748dd9f5b16873)
Includes side effects:
- No longer need to restart app for user agent string change to take effect
- parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
(cherry picked from commit 93523ef50b80ef294866bfb0da54e236cdf2d9f6)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt
# app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
# core/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt
# core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt
# domain/build.gradle.kts
# source-api/build.gradle.kts
Inline readImageHeaderSubscription in PageHolder
Inline readImageHeaderSubscription in PagerPageHolder and
WebtoonPageHolder by converting setImage() into a suspend function.
The image processing runs in the loadPageAndProcessStatus
continuation.
Use suspendCancellableCoroutine as a substitute for doOnUnsubscribe
in WebtoonPageHolder.
Closing openStream after the frame.setImage but before the PageHolder
is recycled causes the page display to fail for reasons that are not
currently understood.
Remove subscription handling from WebtoonViewer/WebtoonBaseHolder as
it is no longer used.
(cherry picked from commit ffa8c8fd0746863e08b839f9d91102fe6d5d7887)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
Inline statusJob into loadJob, using supervisorScope to load the page
and track status changes in parallel.
- supervisorScope does not complete until both the child loadPage
coroutine and statusFlow.collectLatest have completed.
- Cancelling supervisorScope cancels the child loadPage coroutine and
statusFlow.collectLatest.
- Use supervisorScope instead of coroutineScope to let status
collection continue if loadPage fails.
Inline progressJob into loadJob, using collectLatest's cancellation
to avoid cancelling the progressFlow collection explicitly.
- collectLatest cancels the previous action block when the flow
emits a new value. This means the DOWNLOAD_IMAGE
progressFlow.collectLatest gets automatically cancelled when
statusFlow emits a new state.
Convert launchLoadJob to suspend function, move job launch to caller,
and rename as loadPageAndProcessStatus.
(cherry picked from commit 4635e58405eedce0b49fc69f7ccb190a7c600da9)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
* Rework the wheel picker
doesn't need for the animation to stop to change the value
* fix
---------
Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit be4072c86b9251bb7110f873c9332a2890ca69ef)
# Conflicts:
# .github/renovate.json
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
Same reasoning as removing app update check. It gets kicked off in the foreground now too.
(cherry picked from commit 2970eca9e4b56ede7549eb6d49841b7011fe0741)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
We already check in the foreground. If the app isn't being foregrounded at all, then there isn't much
point in checking for an update.
(cherry picked from commit 42954609b94e13d8fadbf1f3769e9f32fa9e8447)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt
* Move LibraryItem vars to constructor vals
* Convert LibraryItem to data class
Remove redundant equals and hashCode
* Remove unused LibraryItem.displayMode
* Simplify LibraryItem.matches()
* Align types in LibraryItem and LibraryBadges
* fixup! Simplify LibraryItem.matches()
(cherry picked from commit 7b118eba22b6c9caccf09cbd53f846869d5c6f2a)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt
Simplifies things and maybe discourages whacky downloading behavior?
Users can still range select in the chapters list to download custom amounts.
(cherry picked from commit f6e6a7ddf1d32a55da81344b1ae360e16e5560e4)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt