Commit Graph

5631 Commits

Author SHA1 Message Date
Two-Ai
ffa8c8fd07
Remove RxJava in PageHolder (#9103)
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.
2023-02-18 10:07:27 -05:00
arkon
0ef7650c1a Avoid crashing if opening browse with unavailable source 2023-02-15 22:47:47 -05:00
Two-Ai
4635e58405
Simplify PageHolder load Job (#9086)
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.
2023-02-15 22:24:55 -05:00
Two-Ai
dc2eaf0788
Fix ID type mismatch in MigrateSearchScreenModel (#9090)
`it.id` is the source ID of the source being sorted.
`state.value.manga!!.id` is the manga ID of the selected manga.
`state.value.manga!!.source` is the source ID of the selected manga.
2023-02-14 11:46:31 -05:00
0x7673
d02b0ca2db
Add copy tags to clipboard feature (#9063) 2023-02-13 22:52:10 -05:00
arkon
4d607c4aed Don't apply Wi-Fi network restriction for manual library update jobs
Fixes #9074
2023-02-12 23:15:16 -05:00
Ivan Iskandar
be4072c86b
Rework on the wheel picker (#8559)
* 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>
2023-02-12 23:10:47 -05:00
arkon
2970eca9e4 Remove background extensions updates check
Same reasoning as removing app update check. It gets kicked off in the foreground now too.
2023-02-12 23:07:11 -05:00
arkon
42954609b9 Remove background app update check
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.
2023-02-12 22:44:39 -05:00
arkon
6348cbaeb7 Add option to hide entries already in library when browsing sources
Closes #2941
2023-02-12 22:28:12 -05:00
arkon
a7cb33d8c9 Open global search when Browse is tapped twice
Closes #3925
2023-02-12 18:17:46 -05:00
stevenyomi
ec46b2281b
Add note to migration copy string (#9075) 2023-02-12 18:17:39 -05:00
arkon
3a2dc46ff0 Replace Local and In Library badge text with icons
Fixes #5725
2023-02-12 17:22:34 -05:00
arkon
e052bdef96 Move reader preloading to IO scope
Maybe fixes #8440
2023-02-12 16:14:12 -05:00
arkon
d522d6d545 Avoid preload download check if chapter is already loaded or loading
Maybe fixes #8953, #9060
2023-02-12 16:03:24 -05:00
Two-Ai
7b118eba22
Clean up LibraryItem (#9072)
* 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()
2023-02-12 15:25:27 -05:00
arkon
f6e6a7ddf1 Replace custom download amount with next 25
Simplifies things and maybe discourages whacky downloading behavior?
Users can still range select in the chapters list to download custom amounts.
2023-02-12 15:25:09 -05:00
arkon
5ce64ac7ff Update Cascade
Also clean up kotlinx.serialization versioning
2023-02-12 14:50:41 -05:00
Ivan Iskandar
1671a56f42
MangaCoverDialog: Disable memory cache (#9066) 2023-02-10 22:38:59 -05:00
arkon
ab6dfe9e25 Bump dependencies
Fixes #8168, I think.
2023-02-08 22:53:42 -05:00
arkon
bff98ca768 Clean up chapter item composables a bit
Might help with #9043?
2023-02-08 22:17:40 -05:00
arkon
32b9b261f0 Rename Security settings to Security and privacy
Closes #9049
2023-02-08 21:47:57 -05:00
arkon
23432e4405 Prioritize finding selected chapter when deduping reader chapters
Fixes #9054
2023-02-08 21:47:57 -05:00
Ivan Iskandar
34a586ce48
Scaffold: Fix snackbar bottom inset (#9052) 2023-02-08 09:37:12 -05:00
Ivan Iskandar
ad762f8303
Remove FAB extra padding in DownloadQueueScreen (#9053) 2023-02-08 09:37:04 -05:00
arkon
389b039679 Update version check for library update job migration
Forgot to bump as part of fixing merge conflict for last commit.
2023-02-07 23:22:56 -05:00
Ivan Iskandar
ef9dacde79
Fully utilize WorkManager for library updates (#9007)
No more trampolining, and stuff.

It's pretty much straight copy-paste from the service, with
some changes related to cancellation handling. Manual updates
will also runs with workman job so auto update work
scheduling need some adjustments too.

Bumped version code to re-enqueue auto update job with the
new spec.

Co-authored-by: arkon <arkon@users.noreply.github.com>
2023-02-07 22:37:20 -05:00
0x7673
13bb45b4be
Fix crash in library when selected category is deleted (#9044) 2023-02-07 22:19:46 -05:00
Two-Ai
bd2cb97179
Replace RxJava in DownloadQueue (#9016)
* Misc cleanup

- Replace !List.isEmpty with List.isNotEmpty
- Remove redundant case in MoreScreenModel
- Drop no-op StateFlow.catch
  - From lint warning:
> SharedFlow never completes, so this operator typically has not
> effect, it can only catch exceptions from 'onSubscribe' operator

* Convert DownloadQueue queue to MutableStateFlow

Replace delegation to a MutableList with an internal
MutableStateFlow<List>.

In order to avoid modifying every usage of the queue as a list, add
passthrough functions for the currently used list functions. This
should be later refactored, possibly by inlining DownloadQueue
into Downloader.

DownloadQueue.updates was a SharedFlow which updated every time a
change was made to the queue. This is now equivalent to the queue
StateFlow.

Simultaneous assignments to _state.value could cause concurrency
issues. To avoid this, always modify the queue using _state.update.

* Add Download.statusFlow/progressFlow

progressFlow is based on the DownloadQueueScreenModel implementation
rather than the DownloadQueue implementation.

* Reimplement DownloadQueue.statusFlow/progressFlow

Use StateFlow<List<T>>.flatMapLatest() and List<Flow<T>>.merge() to
replicate the effect of PublishSubject.

Use drop(1) to avoid re-emitting the state of each download each time
the merged flow is recreated.

* fixup! Reimplement DownloadQueue.statusFlow/progressFlow
2023-02-07 22:13:19 -05:00
stevenyomi
0d8f1c8560
Tweak Response.parseAs() to utilize intrinsics (#9047) 2023-02-07 22:10:28 -05:00
arkon
477e3d9b94 Release v0.14.4 2023-02-05 10:35:15 -05:00
arkon
3c16082636 Don't show SourceNotInstalledException name in error snackbar 2023-02-05 10:23:30 -05:00
arkon
29aee68ec7 Revert "Show no pinned sources message when attempting to migrate/search"
This reverts commit 6bb3070c57.

This doesn't quite work correctly, so reverting for now.
We'll have to have more robust states or something to deal with this in the
future.
2023-02-05 10:20:19 -05:00
arkon
75e23299b4 Bump desugaring libs 2023-02-05 10:02:20 -05:00
Weblate (bot)
935ff1ee98
Translations update from Hosted Weblate (#8960)
Weblate translations



















Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fa/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/gl/
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/ko/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
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/th/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Abou <aboozar.gh.r@gmail.com>
Co-authored-by: Alba Paz <albapazpi@gmail.com>
Co-authored-by: Ali Aljishi <ahj696@hotmail.com>
Co-authored-by: Blue <bluestuffish@gmail.com>
Co-authored-by: Dan <denqwerta@gmail.com>
Co-authored-by: FTDaily <farrell05june2005@gmail.com>
Co-authored-by: Gabriel Lebis <gableb@hotmail.fr>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Shippo <Shipox@users.noreply.hosted.weblate.org>
Co-authored-by: Swyter <swyterzone@gmail.com>
Co-authored-by: The Ghost <marcc2018@gmail.com>
Co-authored-by: ZiomaleQ <r.partyka30@gmail.com>
Co-authored-by: altinat <altinat@duck.com>
Co-authored-by: jinu147 <nesqea20@gmail.com>
Co-authored-by: stevenlele <stevenlele@outlook.com>
2023-02-05 10:00:14 -05:00
renovate[bot]
c672cb81ec
Update dependency com.android.tools.build:gradle to v7.4.1 (#9024)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-05 09:56:17 -05:00
stevenyomi
7559c133c0
Call.await(): copy exception message when preserving error stack (#9013) 2023-02-01 11:09:35 -05:00
stevenyomi
589bdba0b1
Show exception class in snackbar message (#9006)
* Show exception class in snackbar message

* omit IOException too
2023-01-31 22:36:53 -05:00
Two-Ai
aca65f13bb
Misc Service cleanup (#9005)
* Simplify DownloadService wake lock handling

_isRunning is only modified in onCreate/onDestroy, so the listener
job is redundant.

* Drop superclass calls to Service.onCreate/onDestroy

From https://developer.android.com/guide/components/services
> Note: Unlike the activity lifecycle callback methods, you are not
> required to call the superclass implementation of these callback
> methods.
2023-01-30 17:25:54 -05:00
renovate[bot]
7bf30a094a
Update dependency androidx.compose.material:material to v1.4.0-alpha05 (#8997)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-29 10:35:19 -05:00
renovate[bot]
5454279a8e
Update dependency com.google.android.material:material to v1.8.0 (#8999)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-29 10:31:41 -05:00
renovate[bot]
006bcdf934
Update dependency androidx.core:core-ktx to v1.10.0-alpha02 (#8998)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-29 10:27:48 -05:00
Andreas
b00f00730d
Set InsertPage status to Ready (#9001)
Fixes insert page just loading
2023-01-29 09:03:12 -05:00
arkon
f2c48480b6 Move some interactors to domain module 2023-01-27 22:37:17 -05:00
arkon
1730dd6af1 Move more things around 2023-01-27 22:31:12 -05:00
Andreas
2501fef9e4
Split UpdatesGridGlanceWidget into smaller bits (#8991)
- Renamed Composables
- Moved Constants to core module
2023-01-27 14:49:57 -05:00
Andreas
12e41b6e6f
Move Glance Widget to seperate module (#8989)
Move Widget to seperate module

- Create a core module for presentation. Widget and App will share some resources and hopefully composables
2023-01-26 17:53:24 -05:00
beerpsi
c892c793a8
[BackupRestorer] Handle uncompressed backups (#8988)
[Backups] Handle uncompressed backups
2023-01-26 09:14:18 -05:00
Two-Ai
3a82b4d924
Don't crash on timeout in renewCache() (#8986)
Fixes #8962.

withTimeout throws a TimeoutCancellationException if the timeout
expires. To avoid crashing renewalJob when there are no extensions,
use withTimeoutOrNull which does not throw on timeout.
2023-01-25 18:18:17 -05:00
Two-Ai
b4b3a4d286
Fixup HttpPageLoader _loadPage (#8984)
Fixup for e4bc8990 (#8955)

HttpSource.fetchImage() uses Call.asObservableSuccess(), which
cancels the call on unsubscribe. This causes the call to be cancelled
before it is used, leading to a "java.net.SocketException: Socket is
closed" when trying to use the response in putImageToCache().

To fix this, use Call.awaitSuccess() via a new HttpSource.getImage()
suspending function. This addition to source-api is only intended for
app use, so it will not be added to the extensions-api stubs.
2023-01-25 18:18:12 -05:00