* change the directory's name for a download when the chapter's name is only composed of numbers or is blank
* maj in case the chapter name is blank or empty
* clean code
(cherry picked from commit 41cc1fe7237a52c830e87c8261254b7f59922a6b)
* Initial Implementation of encrypted CBZ archives
* changed a preference key to correct Syntax, changed a function name and changed ComicInfo padding length
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* add necessary imports
* fix indentation after merge conflict
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* fix indentation and add imports
* collect preferences as states
* test if password is correct in ZipPageLoader
* added withIOContext to function call
* added encryption type preference
* implemented database encryption
* added proguard rules for sqlcipher and generate padding length with SecureRandom
---------
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
This partially reverts commit 2769525b2c12547b8dc29b1209ea3bc5d22f1e3f.
Keeps the change to silently ignore spliting errors since it falls back to
the original images in those cases.
(cherry picked from commit ac0596a53d74561ad5174db1938c16049a65dd18)
This reverts commit 978a814815772d21bd95f138786914f6525e112d.
Going to just change the build system to output a new name format so that all the time doesnt go to waste
TachiyomiSY's APK didn't have this suffix.
The code now causes the corresponding architecture impossible to find, which leads to downloading the APK for arm64 when updating from x86_64.
Downloader.stop is now the sole responsible for stopping the
DownloadService. This will help cleanly removing
DownloadService.stop when migrating to coroutines.
(cherry picked from commit 0505906e7a554abe6bbbc2c1cd4a6bfaa9407bf6)
* 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
(cherry picked from commit 86b9262a7ef6c4e97f248bdf417b0e06503fefac)
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.
(cherry picked from commit fa61c8fe6fb4966f5d23f643759f0e4229b8f016)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
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.
(cherry picked from commit 779df32e98f2a020ca6a4f79c0748dd9f5b16873)
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
(cherry picked from commit 93523ef50b80ef294866bfb0da54e236cdf2d9f6)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt
# app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
# core/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt
# core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt
# domain/build.gradle.kts
# source-api/build.gradle.kts
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.
(cherry picked from commit 42954609b94e13d8fadbf1f3769e9f32fa9e8447)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt
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>
(cherry picked from commit ef9dacde79b1803ec117aae4ea948194b6394605)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
* 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
(cherry picked from commit bd2cb97179de60dded147f1ec9cdb55f70f28e74)
* 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.
(cherry picked from commit aca65f13bb94b6c0c4a77a9d426491d3667f4a7d)