9026 Commits

Author SHA1 Message Date
Ivan Iskandar
434b8d3ae8 composed Modifier changes (#9631)
Referring at the examples and other internal usages, the
resulting stateful Modifier should be separated from
all the previous Modifier chain.

(cherry picked from commit 25b0458930b3de21340cdc201e7e5e46501dbda1)
2023-06-24 14:19:43 -04:00
Ivan Iskandar
9f1b349960 Use lite compose-ui-tooling module on release builds (#9630)
The size reduction is minuscule but it's there.

(cherry picked from commit 6808fbbb21acaac4e866b5023146a97b86a9d68e)
2023-06-24 14:19:35 -04:00
zaghdaneh
7e82f21308 Remove manga from trackers (#9535)
* Dialog for service tracker removal added, anilist query prepared

* added API delete requests for Mal and Kitsu

* implement and fix tracker delete for anilist, shikimori, mangaupdates

* implement and test mal delete request

* Update to dialog text to reflect current tracker

* finish kitsu api request and block bangumi tracker removal

* Change delete flag into interface, localise strings, clean up logs

* Add shikimori delete compatibility for already existing entries

* update track delete dialog prompt to include checkbox, update strings

* Update i18n/src/main/res/values/strings.xml

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

* Update i18n/src/main/res/values/strings.xml

---------

Co-authored-by: unknown <zaghdane@fireflow.de>
Co-authored-by: arkon <arkon@users.noreply.github.com>
Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
(cherry picked from commit b36b3bfcabd4a33826b455e1cdfc06fde110a452)
2023-06-24 14:19:23 -04:00
arkon
89ba9c490d Update Guava
(cherry picked from commit 7f0ed58b5401251c93b7edd9569a44ca044118db)

# Conflicts:
#	.github/renovate.json
2023-06-24 14:19:11 -04:00
Ivan Iskandar
ec1e83a21b Update core-splashscreen (#9629)
(cherry picked from commit b4393ff741793ba84f92956899df0c429b907b0e)

# Conflicts:
#	.github/renovate.json
2023-06-24 14:18:37 -04:00
Ivan Iskandar
d00bf25149 Update Compose BOM v2023.06.00-alpha01 (#9628)
(cherry picked from commit b8af1621b52e3c2a47d9ed4f40051413e51b238b)
2023-06-24 14:18:13 -04:00
Ivan Iskandar
c0088f9e5e Update Paging and match version (#9626)
(cherry picked from commit 4a75f82a6fc10341e951e56ad8ce4fb4072c5d63)
2023-06-24 14:18:04 -04:00
Ivan Iskandar
13f49234dc Bump compile SDK version 34 (#9625)
(cherry picked from commit 740e370465444beaa52af7aae9016c9cf67cd066)
2023-06-24 14:17:56 -04:00
renovate[bot]
6c2287f5b2 Update dependency ch.acra:acra-http to v5.10.1 (#9614)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(cherry picked from commit 245985bf42867cb1841432f316d954a0a2e49b52)
2023-06-24 14:17:46 -04:00
renovate[bot]
922e94ad00 Update dependency io.github.fornewid:material-motion-compose-core to v1.0.3 (#9613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(cherry picked from commit 344f5afd505d652fb17578fb95d6c2f16631ebab)
2023-06-24 14:17:36 -04:00
Weblate (bot)
287a2fb544 Translations update from Hosted Weblate (#9579)
Weblate translations

Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ko/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ne/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/th/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Adhwa King Dota <stevetom506@gmail.com>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Ali Aljishi <ahj696@hotmail.com>
Co-authored-by: Clxff H3r4ld0 <123844876+clxf12@users.noreply.github.com>
Co-authored-by: Dan <jonweblin2205@protonmail.com>
Co-authored-by: DarKCroX <DarKCroX@users.noreply.hosted.weblate.org>
Co-authored-by: Deniz <denizgezgin365@gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Efe Devirgen <efedevirgen@gmail.com>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Giorgio Sanna <sannagiorgio1997@gmail.com>
Co-authored-by: ID-86 <id86dev@gmail.com>
Co-authored-by: InfinityDouki56 <ced.paltep10@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Piotr <growgra@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Swyter <swyterzone@gmail.com>
Co-authored-by: altinat <altinat@duck.com>
Co-authored-by: jinu147 <nesqea20@gmail.com>
Co-authored-by: sebastians17 <sebastians117.ss@gmail.com>
Co-authored-by: stevenlele <stevenlele@outlook.com>
Co-authored-by: sunfkny <1198355143@qq.com>
Co-authored-by: 朔夜月 <a03175ii0@gmail.com>
(cherry picked from commit 1c6e5605f9b6377b9a35c69d5267ea6d95e878c4)
2023-06-24 14:17:19 -04:00
arkon
2f360a3fd7 Avoid crash when trying to open random entry but categories are still loading
Fixes #9610

(cherry picked from commit 0871208023b46452fbf26f9baebea82cecb33f39)
2023-06-24 14:16:59 -04:00
arkon
bf0dee8d03 Blur manga info header image
Similar to J2K. This only applies on Android 12+.

(cherry picked from commit ee95c1439f8c47d912c88bd9ebb442e64a89f8ff)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt
2023-06-24 14:16:49 -04:00
arkon
1c090ad621 Don't update last page read/read state of chapter if Incognito Mode is enabled
Actually closes #7228, which I forgot was about history more than trackers.

(cherry picked from commit e323f3c25a22ba7b9b831f17064ee7196b5ce951)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt
2023-06-24 14:16:14 -04:00
arkon
1976d9d6da Don't update trackers after reading a chapter if Incognito Mode is enabled
Closes #7228

(cherry picked from commit 9766399539c70db3f89bddeb67c69cf09e7b70ae)
2023-06-24 14:13:17 -04:00
AntsyLich
3abec5dd6f Increase update screen limit to 500 (#9599)
(cherry picked from commit fc4fd487f9a6489cbc4691f22da9b240b8b6358c)

# Conflicts:
#	domain/src/main/java/tachiyomi/domain/updates/interactor/GetUpdates.kt
2023-06-24 14:13:08 -04:00
Jobobby04
bc816d7b49 Fix downloaded merged chapters in reader 2023-06-24 14:12:32 -04:00
Simon
e2840b6b9d Filter out non-downloaded chapters in reader when Downloaded Only is enabled (#9568)
* FIxed Issue #5463 - DownloadedOnly Bug

* Changes according to Feedback

* Changes according to Feedback

---------

Co-authored-by: AlphiGhost <71730726+AlphiGhost@users.noreply.github.com>
(cherry picked from commit dddba7bb6f1fdea7c853d07a3c8f0ad7c99a12d5)
2023-06-24 14:03:30 -04:00
Ivan Iskandar
a9e7619e48 MangaChapterListItem: Increase swipe action touch slop (#9598)
(cherry picked from commit 9ec8d770eaa364972b6a114fb788391db4e70806)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt
2023-06-24 14:03:21 -04:00
Two-Ai
a87a35ec73 Cleanup MangaScreenModel successState usage (#9582)
* 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)
2023-06-24 14:02:20 -04:00
arkon
ecdb4ed01c Fix LibraryFlagsTest
Forgot to update these after LibraryDisplayMode was made to not be a flag.

(cherry picked from commit 0d9f8e8743b1a03f30a8a3050b9a896f337ba25f)
2023-06-24 14:02:11 -04:00
arkon
805a88df25 Add share menu item in reader
Closes #9510

(cherry picked from commit 841f80f935225bdb7ee7e400d2b2aa8176c5e4c5)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/res/menu/reader.xml
2023-06-24 13:43:29 -04:00
arkon
40353c6dc9 Directly track current WebView URL instead of relying on state
State approach doesn't work well for client-side routed apps like MangaDex.

Fixes #9576

(cherry picked from commit 39a7356ed15b111fd940fc4bb8059f7130a1542e)
2023-06-24 12:25:53 -04:00
arkon
bda6f7e041 Bump dependencies
(cherry picked from commit 438054a0ec9e39f9c0e7023199013262e8f99ff2)
2023-06-24 12:25:43 -04:00
arkon
c99986f4f5 Remove General settings section
(cherry picked from commit 34b9c82cd0ca07ded2cd079a9cc18229a02a9a81)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsGeneralScreen.kt
2023-06-24 12:25:21 -04:00
arkon
23170b6f03 Remove per-category display mode
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
2023-06-24 12:10:45 -04:00
Ivan Iskandar
ff9b7a1325 ReaderProgressIndicator: Convert to Compose (#9574)
(cherry picked from commit 39e456846094abd623f84d642721a2d97bd803a4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2023-06-24 11:23:55 -04:00
Weblate (bot)
724b3c4e75 Translations update from Hosted Weblate (#9531)
Weblate translations

Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/jv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ko/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ne/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/th/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/vi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Ali Aljishi <ahj696@hotmail.com>
Co-authored-by: AntonP <tony.pug.stark@gmail.com>
Co-authored-by: Christian Elbrianno <crse@protonmail.ch>
Co-authored-by: Clxff H3r4ld0 <123844876+clxf12@users.noreply.github.com>
Co-authored-by: Dan <denqwerta@gmail.com>
Co-authored-by: Danel Dave Barbuco <barbucodanel@gmail.com>
Co-authored-by: DatTran MLL <tranthanhdat1142003@gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Ferran <ferrancette@gmail.com>
Co-authored-by: Giorgio Sanna <sannagiorgio1997@gmail.com>
Co-authored-by: ID-86 <id86dev@gmail.com>
Co-authored-by: Igor <zerrxs@gmail.com>
Co-authored-by: Izxmi <heltherrivas05@gmail.com>
Co-authored-by: Leonardo Falcoski <leonardo.falcoski@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rostyslav Haitkulov <info@ubilling.net.ua>
Co-authored-by: Swyter <swyterzone@gmail.com>
Co-authored-by: TheKingTermux <achmadmaulana0233@gmail.com>
Co-authored-by: Uzuki Shimamura <hzy980512@126.com>
Co-authored-by: altinat <altinat@duck.com>
Co-authored-by: stevenlele <stevenlele@outlook.com>
(cherry picked from commit 0d96791a84ac28cbd94218a23c78d41cd4efb62a)
2023-06-24 11:22:37 -04:00
arkon
b0b02e24c5 Hide release period update restriction in non-dev builds until ready
(cherry picked from commit 531e1c62bb8ba62f3fe84efce60210b5b5560368)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
2023-06-24 11:22:24 -04:00
arkon
b42f1f2df8 Bump dependencies
(cherry picked from commit 1a1f16f44aba242a52aed628ddd38bc2793ca406)

# Conflicts:
#	gradle/kotlinx.versions.toml
2023-06-24 11:21:58 -04:00
arkon
7c9398f9d5 Address minor build warnings
(cherry picked from commit 431f8772f8ad2f30d71bb6565ec2644e4e56c691)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt
2023-06-24 11:21:18 -04:00
arkon
dbe2d1a11f Fix misleading release grace period "Default" options
(cherry picked from commit 8a5382042c58cfb54b206700fd6c4889fd278570)
2023-06-24 11:20:24 -04:00
arkon
8877ddb015 Remove confirm exit option
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
2023-06-24 11:20:13 -04:00
Two-Ai
728c715bf4 Replace RxJava in extension installer (#9556)
* 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
2023-06-24 11:17:45 -04:00
arkon
a90eb778d8 Limit updates to 250 most recent chapters
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
2023-06-24 11:16:54 -04:00
arkon
98697566e3 Minor cleanup
(cherry picked from commit f48f212001900c750585676107bae4fdb7cdbaeb)
2023-06-24 10:45:15 -04:00
Quang Kieu
ae18af8413 Add setting and calculate for update interval (#9399)
* 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
2023-06-24 10:45:01 -04:00
Ivan Iskandar
aafb685bf5 Update Glance v1.0.0-beta01 (#9551)
(cherry picked from commit a458bd9fdb1750bde246df438d13dfa1d79185be)
2023-06-24 10:43:49 -04:00
arkon
38abea0513 Set reader chapter name to marquee if too long
Closes #7159

(cherry picked from commit ed5a56be60d144c917b7b09bf183c688e6d54b06)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2023-06-24 10:43:42 -04:00
arkon
de0d6f647b Slightly tweak MangaScreen refresh indicator
Related to #7813. It still starts below the status bar, but it looks a bit less weird.

(cherry picked from commit 899fe57f154c01d9dab46863641d1094267c991d)
2023-06-24 10:42:51 -04:00
arkon
aa938445f0 Add debug screen to copy backup file schema
Closes #8544

(cherry picked from commit bac42edabba421d80dd650c5e1781b64c262ed0e)
2023-06-24 10:42:43 -04:00
arkon
3167128e30 Fix bookmarked chapters being deleted after manually marked as read
Fixes #9520

(cherry picked from commit 8735f3566ff1b7945ba062d098302875fdf8eeab)
2023-06-24 10:42:34 -04:00
arkon
88d4087642 Fix some crashes
(cherry picked from commit 46efd4c13430881d8593d4fc3cb899dfd3deacdd)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
2023-06-24 10:42:27 -04:00
arkon
491cfafddb Use primitive state holders
(cherry picked from commit dfd38db7e33bd708ccb688f3fe02d4e0105083f2)
2023-06-24 10:40:44 -04:00
Ivan Iskandar
2a921d008e Bump Compose BOM version 2023.04.00-beta01.1 (#9548)
(cherry picked from commit 0189fc1f6677bf7b203609cc4f76fdf61a84b757)
2023-06-24 10:40:37 -04:00
arkon
43ddcf8d2c Simplify chapter item composable a bit
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
2023-06-24 10:40:24 -04:00
arkon
479ab126c2 Minor cleanup and remove unused dependencies
(cherry picked from commit 152fdec855cccfb479af8f74f1d4099be0ac399c)
2023-06-24 10:39:23 -04:00
Artemis-CtrlAltDel
5b110cec23 fix: grid size slider (#9542)
(cherry picked from commit 9c07451d957761b387663caef8b0f46746aa98e1)
2023-06-24 10:39:16 -04:00
arkon
6d5087b638 Remove redundant inset handling in AdaptiveSheet
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)
2023-06-24 10:39:07 -04:00
Two-Ai
81b752eb76 Replace RxJava in Downloader (#9256)
* 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
2023-06-24 10:38:59 -04:00