Commit Graph

4110 Commits

Author SHA1 Message Date
arkon
bff98ca768 Clean up chapter item composables a bit
Might help with #9043?
2023-02-08 22:17:40 -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
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
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
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
stevenyomi
448702e5be
OkHttp Call: split await() and awaitSuccess() (#8980) 2023-01-24 22:34:31 -05:00
Two-Ai
2ef1f07aae
Replace PageLoader.getPage() with PageLoader.loadPage() (#8976)
* Follow page status via StateFlow

Keep getPage subscription since it's needed to load the pages

* Replace PageLoader.getPage with PageLoader.loadPage
2023-01-23 17:10:44 -05:00
stevenyomi
1a319601de
Fix extension search query cursor and debounce (#8972)
* Fix extension search query cursor

* debounce

* extract debounce constant
2023-01-22 16:19:46 -05:00
Andreas
cdf242e8c8
Move more to data and domain modules (#8973) 2023-01-22 16:19:22 -05:00
Andreas
aee785a8bb
Move more implementation to data module (#8971) 2023-01-22 11:44:39 -05:00
arkon
d45fc1e245 Move more models to domain module 2023-01-22 11:04:50 -05:00
arkon
14500ba4f8 Move more repositories to domain module 2023-01-22 10:59:52 -05:00
arkon
345e9c2a9a Move more models to domain module 2023-01-22 10:54:28 -05:00
arkon
b53e24e0db Move more models to domain module 2023-01-22 10:37:13 -05:00
Andreas
d3a73fc228
Move Category model and repository to domain and data layer (#8967)
To keep the commit from being 100+ files the interactors wasn't moved.

The domain module like the data module uses `tachiyomi` instead of `eu.kanade.tachiyomi` for package names
2023-01-22 10:12:29 -05:00
arkon
2ebc8d9ae5 Save current page state on configuration change
Fixes #8881

The actual issue is that the ViewModel migration actually differs between what the current `init` block
and previous `onSave` methods did; where the `init` block does not get triggered on saving the
instance on config changes.

Not entirely sure why onSaveInstanceState was explicitly avoided for config changes before, but we
just do it all the time now and end up updating the requestedPage with the current page.
2023-01-21 20:18:12 -05:00
zbue
e28b015580
MangaScreenModel: Make download function follow reader preference (#8920)
* Make download function more clearer in manga screen

Maybe resolves #8879

* Minor cleanup

* Minor cleanup 2
2023-01-21 16:47:22 -05:00
Two-Ai
e4bc8990fb
Replace RxJava in HttpPageLoader downloader (#8955)
* Convert downloader Observable to flow

Uses `runInterruptible` to turn the blocking call to `queue.take()`
into a cancellable call.

Flow collection is ended by cancelling the scope in `recycle`. This
means the `HttpPageLoader` can't be reused after calling `recycle`,
but this was true with the `Observable` as well.)

* Convert load Observables to suspending function

Inlining the Observables allows for some simplification of the error
handling. Behavior should be otherwise identical.

* Convert cleanup Completable to coroutine

Uses global `launchIO`, not ideal but similar to previous behavior.
Can't be scheduled on the local `scope` as this runs after `scope` is
cancelled.
2023-01-21 16:46:16 -05:00
Andreas
823749fc1e
Move SQLDelight to data module (#8954)
And use tachiyomi instead of eu.kanade.tachiyomi for package names in the module
2023-01-21 10:37:07 -05:00
arkon
7a972dfdb7 Don't use platform attributes for white/black reader backgrounds
Probably fixes #8946
2023-01-18 22:49:28 -05:00
arkon
2695a4d8c7 Update local source icon and differentiate from fallback source icon
Closes #8934
2023-01-16 22:54:45 -05:00
arkon
1a4dad72a9 Hide WebView menu item in reader if local
Closes #8932
2023-01-16 22:40:36 -05:00
beerpsi
b7e6b4c28a
[MyAnimeList] Handle cases where my_list_status.status is not present (#8931) 2023-01-16 21:59:07 -05:00
stevenyomi
293b967858
Fix installing extensions on MIUI (#8916)
* Fix installing extensions on MIUI

* isShizukuReady -> isShizukuInstalled
2023-01-15 10:32:27 -05:00
arkon
e468554fd9 Assign keys for global search rows based on source
Maybe fixes #8924
2023-01-15 10:14:28 -05:00
arkon
5b5eb92184 Fix checking downloads banner showing up incorrectly 2023-01-14 20:04:36 -05:00
Two-Ai
58ebf14691
Convert PageLoader.getPages to suspending function (#8917) 2023-01-14 19:45:15 -05:00
Verzaukeks
992bab4f79
Prevent scrolling outside bounds in webtoon/vertical reading mode (#8821) 2023-01-14 18:38:52 -05:00
zbue
f301dc64f0
Allow partially read chapters to be marked as unread in updates screen (#8884)
* Allow partially read chapters to be marked as unread in updates screen

* Review changes

* Review changes 2
2023-01-14 18:26:40 -05:00
zbue
33a2219716
Enable confirmButton only when needed to respond to user input (#8848)
* Enable `confirmButton` when appropriate

* Show error in dialog instead

* Follow M3 guidelines
2023-01-14 18:24:57 -05:00
Two-Ai
62480f090b
Replace RxJava in ChapterLoader and ReaderViewModel (#8915)
* Replace RxJava in ChapterLoader

* Don't swallow CancellationException

* Simplify loadChapter behavior

* Add error handling to loadAdjacent
2023-01-14 18:22:27 -05:00
zbue
287489d7d0
Show chapter scanlator on reader transition (#8910)
Closes #7131
2023-01-14 17:00:04 -05:00
arkon
2df0236669 Show loading indicator during migration
Closes #8862
2023-01-13 23:01:52 -05:00
Aria Moradi
c54d77333f
Suwayomi Tracker: sync changes with Tachidesk v0.6.6 (#8902)
* Suwayomi Tracker: sync changes with Tachidesk v0.6.6

* replace var with val
2023-01-13 22:31:04 -05:00
Two-Ai
8c494f314c
Fix DownloadPageLoader resource leak (#8905)
The underlying ZipFile is leaking. To fix, store a reference to the
ZipPageLoader and recycle it on recycle.
2023-01-13 22:30:47 -05:00