Commit Graph

5151 Commits

Author SHA1 Message Date
Ivan Iskandar
60a3ba5a5c
Use non-stable Compose BOM (#9120) 2023-02-21 10:41:56 -05:00
arkon
93523ef50b Remove dependency injection from core module and data module from presentation-widget module
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
2023-02-20 19:02:38 -05:00
arkon
10d7349506 Move more components to presentation-core module 2023-02-20 10:12:41 -05:00
arkon
3d7c136320 Avoid crash when loading invalid extension package 2023-02-19 16:44:58 -05:00
arkon
a6d6a5ed87 Merge branch 'patch'
# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
2023-02-19 15:31:35 -05:00
arkon
b690de55e5 Release v0.14.5 2023-02-19 15:25:35 -05:00
arkon
83fda20078 Avoid crashes if headers can't be built for usage in WebView
(cherry picked from commit ec49411bee)
2023-02-19 11:52:09 -05:00
arkon
f656a37045 Avoid crashing if getChapterUrl is not implemented
Fixes #9105

(cherry picked from commit ceaf579cb0)
2023-02-19 11:51:53 -05:00
Ivan Iskandar
c58b495433 MainActivity: Avoid navigator-related crash when handling onNewIntent (#9104)
(cherry picked from commit d3dadf71e8)
2023-02-19 11:51:44 -05:00
arkon
242aeb6a68 Avoid crashing if opening browse with unavailable source
(cherry picked from commit 0ef7650c1a)
2023-02-19 11:50:33 -05:00
Two-Ai
d9969cea8a 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.

(cherry picked from commit dc2eaf0788)
2023-02-19 11:50:26 -05:00
arkon
d61db5931e Move reader preloading to IO scope
Maybe fixes #8440

(cherry picked from commit e052bdef96)
2023-02-19 11:50:05 -05:00
arkon
0ea3ac9807 Avoid preload download check if chapter is already loaded or loading
Maybe fixes #8953, #9060

(cherry picked from commit d522d6d545)
2023-02-19 11:49:58 -05:00
Ivan Iskandar
f9e43f574f MangaCoverDialog: Disable memory cache (#9066)
(cherry picked from commit 1671a56f42)
2023-02-19 11:49:51 -05:00
arkon
5ef11e61d0 Prioritize finding selected chapter when deduping reader chapters
Fixes #9054

(cherry picked from commit 23432e4405)
2023-02-19 11:49:44 -05:00
Ivan Iskandar
48546c3db4 Scaffold: Fix snackbar bottom inset (#9052)
(cherry picked from commit 34a586ce48)
2023-02-19 11:49:38 -05:00
Ivan Iskandar
4d87ed496c Remove FAB extra padding in DownloadQueueScreen (#9053)
(cherry picked from commit ad762f8303)
2023-02-19 11:49:32 -05:00
0x7673
06d12e6562 Fix crash in library when selected category is deleted (#9044)
(cherry picked from commit 13bb45b4be)
2023-02-19 11:49:24 -05:00
arkon
ec49411bee Avoid crashes if headers can't be built for usage in WebView 2023-02-19 11:48:26 -05:00
arkon
3f7911235c Use unique keys for all screens to avoid crashes
Fixes #9008
Fixes #9110
2023-02-19 11:09:41 -05:00
arkon
727399611d Migrate library settings sheet to Compose 2023-02-18 20:55:55 -05:00
arkon
07fdb74fbc Minor settings sheet cleanup 2023-02-18 19:00:19 -05:00
arkon
d400ac2a49 Remove unnecessary usages of NotificationManagerCompat to actually create notifications 2023-02-18 17:10:45 -05:00
arkon
dd71c76a8f Move more components 2023-02-18 17:04:32 -05:00
arkon
58a0add4f6 Move more components to presentation-core module 2023-02-18 16:33:03 -05:00
arkon
bfe143015a Move more components to presentation-core module 2023-02-18 16:03:01 -05:00
arkon
e3cf863230 Start moving some Compose components to presentation-core module 2023-02-18 15:52:52 -05:00
arkon
ee818bc7c5 Move chapter utils to domain module 2023-02-18 15:24:04 -05:00
arkon
f816196df2 Move more things to domain module 2023-02-18 15:14:04 -05:00
arkon
ceaf579cb0 Avoid crashing if getChapterUrl is not implemented
Fixes #9105
2023-02-18 10:16:17 -05:00
arkon
b49280e347 Remove unused Rx/Coroutines converters 2023-02-18 10:16:05 -05:00
Ivan Iskandar
d3dadf71e8
MainActivity: Avoid navigator-related crash when handling onNewIntent (#9104) 2023-02-18 10:08:37 -05:00
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
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
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
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
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
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
Andreas
2b5d9fd76b
Move shared configuration to subprojects in root Gradle file (#8951)
* Move shared configuration to subprojects in root Gradle file

* Missed but not forgotten

* Review changes
2023-01-20 23:04:22 -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
Andreas
c31e75f02f
Create plugin for linting (#8942) 2023-01-18 22:33:56 -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
arkon
6fe650319d Bump versionCode to prevent downgrades
Since the database schema was changed in f301dc64
2023-01-14 18:27:36 -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