Commit Graph

263 Commits

Author SHA1 Message Date
arkon fc184f1cfa Clean up download ahead logic
- Remove redundant chapter sorting logic when fetching next chapter(s)
- Remove redundant download queue checks (it'll handle already queued or downloaded items)
- Trigger download ahead when read >= 25% of chapter rather than 20%
- Rely on download cache when checking if next chapter is downloaded to avoid jank (fixes #8328)
2022-10-30 16:59:33 -04:00
arkon fde7bfa3d1 Show notification while download cache is renewing
Since users seem to be confused now that the library loads before download info is shown...
2022-10-29 11:39:04 -04:00
AntsyLich 6e4a30e593 Fix "Download split" not working while using SD card (#8305)
* Fix "Download split" not working while using SD card

* Update app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt

Co-authored-by: arkon <arkon@users.noreply.github.com>
2022-10-28 11:40:43 -04:00
arkon ca06516900 Avoid some crashes 2022-10-26 18:12:11 -04:00
AntsyLich 3b5b9a1ae5 Use Channel in Download cache (#8292)
* Use `Channel` in Download cache

Co-Authored-By: Andreas <6576096+ghostbear@users.noreply.github.com>

* Use Unlimited capacity

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

Co-authored-by: Andreas <6576096+ghostbear@users.noreply.github.com>
Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
2022-10-26 09:21:35 -04:00
arkon 5c868d7846 Use kotlin.time extensions in some more places 2022-10-22 19:57:55 -04:00
arkon 152eb5b951 Handle async cache in updates and manga screens
- Also fix concurrent accesses to main cache map
- Also debounce sources and updates list updates to maybe avoid crashing due to dupe LazyColumn keys
2022-10-22 10:50:44 -04:00
arkon 7e40680af0 Perform download cache renewal async
Don't block on cache renewals, but notify library on updates so that the badges show up when ready.

We skip the cache when checking if a chapter is downloaded for the reader assuming that it's a
relatively low cost to check for a single chapter.

(Probably) fixes #8254 / fixes #7847
2022-10-21 15:00:41 -04:00
arkon b04807e53a Proper DI instantiation for some more download related classes 2022-10-21 14:29:44 -04:00
arkon 93827aba34 Defer library download counts if not needed 2022-10-20 23:20:32 -04:00
arkon a8ca7b690f Avoid crashing if invalid download and backup location is set
Fixes #8252
2022-10-20 22:34:27 -04:00
arkon 6756bfab75 Fix download cache not updating on location change 2022-10-18 17:35:38 -04:00
arkon 558aad1a71 Always renew download cache if no sources have been loaded yet
Fixes #7705. Somewhat janky solution to handle when loading the sources on app start is slower than
the initial download cache priming.
2022-10-16 16:30:51 -04:00
arkon bc1fbfac9d Minor cleanup 2022-10-14 16:13:50 -04:00
arkon 26a42ba9c0 Upgrade to Kotlin 1.7.20
Also run formatter and address some deprecation warnings.
2022-10-11 22:40:08 -04:00
stevenyomi b1e104319f Fix download progress indicator (#8188) 2022-10-11 22:17:45 -04:00
arkon b95a30e424 Fix linting error 2022-10-09 10:54:54 -04:00
arkon 3bfbd58402 Clean up download state logic in MorePresenter 2022-10-09 10:37:44 -04:00
AntsyLich 98c459a6b6 Downloader: Don't trust index provided by source (#8122) 2022-10-01 11:01:05 -04:00
Ivan Iskandar f98b4f4e39 DownloadController: Fix first active download status not updating (#8069) 2022-09-24 11:59:11 -04:00
arkon b37b3767f3 Minor cleanup
Also add POST_NOTIFICATIONS permissions to make Android Studio stop complaining about it.
2022-09-21 22:39:32 -04:00
Andreas e82963c9ef Split download preferences from PreferencesHelper (#8048) 2022-09-21 17:45:07 -04:00
Andreas b668364afb Split security preferences from PrefrencesHelper (#8030) 2022-09-18 13:07:48 -04:00
Andreas 0086743a53 Use 1.x preference abstraction (#8020)
* Use 1.x preference abstraction

- Uses SharedPreferences compared to 1.x impl which uses DataStore but it breaks all settings screens currently
- Move PreferencesHelper to new PreferenceStore
  - PreferencesHelper should be split into smaller preference stores and be in core or domain
- Remove flow preferences as new PreferenceStore handles changes for us

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>

* Fix PreferenceMutableState not updating

* Fix changes not emitting on first subscription

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>
2022-09-17 11:48:24 -04:00
arkon f9bbbce466 Check the actual folder when deleting source folder in case of stale cache 2022-09-11 17:58:59 -04:00
Ivan Iskandar fb9791f597 DownloadController: Partial Compose conversion (#7969)
Item list is not changed as currently there is no fitting Compose component to
replace the drag-drop behavior.
2022-09-09 22:29:40 -04:00
arkon 38950f7bc8 Address some OkHttp nullability changes 2022-09-03 10:38:56 -04:00
AntsyLich 5a320d87e8 Remove download source folder when empty (#7928) 2022-09-03 09:18:19 -04:00
AntsyLich a43754e1a6 Fix tmp cbzs are counted towards manga download count (#7909)
* Fix tmp cbzs are counted towards manga download count

* Review Changes

* Review Changes 2
2022-09-02 10:03:37 -04:00
arkon c39a1b7867 Minor cleanup 2022-08-31 14:43:58 -04:00
AntsyLich 53f5ea7fe9 Rename source download folder on source rename (#7898)
* Rename source download folder on source rename

* Review Changes

* Review Changes 2
2022-08-30 13:15:34 -04:00
stevenyomi 4b9a6541d1 Fix chapter download with empty scanlator (#7844) 2022-08-24 17:19:01 -04:00
nzoba a70b848646 Fix stucked downloads when service not started (#7846)
* Fix stucked downloads when service not started

* Fix chapter download restart even if should be deleted
2022-08-24 17:18:22 -04:00
nzoba f207e87722 Download ahead (#7226) 2022-08-22 17:37:54 -04:00
stevenyomi 40749dc767 DownloadProvider: Remove duplicate in valid chapter dir name list (#7826) 2022-08-20 13:19:15 -04:00
stevenyomi 1f9f9662bc Fix download chapter dir when scanlator is empty or changed (#7780) 2022-08-16 17:26:08 -04:00
arkon d6f1534ee8 Address misc. build warnings 2022-08-10 23:26:34 -04:00
Andreas 56028aff55 Fix category exclude not working in DownloadManager (#7641) 2022-07-29 07:46:09 -04:00
stevenyomi 3547d0142f Fix image MIME issues that cause download errors (#7562)
* Downloader: ignore non-image MIME to prevent .bin extensions

* ProgressResponseBody: allow null content type

Co-authored-by: anenasa <84259093+anenasa@users.noreply.github.com>

Co-authored-by: anenasa <84259093+anenasa@users.noreply.github.com>
2022-07-20 09:10:41 -04:00
f1998f1998 b635f02d93 fix concurrent download (#7552)
* Fix concurrent download

* lower Concurrency

* artist Update app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>

Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
2022-07-18 13:22:09 -04:00
arkon 788583e66f Replace some usages of RxJava 2022-07-10 19:48:07 -04:00
arkon 591df8abcc Add MIME type mapping for image/jxl (fixes #7117) 2022-07-03 22:33:15 -04:00
arkon a3378e6080 More domain model usage 2022-07-03 16:51:11 -04:00
Andreas 17951cfd68 Use SQLDelight for all Manga related queries (#7447) 2022-07-03 10:17:41 -04:00
Andreas 29633b64aa Use SQLDelight for all Chapter related queries (#7440) 2022-07-02 18:51:33 -04:00
Andreas 2674570792 Use SQLDelight for a Category related queries (#7438) 2022-07-02 16:12:06 -04:00
arkon 2dfbfd0958 Remove more unused StorIO code 2022-07-02 13:08:08 -04:00
AntsyLich ff32ab09fb Downloader: Optimize split tall image (#7435) 2022-07-02 12:49:50 -04:00
AntsyLich deaded5af2 Reimplement chapter download indicator longpress (#7412) 2022-07-02 12:43:18 -04:00
AntsyLich e1525a5125 DownloadProvider: Only provide necessary info and not whole chapter/manga class (#7411) 2022-06-30 09:20:55 -04:00