* Drop duplicate initial call in Preference.asHotFlow
Preference.changes() always starts by returning the current value of
the preference, so asHotFlow calls block twice on the initial value.
Possible breaking change: As implemented, asHotFlow ran block(get())
before returning the flow. After this change, the first call to block
will run within the flow collection. This might cause concurrency
issues if the flow collection is late to execute.
* Inline Preference.asHotFlow
The Preference.changes().onEach().launchIn() pattern is used widely,
so the asHotFlow extension method is redundant.
This partially reverts commit 2769525b2c.
Keeps the change to silently ignore spliting errors since it falls back to
the original images in those cases.
Jetpack Compose treats mouse input differently than just mimicking a touch input, so dragging doesn't actually
invoke the pull to refresh. If that changes in the future, we could consider removing these.
Doesn't seem too necessary for the extensions list, so I skipped that.
Closes#8455
Downloader.stop is now the sole responsible for stopping the
DownloadService. This will help cleanly removing
DownloadService.stop when migrating to coroutines.
* Rename functions for DownloadService internal use
* Call DownloadService.start via DownloadManager
* Inline DownloadService.stop into pauseDownloads
* Inline DownloadService.stop into clearQueue
NotificationReceiver will now also stop the DownloadService when
receiving ACTION_CLEAR_DOWNLOADS.
* Provide DownloadService.isRunning via DownloadManager
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.
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.
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