Commit Graph

1327 Commits

Author SHA1 Message Date
arkon 88e9fefa59 Retry LibraryUpdateJob later if Wi-Fi condition not met 2023-06-25 14:31:28 -04:00
arkon 42bc2b07ce Minor cleanup 2023-06-23 22:39:59 -04:00
Shamicen fcfa62f220 Better handle decimal chapter numbers and add categories in ComicInfo.xml files (#9604)
* Serialize whole chapter numbers without decimal point and add library categories to genre

* added Tachiyomi specific ComicInfo Category field

* lint

* implemented requested changes
2023-06-23 17:56:01 -04:00
zaghdaneh b36b3bfcab 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>
2023-06-22 22:06:43 -04:00
arkon ee95c1439f Blur manga info header image
Similar to J2K. This only applies on Android 12+.
2023-06-13 20:36:33 -04:00
arkon 1a1f16f44a Bump dependencies 2023-05-31 22:48:13 -04:00
arkon 431f8772f8 Address minor build warnings 2023-05-31 22:47:31 -04:00
arkon 8735f3566f Fix bookmarked chapters being deleted after manually marked as read
Fixes #9520
2023-05-27 18:30:59 -04:00
Two-Ai 3ae1e37c40 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.
2023-05-24 18:02:27 -04:00
Ivan Iskandar 73118d4af7 DownloadCache: Fix freezing on initial loading of cache file (#9523) 2023-05-19 22:06:06 -04:00
Two-Ai c27bf4e866 Minor Downloader cleanup (#9511)
* Inline completeDownload

* Consolidate queueState updates in removeFromQueue

* Inline post-download steps into downloadChapter
2023-05-19 17:16:32 -04:00
arkon fb38d30775 Avoid attempts to renaming download dirs if name hasn't actually changed
Maybe fixes #9503
2023-05-14 12:24:40 -04:00
AntsyLich f70d5ea976 Delay automatic backup when restoring (#9492) 2023-05-12 18:02:11 -04:00
arkon b051e37ab7 Address minor build warnings 2023-05-06 23:11:14 -04:00
Two-Ai bbe0ab1dd0 Fix delay between URL fetch and image download (#9452)
Fetch each source image URL immediately before downloading each image
instead of fetching all URLs and then downloading all images.

Source image URLs may change, so the downloader may fail if there is
too long a delay between fetching the image URL and downloading the
image.
2023-05-05 22:17:51 -04:00
Two-Ai cb2d43c0d1 Ensure final download status is always set (#9453) 2023-05-05 22:17:05 -04:00
arkon 14c465d36f Get current track services when composing LibrarySettingsDialog
Fixes #9431
2023-05-03 14:41:08 -04:00
Andreas 02864ebd60 Move GitHub Release/App Update logic to data (#9422)
* Move GitHub Release/App Update logic to data

* Add tests for GetApplicationRelease

* Review changes
2023-04-29 22:14:49 -04:00
Quang Kieu 41c89eb61d Add interval data layer (#9398)
* Update Manga classes for fetch interval data

* Update per review

bump version

---------

Co-authored-by: quangkieu <qkieu>
2023-04-27 22:27:12 -04:00
arkon 67b4e53a58 Minor cleanup 2023-04-23 10:11:26 -04:00
Pauline 41cc1fe723 Fallback chapter name if it ends up as blank (#9220)
* 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
2023-04-22 11:11:56 -04:00
Eshlender 564a0980b9 Update track domain shikimori.me (#9333)
shikimori.me
2023-04-14 21:57:05 -04:00
arkon 75460e01c8 Remove crash log notification in favor of sharing directly 2023-04-02 15:30:22 -04:00
arkon be54b8862e Refactor away some unnecessary lambda expressions 2023-03-26 13:27:31 -04:00
arkon 1986042277 Skip POST_NOTIFICATIONS permission check for now
Fixes #9265
2023-03-26 12:34:32 -04:00
arkon cb4699a5bb Bump dependencies 2023-03-22 22:58:42 -04:00
arkon ac0596a53d Revert "Always attempt to split tall images when downloading"
This partially reverts commit 2769525b2c.

Keeps the change to silently ignore spliting errors since it falls back to
the original images in those cases.
2023-03-20 08:45:36 -04:00
arkon 3cca460282 Misc cleanup 2023-03-19 22:38:14 -04:00
arkon 859601a46e Clean up WorkManager usages a bit 2023-03-19 18:19:40 -04:00
arkon cdc160afc2 Convert BackupRestoreService to a WorkManager job
Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
2023-03-19 17:28:59 -04:00
arkon 7d8a865cac Simplify some of the notification builders 2023-03-19 16:24:37 -04:00
Andreas dfdb688b43 Migrate things to use newer data models (#9239)
* Remove old database models from Coil

* Remove old database models from TrackInfoDialogHome

* Remove old database models from Backup Manager
2023-03-19 13:11:58 -04:00
arkon f3ca4e76a8 Re-enable ComicInfo.xml generation on download
Closes #8537
2023-03-19 13:02:38 -04:00
arkon 2769525b2c Always attempt to split tall images when downloading 2023-03-19 12:57:16 -04:00
Ivan Iskandar 4d3e13b0d1 Initialize download index disk cache (#9179) 2023-03-16 22:18:11 -04:00
arkon 47a2d06682 Refactor tracker status string mappings
Should fix #9195
2023-03-10 23:01:10 -05:00
arkon bebd4be43d Move more things to domain/data modules 2023-03-07 22:38:02 -05:00
arkon ad4912803b Refactor SourceManager/StubSource to domain module 2023-03-05 12:38:31 -05:00
arkon f96f0c5889 Move some preferences into domain module 2023-03-05 12:11:47 -05:00
Two-Ai b41565f879 Inline DownloadQueue into Downloader (#9159)
* Move statusFlow and progressFlow to DownloadManager

* Inline DownloadQueue into Downloader

* Move reorderQueue implementation to Downloader
2023-02-28 22:13:13 -05:00
Andreas f27dc19b37 Move Local Source to separate module (#9152)
* Move Local Source to separate module

* Review changes
2023-02-26 16:16:49 -05:00
Two-Ai 0505906e7a Move all DownloadService.stop calls to Downloader (#9146)
Downloader.stop is now the sole responsible for stopping the
DownloadService. This will help cleanly removing
DownloadService.stop when migrating to coroutines.
2023-02-25 15:40:22 -05:00
Two-Ai 79662a5866 Misc Downloader state cleanup (#9145)
* Replace Downloader CompositeSubscription with nullable Subscription

* Derive Downloader.isRunning from subscription

Also simplify usages of isRunning

* Move DownloadNotifier.paused to Downloader.isPaused

* Remove unused DownloadNotifier.errorThrown
2023-02-25 14:43:00 -05:00
Two-Ai 86b9262a7e Make DownloadManager the sole entry point for DownloadService (#9140)
* 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
2023-02-24 22:07:30 -05:00
Two-Ai 83a4e34095 Remove redundant Downloader isNotification argument (#9139)
DownloadQueue.clear() already sets QUEUE downloads to NOT_DOWNLOADED.
2023-02-24 15:11:51 -05:00
Two-Ai fa61c8fe6f Convert downloadChapter to suspend function (#9127)
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.
2023-02-21 23:02:10 -05:00
Two-Ai 779df32e98 Fix download queue page count display bug (#9126)
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.
2023-02-21 18:21:00 -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 d400ac2a49 Remove unnecessary usages of NotificationManagerCompat to actually create notifications 2023-02-18 17:10:45 -05:00
arkon f816196df2 Move more things to domain module 2023-02-18 15:14:04 -05:00