Commit Graph

282 Commits

Author SHA1 Message Date
arkon 5fbecfd7b7 Don't remove queued downloads when deleting manga after chapter deletion 2022-11-27 17:12:45 -05:00
arkon 3480b45098 Minor cleanup 2022-11-27 17:12:45 -05:00
AntsyLich 3d7591feca Implement simple stats screen (#8068)
* Implement simple stats screen

* Review Changes

* Some other changes

* Remove unused

* Small changes

* Review Changes 2 + Cleanup

* Review Changes 3

* Cleanup leftovers

* Optimize imports
2022-11-26 15:50:26 -05:00
arkon 37118088d4 Remove usage of PublishRelay in DownloadQueue 2022-11-26 10:07:51 -05:00
AntsyLich 758d223776 Disable generating ComicInfo.xml on download (#8619)
* Disable generating ComicInfo.xml on download

* Remove unused import
2022-11-26 09:13:08 -05:00
AntsyLich 0347d3970a Cleanup [Downloader.ensureSuccessfulDownload] (#8602) 2022-11-23 09:23:29 -05:00
arkon 5c37347cec Delete empty source folder when deleting all downloads for a manga
It previously only attempted this after deleting a list of chapters, so it wasn't applicable
when deleting from Library or after unfavoriting an entry.

Closes #8594
2022-11-22 09:25:00 -05:00
arkon 2d86f69caa Add reindex downloads description
Closes #8546
Also disable sound for the notification and cancel running indexing job if invalidating.
2022-11-20 14:29:56 -05:00
AntsyLich ba2a528886 Fix related to cancelling queued chapters (#8528)
Tachi removes the downloaded chapter (if it exists) when you just cancelled a download from queue.

PR fixes that

Also removes redundant return
2022-11-18 22:27:39 -05:00
arkon f5873d70c6 Don't rely on cache when deleting empty manga folders
In case the cache hasn't actually been indexed yet. Maybe fixes #8438.
2022-11-14 22:42:36 -05:00
arkon 9da232dcd8 Adjust download cache to ignore irrelevant files
Fixes #8530
2022-11-13 11:52:11 -05:00
AntsyLich 51c964de3a Fix download not working on sd card (#8527)
Also create comicinfo file inside chapter folder instead of manga folder since it also contains some chapter specific data
2022-11-13 10:40:33 -05:00
arkon 262f8449b4 Resolve proper chapter URL for ComicInfo "Web" field
Requires extensions to be updated to lib 1.4 to have proper URLs for some of them, which will
happen soon in the future.
2022-11-12 09:54:32 -05:00
arkon 6ada3c90ff Clean up ComicInfo stuff a bit 2022-11-11 16:34:18 -05:00
Shamicen 4e628fe6de Create ComicInfo Metadata files on chapter download (#8033)
* generate ComicInfo files at the chapter root and inside CBZ archives on chapter download.

* Update app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

Co-authored-by: Andreas <andreas.everos@gmail.com>

* Improvements suggested by @ghostbear

* now creates ComicInfo files in normal chapter folders as well
use manga directly instead of converting it to SManga
truncate old files before overwriting them

Co-authored-by: Andreas <6576096+ghostbear@users.noreply.github.com>

* remove empty line after resolving merge conflict

* fixes Serializer for class 'ComicInfo' is not found error

* some changes to comments and variable names

* Revert leftover changes to archiveChapter() function

* minor cleanup

* Changed Chapter to SChapter

Co-authored-by: Andreas <andreas.everos@gmail.com>
Co-authored-by: Andreas <6576096+ghostbear@users.noreply.github.com>
2022-11-11 16:16:37 -05:00
arkon a0f49b16c5 Remove "Download complete" notification
It wasn't really consistent with other notifications considering there's no
action to be taken in this state.
2022-11-10 23:08:19 -05:00
arkon c6c4c1c393 Migrate to more domain model usages 2022-11-10 22:42:44 -05:00
arkon 811931ccc0 Minor cleanup 2022-11-10 22:23:34 -05:00
AntsyLich 08d5633d81 Add option to invalidate download cache (#8491)
* Add option to invalidate download cache

* Review changes + lint
2022-11-10 22:15:35 -05:00
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