Compare commits

...

872 Commits

Author SHA1 Message Date
Jobobby04 51a109285a Release 1.7.0 2021-06-01 20:48:37 -04:00
Jobobby04 02601aa32a Temporarily disable Double Page Spread 2021-06-01 18:40:42 -04:00
Jobobby04 60e520e37e Temporarily disable Mangadex delegation 2021-06-01 18:33:48 -04:00
arkon 3fb4b565fa Temporarily hide Komga tracker
(cherry picked from commit 31997fe50a)
2021-06-01 18:22:12 -04:00
arkon b2e33ab950 Update some icons
(cherry picked from commit 5e5ceef122)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
2021-06-01 18:22:00 -04:00
Jozef Hollý acad70d8db Weblate translations (#5141)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Dhimas Admaja <dhimasadmaja@gmail.com>
Co-authored-by: Elosy <gaudic99@gmail.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: HeavenShadow <heavenshadow@outlook.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jetspectre <jetspectre1@gmail.com>
Co-authored-by: Jozef Hollý <j2.00ghz@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Riztard Lanthorn <riyanluqman@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Wojciech Kosztyła <wojtex1221@gmail.com>
Co-authored-by: matdeluis <luisdebonoir@protonmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: whenwesober <naomi16i_1298q@cikuh.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/jv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Dhimas Admaja <dhimasadmaja@gmail.com>
Co-authored-by: Elosy <gaudic99@gmail.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: HeavenShadow <heavenshadow@outlook.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jetspectre <jetspectre1@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Riztard Lanthorn <riyanluqman@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Wojciech Kosztyła <wojtex1221@gmail.com>
Co-authored-by: matdeluis <luisdebonoir@protonmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: whenwesober <naomi16i_1298q@cikuh.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit 40edbac7f0)
2021-06-01 18:17:40 -04:00
Jobobby04 ebc1f2bb41 Update string reference 2021-06-01 18:17:06 -04:00
arkon 391e477e04 Remove more unused strings
(cherry picked from commit 8622e6492c)
2021-05-31 23:48:06 -04:00
arkon 5fa3d55bc9 Show toast when toggling crop borders
Consistent with reading mode and orientation shortcuts.

(cherry picked from commit 1feac9c559)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-05-31 23:47:48 -04:00
Jobobby04 ef02bd112c Fix some string references 2021-05-31 23:44:15 -04:00
arkon ae7d94a1f2 Remove unused strings
(cherry picked from commit fce81dd6d9)
2021-05-31 23:44:15 -04:00
arkon 0a96252ce8 Fix last library category not being saved
(cherry picked from commit aa50554f06)
2021-05-31 23:44:15 -04:00
Jobobby04 7907723623 Move rec button higher on tablet view 2021-05-31 23:44:14 -04:00
Eugene 8d3c0199b4 Rus locale fix/additions (#330)
* Rus locale fix/additions

* Delete Gallery types (because filters are still in English)

* New strings

* New 2

* fix1
2021-05-31 23:26:24 -04:00
arkon d5fcded898 Fix toolbar menu being broken on transition (fixes #5135)
(cherry picked from commit 034506f56b)
2021-05-29 18:19:40 -04:00
arkon 674a9c5067 Fix double free when when parsing webp images (fixes #5227)
Co-authored-by: inorichi <inorichi@users.noreply.github.com>
(cherry picked from commit 2d8858edb4)
2021-05-29 18:19:32 -04:00
arkon 1f37d571cf [SKIP CI] Add issue moderator action
(cherry picked from commit b2601ad696)
2021-05-29 18:19:24 -04:00
arkon 36c45c9450 Run formatter on some resources
(cherry picked from commit 8099f561c5)
2021-05-29 18:19:16 -04:00
arkon cc2f976c81 Update AboutLibraries
(cherry picked from commit 8a014ddb0c)
2021-05-29 18:19:05 -04:00
arkon d92e790c5e Try to avoid some Webview-related crashes
Related to #5218

(cherry picked from commit 3d9383ce67)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
2021-05-29 18:18:56 -04:00
Ivan Iskandar 7d659f559e Adjust chapter download button visual (#5213)
* Removed the blinking icon and added back the indeterminate indicator for
queued items
* Make the downloading indicator a solid circle

(cherry picked from commit 9de07c11a6)
2021-05-29 18:18:10 -04:00
Jobobby04 3a20e24ad0 Fix some drawable references 2021-05-29 18:17:54 -04:00
Ivan Iskandar 9a97a97aa7 More bottom sheet improvements (#5183)
* Edge-to-edge bottom sheet when possible

* ReaderSettingsSheet: Animate background dim changes

* Adjust modal bottom sheet in-out animation

* Use public method to get bottom sheet behavior

* Set bottom sheet peek size to 50% screen height

The current auto peek height gives too low value on landscape orientation

* Set bottom sheet navigation bar scrim when needed

(cherry picked from commit 9f744bc445)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
2021-05-29 17:58:17 -04:00
Soitora 84076c2582 Add animations for Bottom Navigation items (#5181)
* Animated icon for the Library tab

Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>

* Animated icon for the More tab

Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>

* Rename more_vert to overflow

Should maybe help any confusion together with the other more_horiz changes.

* Animated icon for the History tab

Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>

* Clarify names and clean files

* Animated icon for the Updates tab

* Animated icon for the Browse tab

* Recreate the animated icon for the History tab

History icons look better when the internal clock is not moving.

Co-authored-by: CrepeTF <70870719+CrepeTF@users.noreply.github.com>
(cherry picked from commit aed6e12119)
2021-05-29 17:57:44 -04:00
Jobobby04 b67d2bba40 Last chapter can be null 2021-05-28 21:17:26 -04:00
Jobobby04 9fa278f708 Fix SY themes a bit more 2021-05-28 14:36:53 -04:00
Jobobby04 56ea025e20 Update coroutines, fix E-Hentai gallery update restrictions 2021-05-28 14:36:52 -04:00
arkon dab002cf4d Update GMS plugin
(cherry picked from commit c57d0046bc)
2021-05-28 14:36:52 -04:00
arkon bca6f39a33 Update Kotlin and kotlinter
If this breaks anything, I blame Jay.

(cherry picked from commit 07b9fc9b31)
2021-05-28 14:36:52 -04:00
arkon fbfad27c27 Dependency updates
(cherry picked from commit 2c6bcb85a0)
2021-05-28 14:36:51 -04:00
Soitora a93129c4f2 Allow themes to style more objects (#5197)
* Add Tertiary color and use it for Badges

* Define ripple color for Material Dialog

Although it doesn't do anything, but it should

* Add tertiary colors for Green Apple theme

* Use the correct theme accent in AlertDialog

* Declare a global colorControlHighlight

Fixes some of the ripples listed on #5154.

* Change md_ripple_color to primary ripple color

(cherry picked from commit 11a232a2df)
2021-05-28 14:36:51 -04:00
Hunter Nickel 89531cd549 Implement feature to hide "Local" badge from library manga (#5202)
(cherry picked from commit 8dcd919ff0)
2021-05-28 14:36:51 -04:00
Gauthier e50f04ec54 Display the currently active restrictions in the library update preference (#5187)
* display the currently active restrictions in the library update preference

* removed first line

* use constant instead of literal string

* remove spanned string builder

(cherry picked from commit d9c27e7109)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsLibraryController.kt
2021-05-28 14:36:50 -04:00
arkon d8b40c2dc4 Add link to official subreddit
(cherry picked from commit 8af8c57bb4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutLinksPreference.kt
2021-05-28 14:36:50 -04:00
arkon d62de90b77 Update dependencies
(cherry picked from commit a1a4916abf)
2021-05-28 14:36:49 -04:00
Soitora ab14ce0d75 Set grey setting sheet for Grey background option (#5193)
(cherry picked from commit 9be8f675ac)
2021-05-28 14:36:49 -04:00
inorichi f2efe49ea1 Fix GIF detection on previous commit
(cherry picked from commit a271c3726e)
2021-05-28 14:36:49 -04:00
inorichi 2eb5436b25 Display animated webp whenever possible, otherwise fallback to static image. Fixes #5139
(cherry picked from commit 8c18a14dfd)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt
2021-05-28 14:36:48 -04:00
Gauthier fba4bd163b Hide the score display on the tracksheet if not supported (#5169)
* hide the score display on the tracksheet if not supported

* Convert track item to use LinearLayout

Co-authored-by: Andreas E <andreas.everos@gmail.com>
(cherry picked from commit 9a801cfdfb)
2021-05-28 14:36:48 -04:00
Soitora ae073f9207 Added "Green Apple" theme (#5184)
* Added "Green Apple" theme

Totally not stolen from other forks.

Although to cover all my bases I co-author all people who adapted the theme in any form.

Neko, J2K and Tako

Co-Authored-By: Carlos <2092019+CarlosEsco@users.noreply.github.com>
Co-Authored-By: Jays2Kings <jays@outlook.com>
Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>

* Add black as the OnSecondary color

Co-authored-by: Carlos <2092019+CarlosEsco@users.noreply.github.com>
Co-authored-by: Jays2Kings <jays@outlook.com>
Co-authored-by: CrepeTF <70870719+CrepeTF@users.noreply.github.com>
(cherry picked from commit 4af13e3536)
2021-05-28 14:36:47 -04:00
Gauthier 1c084d42df Background tracker update during Library update (#5166)
* add preference to auto update trackers during library update

* also update trackers when updating chapters and preference is set

* remove unnecessary launch/join

* perform tracking update within the same chapter update loop to avoid double notifications

(cherry picked from commit e76e903060)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-05-28 14:36:47 -04:00
Jobobby04 f245bbcfeb Move Kapt 2021-05-28 14:36:47 -04:00
arkon 29310c86e2 Use 1.x source-api artifact from Maven Central
(cherry picked from commit d8251224cb)
2021-05-28 14:36:46 -04:00
Gauthier f492ad2529 Refactor TrackService.kt to remove unused add function (#5164)
* removed the add function from TrackService.kt as it's not used except within the tracker implementations

* add private modifier

(cherry picked from commit acd927a937)
2021-05-28 14:36:46 -04:00
Jobobby04 33b6912c22 nullIfEmpty 2021-05-28 14:36:45 -04:00
Jobobby04 9e63f32a82 Localize Find in another source 2021-05-28 14:36:45 -04:00
arkon 834e3d78ab Put shortcut to backup menu in More
(cherry picked from commit a498f940c6)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt
2021-05-28 14:36:45 -04:00
arkon 2d2378a1e2 Use Title Case for theme names
(cherry picked from commit 948cb31d1a)
2021-05-28 14:36:44 -04:00
arkon 3cc61bc3b8 Make some strings in LocalSource translatable (closes #5178)
(cherry picked from commit 179cb8eb50)
2021-05-28 14:36:44 -04:00
arkon 6b771b4a70 Handle toolbar title in manga details on tablets similar to on phones
(cherry picked from commit 47f865aa72)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-05-28 14:36:43 -04:00
arkon 9c2eadd8ca Remove unused Gson singleton factory
We don't inject it anywhere anymore.

(cherry picked from commit b47face2f8)
2021-05-28 14:36:43 -04:00
Ivan Iskandar f09c977661 TabbedBottomSheetDialog: Fix scrollable pages (#5173)
(cherry picked from commit 69869115f6)
2021-05-28 14:36:43 -04:00
Soitora 2acc364960 Added "Strawberry Daiquiri" theme (#5176)
(cherry picked from commit 0fb9ca3e8b)
2021-05-28 14:36:42 -04:00
arkon c63300d9ad Tweak tablet manga info column width
(cherry picked from commit eaf9c9b2d8)
2021-05-28 14:36:42 -04:00
arkon c90aec5c3d Organize some classes
(cherry picked from commit 70d9b0c390)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-05-28 14:36:41 -04:00
Gauthier 8e6f04f258 pull the rate limit interceptors from the extensions repo (#5163)
apply a rate limit to anilist, current limit is 90 per minute

(cherry picked from commit e57a999c9c)
2021-05-28 14:36:41 -04:00
arkon 354c61cf59 Update AGP and AboutLibraries
(cherry picked from commit 3b49289cfb)
2021-05-28 14:36:41 -04:00
Soitora 606101dc8b Add "Midnight Dusk" and "Hot Pink" themes (#5161)
* Organize and clarify themes file

Increases clarification with better commenting, should make it easier to add or modify current themes.

* Make AMOLED its own theme category

* Tweak ripples for AMOLED

* Add "Midnight Dusk" theme

Ports it from jobobby04/TachiyomiSY.

Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>

* Add "Hot Pink" theme

Ports it from jobobby04/TachiyomiSY.

Co-Authored-By: OncePunchedMan <64155117+OncePunchedMan@users.noreply.github.com>

* Make AMOLED a base theme

* Final tweaks

Rename "Toolbar.Light" to "Custom.PopupTheme"
Changes placing of backgroundDusk

Removes HotPink and MidnightDusk custom Toolbars, I believe they are unnecessary.

* Rename a Midnight Dusk color

* Make AMOLED independent from Dark as a theme

Co-authored-by: CrepeTF <70870719+CrepeTF@users.noreply.github.com>
Co-authored-by: OncePunchedMan <64155117+OncePunchedMan@users.noreply.github.com>
(cherry picked from commit 176e984b56)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseThemedActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt
#	app/src/main/res/values/styles.xml
#	app/src/main/res/values/themes.xml
2021-05-28 14:36:40 -04:00
Ivan Iskandar 97eda86ac4 Remove top margin of PreferenceCategory if no title set (#5168)
(cherry picked from commit b5a700276a)
2021-05-28 14:36:40 -04:00
Ivan Iskandar dd4384767c Fix incognito mode disabled after the app kicked out of memory (#5167)
The application class onCreate will also be called when user navigates to an
activity after the app process is killed by the system.

So make sure the incognito is disabled only when the entry point of the app is
created from scratch (e.g. after being force closed by the user).

(cherry picked from commit 3c186a3c8d)
2021-05-28 14:36:39 -04:00
Jobobby04 b18075de14 Cleanup 2021-05-28 14:36:39 -04:00
Jobobby04 c39ec81f42 Metadata cleanup 2021-05-28 14:36:38 -04:00
Eugene 99d23a47b7 18+ tag to Lewd Check (#336) 2021-05-25 14:54:54 -04:00
Jobobby04 481f600056 Double page spread share/save options 2021-05-23 18:23:45 -04:00
Jobobby04 143d0d2518 Fix reader settings crash 2021-05-23 18:23:44 -04:00
Soitora 38fef11287 Fix SY themes after custom ripple changes (#332)
* Fix SY Themes and Ripples

* Slightly increase ripple brightness in AMOLED

* Override AMOLED highlight for the failure that is Hot Pink
2021-05-23 18:23:22 -04:00
arkon 9adbb1b115 Option to move nav rail buttons to bottom of screen (closes #5158)
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/90be3e34948d41daf3fd695ef09d60eb6adf960e

Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
(cherry picked from commit a462ce3626)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
#	app/src/main/res/values/strings.xml
2021-05-23 15:40:27 -04:00
arkon ec9967d2d6 Fix reader chapter sort ordering (fixes #5157)
(cherry picked from commit 065cf42aea)
2021-05-23 15:36:20 -04:00
arkon ba0e353ea1 Revert "Prevent view from being removed if a to is found (#5135) (#5152)"
This reverts commit 974275a429.

(cherry picked from commit 986b709f2c)
2021-05-23 15:36:10 -04:00
Soitora e5131e1985 Create a toolbar variable for ripples (#5159)
* Rename rippleNavColor to rippleSecondaryColor

It's not just for the navigation anymore

* Add a rippleToolbarColor for toolbar ripples

Fixes so you can use specialized colors in case of using a theme such as Dark Blue or Light Blue

* Add so text buttons are also themed secondary color

Apparently this is also a common Google app thing

* Changes variable name for Navigation Rail

(cherry picked from commit fed6f44995)

# Conflicts:
#	app/src/main/res/values/styles.xml
#	app/src/main/res/values/themes.xml
2021-05-23 15:35:59 -04:00
arkon 43555b3b1a Hide irrelevant settings on tablets
(cherry picked from commit 1b52acdad7)
2021-05-23 15:34:50 -04:00
arkon 3419bebb70 Update Discord logo asset (closes #5143)
(cherry picked from commit 10a638c6b8)
2021-05-23 15:34:42 -04:00
Jobobby04 b13ca1a097 Lint and build fixes 2021-05-23 15:34:29 -04:00
arkon dd914047f8 Tablet manga view
(cherry picked from commit 7875f363a8)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
2021-05-23 15:34:13 -04:00
arkon 666447faac Fix resume button not considering filters
(cherry picked from commit 685736b9ec)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-05-23 14:56:33 -04:00
arkon e9a21a6bbe Use same chapter sorting logic in manga and reader views
(cherry picked from commit aefd2bf6f8)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-05-23 14:54:40 -04:00
arkon de4e0abef4 Update reader chapter list filtering to handle not downloaded/bookmarked (closes #5107)
(cherry picked from commit ce9fb2f1fe)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
2021-05-23 14:51:35 -04:00
Antoine Gaudreau Simard ac7e2909ba Prevent view from being removed if a to is found (#5135) (#5152)
Introduced in c68e7c8da7

(cherry picked from commit 974275a429)
2021-05-23 14:49:55 -04:00
arkon 14de1973a3 Fix some RecyclerView heights (fixes #5146)
(cherry picked from commit 98461f9bca)
2021-05-23 14:49:46 -04:00
Jobobby04 3053bf9d5d Double page spread
(cherry picked from commit 7832d1abe1fdcdb962f388e5a86dd3fcecad6712)
2021-05-23 14:49:09 -04:00
Jobobby04 3192140421 Disable mangadex covers and use temp covers 2021-05-23 14:48:14 -04:00
Jobobby04 80cf38a70d Fix mangadex covers 2021-05-23 14:43:12 -04:00
arkon 42bbf07859 Update ripples for tablet NavigationRail (fixes #5145)
(cherry picked from commit 094f78fb41)
2021-05-22 18:28:39 -04:00
Soitora 9b4aac7ce5 Ripples patch (#5144)
* Combine ripple_dark and ripple_light

Fixes AMOLED theme and doesn't require two seperate items.

* Fix ripple for the new About icons

* Fixes nav/tab ripple in Dark Blue and Light Blue themes

* Theme some ripples using their Style instead

(cherry picked from commit 33dcdc1599)

# Conflicts:
#	app/src/main/res/values/themes.xml
2021-05-22 18:28:04 -04:00
arkon ab64e51c6b Fix action toolbar positioning (fixes #5099)
(cherry picked from commit 8870ccb18c)
2021-05-22 18:22:36 -04:00
arkon 82a92b9497 Fallback to default viewer properly (closes #5068)
(cherry picked from commit 2a7ed1375a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
2021-05-22 18:22:21 -04:00
arkon a855c4a929 Fix vector from being rasterized during build
(cherry picked from commit 54b50cca71)
2021-05-22 18:08:28 -04:00
arkon de6c428d72 Enforce same height for about links
Discord is kind of scuffed because the icon isn't vertically centered properly.

(cherry picked from commit 1c10ba7925)
2021-05-22 18:08:20 -04:00
Soitora a34133f526 Change tab ripple color (#5142)
Does what Google apps does, uses the colored ripple for Tabs as well and not just bottom nav.

(cherry picked from commit 2b8df691ff)
2021-05-22 18:08:13 -04:00
arkon 56d127003f Shrink Komga logo asset
(cherry picked from commit 15da856303)
2021-05-22 18:07:55 -04:00
Jozef Hollý 323ce4dbab Weblate translations (#4973)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Allen Chang <allen.ty.chang@gmail.com>
Co-authored-by: Andreas <howangandreas@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Bùi Nguyễn Hoàng Thọ <buinguyenhoangtho97@gmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Christian Elbrianno <christian.elbrianno41@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Hajba Károly <karoly.hajba98@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jacque Fresco <aidter@use.startmail.com>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Jendrej <ejjendrej@gmail.com>
Co-authored-by: K. Sz. Bence <tudi20@protonmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: LigthA_ <ligthaa@gmail.com>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Maxime Dias <maxime-dias_student2021@wilder.school>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Narin <narin.tana@hotmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Pratik Subedi <pratikk.subedee@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: SmolderingGummy <bairamsaieesh@gmail.com>
Co-authored-by: Techeira Damián <damian.techeira@mercadolibre.com>
Co-authored-by: Zero O <godarms2010@live.com>
Co-authored-by: dmswd <Bmswad1@gmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: plr20 <hobdob@tuta.io>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: waitingmoon <takeda.s1027@gmail.com>
Co-authored-by: Николаев Павел Дмитриевич <pavliknikolaev128@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/eo/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es_419/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hu/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ne/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sah/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/te/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/th/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/vi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Allen Chang <allen.ty.chang@gmail.com>
Co-authored-by: Andreas <howangandreas@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Bùi Nguyễn Hoàng Thọ <buinguyenhoangtho97@gmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Christian Elbrianno <christian.elbrianno41@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Hajba Károly <karoly.hajba98@gmail.com>
Co-authored-by: Jacque Fresco <aidter@use.startmail.com>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Jendrej <ejjendrej@gmail.com>
Co-authored-by: K. Sz. Bence <tudi20@protonmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: LigthA_ <ligthaa@gmail.com>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Maxime Dias <maxime-dias_student2021@wilder.school>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Narin <narin.tana@hotmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Pratik Subedi <pratikk.subedee@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: SmolderingGummy <bairamsaieesh@gmail.com>
Co-authored-by: Techeira Damián <damian.techeira@mercadolibre.com>
Co-authored-by: Zero O <godarms2010@live.com>
Co-authored-by: dmswd <Bmswad1@gmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: plr20 <hobdob@tuta.io>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: waitingmoon <takeda.s1027@gmail.com>
Co-authored-by: Николаев Павел Дмитриевич <pavliknikolaev128@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit a62628423f)
2021-05-22 18:07:43 -04:00
Ivan Iskandar a802eb1cca Bump compileSdk to 30 (#5140)
(cherry picked from commit ef8a87a30f)
2021-05-22 18:07:27 -04:00
arkon 3bb005acb2 Disable swiping on switch in SwitchSettingsPreference
(cherry picked from commit 147978b932)
2021-05-22 17:56:44 -04:00
arkon d8ee654a65 Rename some biometrics things since it's no longer specifically for biometric auth
(cherry picked from commit c741920ec0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt
2021-05-22 17:56:36 -04:00
CrepeTF 2b075b5a39 Fixed tracker sheet corner radius not being rounded on start (#4799)
(cherry picked from commit bbbcb18b91)
2021-05-22 17:49:55 -04:00
Gauthier e085855ec6 Add Komga as an unattended track service (#5049)
* fix: prevent crash if TrackService.getScoreList() is empty

* disabled track score button if service doesn't support scoring

* first implementation of the Komga tracking
this doesn't work for read lists

* auto track when adding to library

* handle refresh

* 2-way sync of chapters for unattended tracking services

* Update app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSheet.kt

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

* group strings together

* support for read lists

* sync read chapters on bind

* only mark local chapters as read during 2-way sync (incoming)

* local progress from read chapters will be sent to remote tracker on bind/refresh
this enables syncing after reading offline

* remove unused variable

* refactor the 2-way sync in a util function

* handle auto add to track for unattended services from the browse source screen when long clicking
this will also sync chapters, as it is possible to have read or marked as read chapters from there

* 2-way sync when library update for TRACKING

* refactor

* better handling of what has been read server side

* refactor: extract function

* fix: localLastRead could be -1 when all chapters are read

* refactor to rethrow exception so it can be shown in toast

* extract strings

* replace komga logo

Co-authored-by: Andreas <andreas.everos@gmail.com>
(cherry picked from commit d6b3b0baf7)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
2021-05-22 17:49:45 -04:00
arkon 1518c2aa25 Run formatter on drawables and layouts
(cherry picked from commit dbe8931cf0)

# Conflicts:
#	app/src/main/res/drawable/ic_launcher_foreground.xml
#	app/src/main/res/layout/main_activity.xml
#	app/src/main/res/layout/manga_info_header.xml
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/layout/reader_general_settings.xml
2021-05-22 17:47:08 -04:00
arkon 623b64aa79 Fix top padding in up Updates/History
(cherry picked from commit d2eb5d7f45)
2021-05-22 17:41:05 -04:00
Soitora 2f9069765e Ripple overhaul (#5109)
* Create drawables for the ripples

Temporary colors in them to aid in unifying the ripples.

The 'ripple_circular' and 'ripple_normal' are probably going to be merge as one in the end.

* Change selectableItems to drawables

Changes 'selectableItemBackgroundBorderless' to 'ripple_circular' drawable.

Changes 'selectableItemBackground' to 'selectable_item_background' drawable.

* Add temporary colors to aid in finding unstyled ripples

* Fix button sizes to not make oval ripples

* Make the chip selectable follow ripple color

* Style using the built in rippleColor when possible

* Ripple away 💸

* Set ripple color for tabs

Main activity tabs as well as sheet tabs

* Set ripple color in seekbar buttons

* Fix ripple color for the toolbar

* Round off and start to finish the ripples

* Set custom colorful ripple for bottom navigation

Makes the app a little more fun than just black and white. Took inspiration from a ton of updated Google apps.

* Revert two layout changes

These were not necessary for the ripple as it is designed now, but it was before.

Co-authored-by: Andreas E <andreas.everos@gmail.com>
(cherry picked from commit 562dce60ee)

# Conflicts:
#	app/src/main/res/layout/main_activity.xml
#	app/src/main/res/layout/manga_info_header.xml
#	app/src/main/res/values/styles.xml
2021-05-22 17:40:53 -04:00
arkon eaa2bb22ed Remove 1 or 2 hour library updates to avoid DDoSing sources
(cherry picked from commit 569df39fb8)

# Conflicts:
#	app/build.gradle.kts
2021-05-22 17:33:29 -04:00
arkon 1389649553 Try to avoid crashing when source fails to return pages
(cherry picked from commit 2f7f00c7a2)
2021-05-22 17:29:26 -04:00
Ivan Iskandar b3ddc1dfa3 Remove material-design-dimens (#5133)
(cherry picked from commit afd59eabbb)
2021-05-22 17:29:16 -04:00
arkon d55802a2f2 Adjust tablet layout (closes #5113)
(cherry picked from commit cf99446a12)
2021-05-22 17:17:54 -04:00
Jobobby04 08cb46f6cd Make github link point to the SY github 2021-05-22 17:17:41 -04:00
arkon 15482914ef Tweak About view, make links actually clickable
(cherry picked from commit 68286b2acc)
2021-05-22 17:13:58 -04:00
arkon 3e5e983b9e Collapse about links into a single row
(cherry picked from commit a410184e0a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt
2021-05-22 17:13:53 -04:00
Soitora 36484bc349 Add icons for links in the About section (#5117)
* Add an icon for each link in About

* Add icon for Open source licenses

* Reorder Facebook and Discord

* Revert "Add icon for Open source licenses"

This reverts commit 9b73f8443d1afea60f8bc4165663c8bef0ebf108.

(cherry picked from commit d3ceecf620)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2021-05-22 17:09:54 -04:00
arkon 85362e2030 Refactor BaseBottomSheetDialog to set maxWidth with newer API
(cherry picked from commit 940c5b3838)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
2021-05-22 17:03:50 -04:00
arkon 3ebdd7b351 [SKIP CI] Update issue-closer-action
(cherry picked from commit 17c321286d)
2021-05-22 16:53:53 -04:00
Soitora 2a32c9cb5d Increase padding to progress bar (#5110)
(cherry picked from commit 0dbb79359b)
2021-05-22 16:53:42 -04:00
Hunter Nickel 677f93a6ec Change ordering of labels in "when" clause (#5103)
(cherry picked from commit 19f39fcdb0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt
2021-05-22 16:53:35 -04:00
arkon 584f7b516f Restore original preference background after highlight animation (fixes #5094)
(cherry picked from commit ab021c1302)
2021-05-22 16:52:20 -04:00
Riztard Lanthorn 7d49479783 library update notif text progress (#5098)
(cherry picked from commit cf4b870846)
2021-05-22 16:52:09 -04:00
arkon 970e6e2560 Remove legacy backup creation
(cherry picked from commit 5e37f72d74)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupManager.kt
2021-05-22 16:51:59 -04:00
inorichi 19d539b197 Fix decoder crash with 1px images and crop borders
(cherry picked from commit 6843dbf7e1)
2021-05-22 16:48:54 -04:00
arkon 97e47b98b1 Avoid invalid reading mode/orientation selections
Related to #5068

(cherry picked from commit 09c07faafd)
2021-05-22 16:48:36 -04:00
arkon 844fb8129c Don't hide side nav when opening ActionToolbar on tablets
(cherry picked from commit fa872f6cf7)
2021-05-22 16:47:48 -04:00
arkon 7a9c2afe87 Fix grid columns on tablets, split out common main_activity layout sections
(cherry picked from commit ef53d4ec07)
2021-05-22 16:47:40 -04:00
arkon 35879921dd Initial tablet NavigationRailView implementation
TODO:
- Make the side nav go beside the toolbar too
- Extract out common main_activity stuff to remove duplicated code

(cherry picked from commit de35a4c62a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
#	app/src/main/res/layout/main_activity.xml
2021-05-22 16:47:17 -04:00
arkon f5a90d46ec Minor cleanup
(cherry picked from commit fcde6c2b84)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt
2021-05-22 16:34:09 -04:00
arkon d332f98b34 Update dependencies
(cherry picked from commit 9cbe053e79)
2021-05-22 16:30:08 -04:00
Riztard Lanthorn b339bd4f3f Add cancel all for series in download queue (#5062)
Co-authored-by: Jays2Kings <jays@outlook.com>
(cherry picked from commit 7ba43ae5c2)
2021-05-22 16:29:46 -04:00
arkon de414fb49b Instantiate extension preferences with proper datastore earlier
(cherry picked from commit 5700c7a0c7)
2021-05-22 16:29:37 -04:00
arkon 185b7fe70e Fix MultiSelectListPreference crash in extensions
(cherry picked from commit 5069d8dee6)
2021-05-22 16:29:25 -04:00
arkon a947fcd9b9 Fix rotation shortcut tooltip
(cherry picked from commit 47c120e58c)
2021-05-22 16:29:13 -04:00
arkon 7b9f5474bb Don't toggle favorite status from snackbar if already added (fixes #5038)
(cherry picked from commit 8d7ab13f5c)
2021-05-22 16:28:55 -04:00
Andreas 6238f06d39 Automatic background color for PagerViewer (#4996)
* Add J2K implementation of automatic background

Co-authored-by: Jays2Kings <8617760+Jays2Kings@users.noreply.github.com>

* Tweak the monstrosity called automatic background

* Add ability to choose Automatic as a background

* More tweaks

Co-authored-by: Jays2Kings <8617760+Jays2Kings@users.noreply.github.com>
(cherry picked from commit 122cdae5bc)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt
#	app/src/main/res/values/arrays.xml
2021-05-22 16:28:40 -04:00
Jobobby04 7e612e63b4 Proguard fixes 2021-05-22 16:07:11 -04:00
simakover 63139a5c08 hide update and history buttons option (#324)
* hide update and history buttons option

* Move updates and history button in More then hiding

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
2021-05-22 15:17:35 -04:00
Jobobby04 b63df25f7b Cleanup 2021-05-22 14:40:44 -04:00
Jobobby04 44385ed9cc Update some dependencies 2021-05-22 14:40:11 -04:00
Jobobby04 9eb1927d2e Better handling of Okhttp in awaitResponse 2021-05-22 14:39:22 -04:00
Jobobby04 20cbadb23d Update mangadex to api 5.0.10 2021-05-22 14:38:47 -04:00
Jobobby04 e37d4afce6 Revert "Fix duplicates in E-Hentai search 99% of the time, keep that 1% so it doesnt error"
This reverts commit fbc98ddb0a.
2021-05-21 21:06:45 -04:00
Jobobby04 fbc98ddb0a Fix duplicates in E-Hentai search 99% of the time, keep that 1% so it doesnt error 2021-05-21 19:15:17 -04:00
Jobobby04 91ca176c28 When throttling E-Hentai, suspend the thread instead of sleeping it 2021-05-21 17:06:40 -04:00
Jobobby04 fd65db51c1 Fix some text colors 2021-05-18 13:05:40 -04:00
Jobobby04 33a590d895 Mangadex fixes 2021-05-17 12:45:33 -04:00
Jobobby04 bc871cd2ee Dismiss the filter sheet when a button is pressed 2021-05-14 13:54:46 -04:00
Jobobby04 65f66630cf Make backing up read manga optional 2021-05-14 13:47:36 -04:00
Jobobby04 ab0f5d107f Use a unofficial cover api for mangadex browse
Co-authored-by: Henrik <henrik9999@users.noreply.github.com>
2021-05-13 14:07:22 -04:00
Jobobby04 4a2d9dbdf8 Fix Publication Complete status showing as unknown 2021-05-12 23:32:26 -04:00
Jobobby04 08f1eff450 Update Mangadex Similar to GoldBattles latest version 2021-05-12 23:29:14 -04:00
Jobobby04 e500d0bebf Exh login menu supports custom igneous cookies. Supports translation now as well 2021-05-12 18:19:43 -04:00
Jobobby04 2629b3420b Update for Mangadex api 5.0.5 2021-05-12 16:17:39 -04:00
Jobobby04 81e7d674a2 Update the Android Gradle plugin 2021-05-12 16:16:59 -04:00
Jobobby04 0c33b7915b Remove unused sheet extensions 2021-05-11 13:07:10 -04:00
Jobobby04 29e4392490 Cleanup the mangadex list calls 2021-05-11 13:06:55 -04:00
Jobobby04 ba9db7ceb9 Fix EHentai Syncing a bit 2021-05-11 12:40:11 -04:00
Jobobby04 32197b1491 Add erotica and pornographic to lewd 2021-05-11 12:39:29 -04:00
Jobobby04 3f56c81c03 Cleanup some tag stuff 2021-05-11 12:38:50 -04:00
Jobobby04 b657af8d1c Fix a Guya crashlytics crash 2021-05-10 22:03:17 -04:00
Jobobby04 273d61e69b Chunk the statuses endpoint 2021-05-10 22:03:17 -04:00
Jobobby04 2ec5581e8c Likely fix background crashes 2021-05-10 22:03:16 -04:00
Jobobby04 be6637c7fd Fix mangadex manga not adding all chapters 2021-05-10 22:03:16 -04:00
Jobobby04 93d317629f Disable the mangadex cover setting for now 2021-05-10 22:03:16 -04:00
Jobobby04 df188b7b90 Add copy function to MangasPage 2021-05-10 22:03:15 -04:00
OncePunchedMan 27f2e8ecbc [IDEA] Changing to labels not always visible (#296)
* disable always visible labels

* make it a setting

* remove redundant line

* Fix preference keys

* Update keys again

* Fix import

* Remove extra line

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
2021-05-10 22:02:55 -04:00
Henrik 44ba757ad8 add goldbattle mdaltimage data api (#312) 2021-05-10 22:02:31 -04:00
Jobobby04 d04cdd9b34 Half fix legacy backup with dex manga 2021-05-09 23:27:18 -04:00
Jobobby04 333f55a44b Enable MangaPlus chapters in mangadex delegation 2021-05-09 22:20:39 -04:00
Jobobby04 1f9b69fc07 Multiple bugfixes for mangadex delegation
Chapters should be sorted
Multiple language fixes
Multiple empty result fixes
2021-05-09 22:10:22 -04:00
Jobobby04 09802c3609 Fix chapter names to match the extension 2021-05-09 19:19:20 -04:00
Jobobby04 93fe927de2 Cleanup some delegation 2021-05-09 18:56:26 -04:00
Jobobby04 428a9e82f3 Use a string builder instead of a list to make chapter names 2021-05-09 18:56:25 -04:00
Jobobby04 7e1389ef05 Update merge chapters in parallel, protect against one failing and stopping the whole thing 2021-05-09 18:56:25 -04:00
Jobobby04 fc354f5792 Mangadex Api 5.0.4 2021-05-09 18:56:25 -04:00
Jobobby04 c26adbb81d Remove unused glide proguard rules 2021-05-09 18:56:24 -04:00
Jobobby04 31473351af Mangadex cleanup 2021-05-09 18:56:24 -04:00
Jobobby04 5c2d26aa7c Genkan.io crash fix 2021-05-09 18:56:23 -04:00
Jobobby04 f0a2b85dd5 Fix typo 2021-05-09 18:56:23 -04:00
Henrik 85398f7c30 add mal cover for mangadex and fix kitsu covers in some cases (#311) 2021-05-09 18:56:01 -04:00
Jobobby04 c787498b85 Use kitsu cover for mangadex manga if avalible 2021-05-07 20:53:59 -04:00
Jobobby04 8532a9e2c5 Backup filtered scanlators using the Neko key 2021-05-07 14:42:57 -04:00
Jobobby04 aa6013b7ca Convert the Chapter sheet into a dialog 2021-05-07 14:27:07 -04:00
Jobobby04 cb2432cce9 Fix a few bugs that were found in the extension 2021-05-07 14:14:05 -04:00
Jobobby04 dd81e5f2b9 Add artist parsing, fix possibly broken author parsing 2021-05-07 14:13:45 -04:00
Jobobby04 c3be087472 Remove unneeded metadata source functions 2021-05-07 14:02:08 -04:00
Jobobby04 84a1da2952 Fix updating remote status, allow editing MdList tracking 2021-05-07 13:43:34 -04:00
Jobobby04 e62de734aa Remove Uneeded Injekt.get calls 2021-05-07 13:42:20 -04:00
Jobobby04 866a92474f Disable requesting metadata for now 2021-05-07 13:41:33 -04:00
Jobobby04 b297d580b0 Get statuslist first when parsing tracking 2021-05-07 13:39:50 -04:00
Jobobby04 858a5e6eee Cleanup token authenticator, fixes ctd when opening tracking 2021-05-07 13:39:15 -04:00
Jobobby04 7c3c452ac2 Dont require logging into mangadex 2021-05-06 22:48:21 -04:00
Jobobby04 b9b5ef55ab Rewrite and enable Mangadex delegation for V5 of Mangadex (Thanks Cesco)
Co-authored-by: CarlosEsco <CarlosEsco@users.noreply.github.com>
2021-05-06 21:19:30 -04:00
Jobobby04 8686fecb1f Browse source from migration now properly adds it as a result 2021-05-06 16:57:27 -04:00
Jobobby04 c5148b4739 Cleanup E-Hentai code 2021-05-06 15:35:42 -04:00
Jobobby04 a4933388aa Add reader bottom button menu customization 2021-05-06 15:33:28 -04:00
Jobobby04 9095c98159 Organize reader settings a bit 2021-05-04 16:47:17 -04:00
arkon 8c2de86b16 Fix source filter FAB disappear on rotation (fixes #4994)
(cherry picked from commit 8d58a8d548)
2021-05-04 15:40:39 -04:00
arkon 635dd0cda5 Fix settings search crash (fixes #5002)
Can't lateinit since the controllers are instantiated via reflection.

(cherry picked from commit b453be081e)
2021-05-04 15:40:28 -04:00
arkon bde5d4da26 Fix navigation issue when activity is recreated
(cherry picked from commit 3c947f323f)
2021-05-04 15:40:18 -04:00
Ivan Iskandar 4f02f652d9 Show notification to disable Incognito Mode when it's enabled (#4976)
* Show notification to disable Incognito Mode when it's enabled

* Finish ReaderActivity and BrowseSourceController when incognito is disabled

* CLeanup strings

* Only register DisableIncognitoReceiver when needed

(cherry picked from commit cb203ef02c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt
2021-05-04 15:40:06 -04:00
arkon 6dad90e19c Reader grayscale filter (closes #2822)
(cherry picked from commit 908c9bc624)
2021-05-04 14:49:43 -04:00
Andreas 8fdd6c3bf9 Fix bugs in dual-page split (#4983)
If more bugs appear probably better to go back to the main thread and process dual-pages every time a page is shown as it did before

(cherry picked from commit fe373a95a2)
2021-05-04 14:49:35 -04:00
arkon 4cbf647365 [SKIP CI] Update issue-closer-action
(cherry picked from commit 60f18f3b5a)
2021-05-04 14:49:12 -04:00
arkon 86d67b9bf7 Cancel scope in SettingsControllers properly
(cherry picked from commit 284c019b32)
2021-05-04 14:49:01 -04:00
arkon 69aebb5571 Update kotlinx.serialization
(cherry picked from commit 32434471e5)
2021-05-04 14:48:52 -04:00
Jays2Kings 00afc11d4f Change string chop method default to use smaller ... instead
(cherry picked from commit 43b42f8d54bf8872b4fd2467b33fa06a9a44dbb6)
(cherry picked from commit 6a4c280235)
2021-05-04 14:48:43 -04:00
arkon c518b593ce Better handling of coroutine cancellations for http calls
Based on https://github.com/tachiyomiorg/tachiyomi-1.x/commit/b94b7eeb6d28a4c3f39488388589fa913c43fe5e

(cherry picked from commit 0afe3011bc)
2021-05-04 14:48:28 -04:00
Andreas 5c352cb3c0 Add manga-wised rotation mode settings (#4841)
* Add manga-wised rotation mode settings

Based on #3522

Co-authored-by: bboyz269 <4453811+bboyz269@users.noreply.github.com>

* Fix small mistakes

* Complete TODOs

* Rename functions

rotation -> orientation

* Fix orientation icon not changing

Bug from video

* Fix bug with force portrait not being force if a default value

Bug from video

* Backup viewer_flag as a seperate field in so legacy/forks doesn't crash

* Make viewer_flags nullable so old backups viewer gets restored

* Add migration for old rotation and viewer to new defaults ones

* Rename variable in enums

* Fix migration after OrientationType was changed

* Remove untrue comment

Co-authored-by: bboyz269 <4453811+bboyz269@users.noreply.github.com>
(cherry picked from commit 0fef546a0d)

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/models/BackupManga.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
2021-05-04 14:48:06 -04:00
Ivan Iskandar 73c9df9c43 Use Coil (#4870)
* Use Coil

* Remove coil-transformations lib

* Add MangaCoverFetcher

* Remove Glide

* MangaCoverFetcher: Allow skipping custom cover usage

* Adjust coil caching policy for some non-library items

* Allow coil to use RGB565 only on low ram devices

* Fix image loading progress view not showing

a

* Increase coil crossfade duration

Same as default glide duration

* Add back request clearing

(cherry picked from commit 93e6136795)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/glide/FileFetcher.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/glide/TachiGlideModule.kt
#	app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceComfortableGridHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceListHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryComfortableGridHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
2021-05-04 14:13:17 -04:00
arkon 8b2f24c86a Update sqlite-android
This version is on jitpack instead of jcenter

(cherry picked from commit 7d23fd8ef5)
2021-05-04 14:13:16 -04:00
arkon 39c61a77b1 Move save pages to manga title setting to Reader section
(cherry picked from commit 224fcada17)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt
2021-05-04 14:13:16 -04:00
OncePunchedMan d09bcafe7d Setting: Creates folders according to manga title (#4861)
* cherry-picking my changes

* Update SettingsDownloadController.kt

* Update SettingsDownloadController.kt

* Update ReaderPresenter.kt

Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit 9278407b85)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt
2021-05-04 14:13:15 -04:00
Ivan Iskandar 1fdf2225d9 Use adaptive icon for app shortcuts (#4968)
Also swap the color

(cherry picked from commit dad3292bdd)
2021-05-04 14:13:15 -04:00
arkon b4a226157c Drop support for Android 5.x
(cherry picked from commit 89619b7836)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
2021-05-04 14:13:14 -04:00
Jobobby04 39d6319e8f Remove useless getResourceColor call 2021-05-04 14:13:14 -04:00
Jobobby04 765eac843d Round migration card corners 2021-05-04 14:13:13 -04:00
Riztard Lanthorn 9a6b8a3f41 fix invisible system nav bar (#297)
new nav bar scrim already make it semi transparent
2021-05-04 14:12:28 -04:00
curche 28fab7a918 fixes to Migration menu layouts (#295)
* fix Migration process item option button color

fixed by comparing with other layouts and adding app:tint to migration
process item layout

fixes https://github.com/jobobby04/TachiyomiSY/issues/287

* fix migration manga card layout for white theme

compared with other layouts like source compact card item and realised
that textColor was missing.

Also added font so that it looks cooler :d
2021-05-03 12:16:38 -04:00
curche 900aa155ca make favorites sync less ambiguous (#294)
favorites sync is used for Ex/E-Hentai. Some users didn't know what it
meant and assumed it was something else. This commit makes it explicit
2021-04-30 14:48:45 -04:00
Jobobby04 f9b4cb5bc9 Fix manga plus 2021-04-28 21:43:37 -04:00
Jobobby04 1147bab1ce Quick fix to update check 2021-04-28 15:26:34 -04:00
Jobobby04 0aebe1da43 Release 1.6.2 2021-04-28 14:24:05 -04:00
arkon f45fdca168 Remove app update check on Android 5.x
(cherry picked from commit 13324dd1a1)
2021-04-28 14:01:22 -04:00
Jozef Hollý fc5eb4cccc Weblate translations (#4947)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Albedo <Illiator27@gmail.com>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Blue cat <bluecat300@gmail.com>
Co-authored-by: Csíkos Martin Nándor <csikos.martin17@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Losms <krishna.chand67@yahoo.com>
Co-authored-by: Luka Paun <croluxgame@gmail.com>
Co-authored-by: Lusuho <jevpsychox@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nestor A. Sanchez <help.toastcode@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Q farfayoux <aym.belrhiti@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Techeira Damián <damian.techeira@mercadolibre.com>
Co-authored-by: Thu Htoo San <kokhantyangon@gmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es_419/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hu/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/my/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Albedo <Illiator27@gmail.com>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Blue cat <bluecat300@gmail.com>
Co-authored-by: Csíkos Martin Nándor <csikos.martin17@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Losms <krishna.chand67@yahoo.com>
Co-authored-by: Luka Paun <croluxgame@gmail.com>
Co-authored-by: Lusuho <jevpsychox@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nestor A. Sanchez <help.toastcode@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Q farfayoux <aym.belrhiti@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Techeira Damián <damian.techeira@mercadolibre.com>
Co-authored-by: Thu Htoo San <kokhantyangon@gmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit ae9bf06b46)
2021-04-27 23:36:57 -04:00
Eugene 8ac309c4ae Theme AMOLEDblue (#280) 2021-04-27 17:57:51 -04:00
Jobobby04 f170446c5f Lint 2021-04-26 18:02:29 -04:00
arkon 643bec9bbb Update issue-closer-action
(cherry picked from commit 5236834911)
2021-04-26 18:02:11 -04:00
Ivan Iskandar 134be3893e Fix download error icon color tint (#4959)
* Fix download error color tint

* Use progress indicator as download icon border

* Resolve feedback

* Use extension function to set tinted drawable

(cherry picked from commit bf80dd622c)
2021-04-26 18:01:55 -04:00
Andreas 5855822edd Cleanup dual page split (#4956)
* Cleanup Dual Page Split

* Move where images is processed

* Change parameter name to imageStream

* Use available instead of Int.MAX_VALUE

* Update JavaDoc

(cherry picked from commit 662b71436e)
2021-04-26 18:01:47 -04:00
arkon 3343b766a2 Minor cleanup to updating download status in Updates
(cherry picked from commit f608cb55eb)
2021-04-26 18:01:39 -04:00
arkon 329d24c7db Don't automatically go to HALF_EXPANDED state for color filter tab (closes #4913)
(cherry picked from commit 6ba82da029)
2021-04-26 18:01:28 -04:00
arkon bdfbc641d9 Reset Incognito Mode on app relaunch (closes #4928)
(cherry picked from commit f407e30b6e)
2021-04-26 18:01:20 -04:00
Ivan Iskandar 6e570d7fad Make the download progress status smoother (#4958)
* Make the download progress status smoother

* Download status icon cleanup

(cherry picked from commit 4e7b8c98f9)
2021-04-26 18:01:11 -04:00
arkon b5d696ebe2 Use popup menus for reader shortcuts instead of toggling through
(cherry picked from commit 5f9574541f)
2021-04-26 18:01:02 -04:00
arkon 5299ae4856 Maybe better handle MAL token expiration
(cherry picked from commit 08a6db7d6e)
2021-04-26 18:00:54 -04:00
arkon a9038831da Downgrade back to stable OkHttp
Maybe fixes some crashes.

(cherry picked from commit b485e1d657)
2021-04-26 18:00:45 -04:00
arkon f1a8132307 Remove "Locked" orientation, replace with explicit orientations
Portrait/Landscape allow sensor, Locked Portrait/Landscape don't.

(cherry picked from commit e8d8621f06)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-04-26 18:00:36 -04:00
arkon 76185338bf Make manga and chapter folder name searching case insensitive
(cherry picked from commit 4cefbce7c3)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt
2021-04-26 17:58:11 -04:00
arkon bda4aae83d Sanitize source download folder name (fixes #4945)
(cherry picked from commit fa31369f99)
2021-04-26 17:57:05 -04:00
Ivan Iskandar 80bf908133 MainActivity: Show bottom nav when the tab page is changed (#4914)
* MainActivity: Show bottom nav when the tab page is changed

* Revert "MainActivity: Show bottom nav when the tab page is changed"

This reverts commit 27fd73db

* MainActivity: Show bottom nav when the app bar is fully expanded

(cherry picked from commit d0bf93ebb7)
2021-04-26 17:56:37 -04:00
arkon 91b49f8a0c Consider sort direction when downloading next n chapters (fixes #4916)
(cherry picked from commit 41a747c7e7)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-04-26 17:56:28 -04:00
arkon 80a5a54e60 Consider sort direction when resuming (fixes #4909)
(cherry picked from commit 8882cd4787)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-04-26 17:50:48 -04:00
arkon 3104f3a8b5 Add link to official Facebook page
(cherry picked from commit 68bea8a196)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2021-04-26 17:26:46 -04:00
Jobobby04 4fa2c968a9 Fix cleanup orphaned downloads removing valid downloads 2021-04-26 17:24:54 -04:00
Eugene be1e7f28ef SY Rus 1.7.0 (#270)
* Rus 1.7.0

* Fix2

* Fix3

* Fix4

* Fix5
2021-04-19 15:24:58 -04:00
Jobobby04 4118b13e5b Release 1.6.1 2021-04-19 15:19:13 -04:00
Jozef Hollý 7e0f2950c1 Weblate translations (#4812)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Christian Elbrianno <christian.elbrianno41@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Hautzii <am.03012002@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Jozef Hollý <j2.00ghz@gmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Manuel Tassi <manueltassi91@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: OfficialBispo <diogobispo10@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Reza Almanda <rezaalmanda27@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: f0roots <f0rootss@gmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/eo/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/kn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ro/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Christian Elbrianno <christian.elbrianno41@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Hautzii <am.03012002@gmail.com>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Manuel Tassi <manueltassi91@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: OfficialBispo <diogobispo10@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Reza Almanda <rezaalmanda27@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: f0roots <f0rootss@gmail.com>
Co-authored-by: monolifed <monolifed@protonmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit 554f890ae3)
2021-04-19 14:59:03 -04:00
arkon a8c4da9e2b Theme BiometricUnlockActivity to avoid flashing light theme
(cherry picked from commit dd1743698f)
2021-04-19 14:58:52 -04:00
arkon 72d315b6ed Include extension loading errors in error logs
(cherry picked from commit b092e98ac9)
2021-04-19 14:58:44 -04:00
arkon b886f0a55a Fix activity leak
(cherry picked from commit 9ee6262aed)
2021-04-19 14:58:36 -04:00
Fernando Maldonado 63fa1ee75e Fix status bar icon colors in webview activity (#4903)
* Fixed status bar icon colors in webview activity

* Changed theme to Theme.Base

* Changed app theme to Theme.Base

* Update themes.xml

Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit 24a2d86f41)
2021-04-19 14:58:21 -04:00
Andreas 7d1ad7efb6 [SKIP CI] Update FUNDING.yml (#4907)
(cherry picked from commit b5c5c66336)
2021-04-19 14:57:13 -04:00
arkon 56400febd1 Update LeakCanary
(cherry picked from commit a598ac3993)

# Conflicts:
#	app/build.gradle.kts
2021-04-19 14:56:48 -04:00
arkon aa56698dac Clean up controller viewbinding creation
Based on https://github.com/Jays2Kings/tachiyomiJ2K/blob/master/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt

(cherry picked from commit cab919d74c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-04-19 14:56:08 -04:00
Ivan Iskandar d37b24adb1 Fix source SearchView stuck open until query submitted (#4897)
closes #4850

(cherry picked from commit 60a929b92c)
2021-04-19 14:42:18 -04:00
arkon d3778ac6e1 Clean up ChapterCache (remove Gson, Rx usage)
(cherry picked from commit 356b7c346a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt
2021-04-19 14:42:04 -04:00
Ivan Iskandar e43777bba7 Themes cleanup (#4894)
(cherry picked from commit ad57fde1c5)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseThemedActivity.kt
#	app/src/main/res/values/themes.xml
2021-04-19 14:35:28 -04:00
arkon 0b3209284a Update KotlinX dependencies
(cherry picked from commit 17f7dea21b)
2021-04-19 14:18:47 -04:00
arkon a1be070e99 Minor cleanup
(cherry picked from commit b40af7c3c6)

# Conflicts:
#	README.md
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
2021-04-19 14:18:39 -04:00
arkon eda47cd546 Move reading mode toast to default bottom position
Toasts don't block user interaction, so it's probably fine.

(cherry picked from commit 9065362fde)
2021-04-19 14:17:37 -04:00
arkon 54d8748c58 Adjust ActionToolbar positioning
Have I ever mentioned that I hate insets?

(cherry picked from commit ad9bad3d17)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
2021-04-19 14:16:22 -04:00
arkon 77c17f2556 Avoid duplicate actions in update notifications
(cherry picked from commit dfd858034f)
2021-04-19 14:15:55 -04:00
arkon d81e4158cb Add clipboard error string
I pulled a Jay and forgot to stage something.

(cherry picked from commit 58ad8fa8c0)
2021-04-19 14:15:43 -04:00
arkon 77061067ee Avoid crash when users copying to clipboard fails because they have apps that are listening to their clipboards but also denied permissions
See https://commonsware.com/blog/2013/08/08/developer-psa-please-fix-your-clipboard-handling.html

(cherry picked from commit 38610d8a24)
2021-04-19 14:15:33 -04:00
arkon 707af702c1 Avoid rare crash in WebViewActivity
(cherry picked from commit 27cec697bf)
2021-04-19 14:15:24 -04:00
arkon 1b0b98b140 [SKIP CI] Add string for EOL update check message
(cherry picked from commit 024f9a8c76)
2021-04-19 14:15:14 -04:00
arkon 2220b6a91d Follow chapter sort setting for start/resume FAB (closes #1716)
(cherry picked from commit f7cc36f2f0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-04-19 14:14:59 -04:00
arkon 22b8f51fa3 Double tap Updates to go to Download Queue (closes #4884)
(cherry picked from commit ef5148ebb4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
2021-04-19 14:07:22 -04:00
arkon 08f0e515d5 Use DSL for creating chapter description spanned string
(cherry picked from commit 6dbc0a6fd5)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt
2021-04-19 14:06:51 -04:00
arkon 28b4281683 Follow chapter sort setting when downloading next n chapters (closes #4725)
(cherry picked from commit fba3f9d501)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-04-19 14:05:12 -04:00
arkon 676f716fcb Update issue templates
(cherry picked from commit d9f8137362)

# Conflicts:
#	.github/ISSUE_TEMPLATE.md
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/ISSUE_TEMPLATE/feature_request.md
2021-04-19 14:02:07 -04:00
arkon 665784a241 Adjust MoreController bottom padding for navbar
(cherry picked from commit 28416489b2)
2021-04-19 14:01:11 -04:00
arkon 0d16609f95 Long press reader settings icon to open color filter tab
Partially addresses #4867

(cherry picked from commit 54a23ddd1f)
2021-04-19 14:01:02 -04:00
arkon b46500c837 Add checkmark beside selected popup menu item
Based on what's in J2K. Also renamed to MaterialSpinnerView to match what's there.

Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
(cherry picked from commit 3287ca9cf2)
2021-04-19 14:00:55 -04:00
arkon fb5872ef51 Case insensitive source directory search
(cherry picked from commit a59e134862)

# Conflicts:
#	app/build.gradle.kts
2021-04-19 14:00:44 -04:00
arkon bc28e2d617 Adjust ActionToolbar positioning
(cherry picked from commit 1f8c5b0120)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
2021-04-19 14:00:10 -04:00
arkon de0c55117d Minor cleanup
(cherry picked from commit c7f839ea4a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt
2021-04-19 13:59:33 -04:00
arkon 936997b52e Remove toolbar snapping
(cherry picked from commit d981245723)
2021-04-19 13:58:43 -04:00
Ivan Iskandar 885c251fb4 Add navigation bar scrim (#4845)
* Revert "Add navigation bar scrim (closes #4836)"

This reverts commit 2a69d1b0

* Add navigation bar scrim

(cherry picked from commit 1f729f1cb3)
2021-04-19 13:58:32 -04:00
Jobobby04 b8e907cea2 Block merged manga from being able to be migrated 2021-04-15 15:28:28 -04:00
Jobobby04 f4c6b2e09c Fix crash in migration if there are no viable chapter numbers 2021-04-15 15:03:44 -04:00
Jobobby04 13f4bfa7bc Remove source migration action 2021-04-15 14:57:49 -04:00
Jobobby04 780c1e68a6 Rename debug function 2021-04-14 19:01:41 -04:00
Jobobby04 f10944521c Fix build 2021-04-14 18:45:48 -04:00
arkon af5ebeca56 Avoid crash when unknown reading mode is used
(cherry picked from commit b4577d6676)
2021-04-14 18:38:23 -04:00
arkon 01ad3dc92b Handle reader toolbar subtitle getting cut off when text is too big (closes #4843)
(cherry picked from commit 544adb9940)

# Conflicts:
#	app/src/main/res/layout/reader_activity.xml
2021-04-14 18:38:09 -04:00
Jays2Kings 5c1423be86 Migrating manga now also saves more chapter info
Bookmarks, Last Read, Date fetched, and has been read fully (this was already tracked but previously it only took the highest chapters

Closes #151

(cherry picked from commit ee4f3e6586910c8c4d62859c867c2a40e41eef67)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/advanced/process/MigrationProcessAdapter.kt
2021-04-14 18:20:24 -04:00
Jays2Kings 382c23e0fd Fix webtoon mode not calling OnPageSelected in some cases (in upstream too)
This fix isn't 100% tested, but like 80%.

@arkon if you're reading this, this issue is happening up stream too. I can make a issue for it in the repo but haven't checked if it happens there:

Steps:
Get Cubari source, search "cubari:imgur/3iOqiIy" change to continuous vertical, crop borders. Then back out and open the chapter again. onPageSelected isn't called because recycler position is -1. Regardless of the 4 pages you should be on

also fyi just a slight scroll fixes this issue but still

(cherry picked from commit 88fd6e5c9897d4a528f93dd02cfa2a4c644a799d)
(cherry picked from commit 5f0493f1e5)
2021-04-14 18:18:03 -04:00
arkon 189b15fee6 Edge-to-edge in licenses activity
(cherry picked from commit c749e50bec)
2021-04-14 18:17:55 -04:00
arkon d3d937fe17 Use accent color for edge effect
(cherry picked from commit a4e5e3ece5)
2021-04-14 18:17:48 -04:00
Jobobby04 5af0e7e847 Nullable source name for manga type 2021-04-14 18:16:53 -04:00
Jobobby04 142bdd14b7 Add debug function to fix reader toast crash 2021-04-14 18:16:23 -04:00
Jobobby04 0483097fc3 Cleanup 2021-04-13 18:53:10 -04:00
Jobobby04 a3c26c63d4 LoginSource changes 2021-04-13 18:52:57 -04:00
arkon fbe10151f4 Add navigation bar scrim (closes #4836)
(cherry picked from commit 2a69d1b051)
2021-04-13 18:51:57 -04:00
arkon 92fc5ea4a0 Allow weaker unlock methods in Android 6 - 10 (fixes #4833)
(cherry picked from commit 126e1e2d9d)
2021-04-13 18:51:49 -04:00
arkon d2b620f485 Include debug info in dumped crash logs
(cherry picked from commit 0586e1d3ad)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2021-04-13 18:51:40 -04:00
arkon 78aa57579d Allow dismissing download progress notification when paused (closes #4832)
(cherry picked from commit 07cb1c237e)
2021-04-13 18:49:54 -04:00
arkon b0a2d8908f Disallow forced dark mode, such as MIUI's
(cherry picked from commit f4f1efe5fa)
2021-04-13 18:49:45 -04:00
arkon de36cd0626 Fix toolbar elevation in History and Updates
(cherry picked from commit 37fdf4d434)
2021-04-13 18:49:34 -04:00
arkon b322ecd34a Fully expand source filter sheet on show (closes #4455)
(cherry picked from commit 99b46096a4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
2021-04-13 18:49:23 -04:00
arkon 540e234562 Use same non-sticky heading style as Browse for Updates/History (closes #4822)
(cherry picked from commit 12e90ae35e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/SelectionHeader.kt
2021-04-13 18:31:18 -04:00
arkon f6be2c7a2a Start download when tapping update notification (closes #4825)
(cherry picked from commit 023311a874)
2021-04-12 15:03:49 -04:00
arkon c5df8725de Fix ActionToolbar bottom offset
(cherry picked from commit 155a4dd463)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
2021-04-12 15:03:40 -04:00
arkon 738e2f7cf1 Offset appbar using margin instead (maybe fixes #4819)
(cherry picked from commit 15bed1ac4c)
2021-04-12 15:03:10 -04:00
Tooster 0ac56750c8 Fix LibraryUpdateServiceTest so ./gradlew ... doesn't crash (#4821)
(cherry picked from commit 27f55f8098)
2021-04-12 15:03:01 -04:00
Jobobby04 3fb1b4affa Update readme screens 2021-04-12 14:45:13 -04:00
Jobobby04 2602c49756 Hide dedupe by priority 2021-04-12 14:45:13 -04:00
Eugene d23b3c82ba Rus locale (#262)
* Rus lacale

* pref_left_handed_vertical_seekbar_summary

* Fix 1
2021-04-11 23:47:47 -04:00
Jobobby04 6fa67c9a5f Release 1.6.0 2021-04-11 21:51:55 -04:00
Jobobby04 7a85d6b163 Update dependancies 2021-04-11 21:43:44 -04:00
Jobobby04 5a909f48b6 Fix some logs 2021-04-11 21:43:05 -04:00
Jobobby04 4d22db919d Disable mangadex tracking 2021-04-11 20:59:34 -04:00
Jobobby04 8a9f2cce10 More inset fixes 2021-04-11 20:56:50 -04:00
Jobobby04 ede0892cda Cleanup and fixes 2021-04-11 20:43:34 -04:00
Jobobby04 5df0eb7ed1 Convert EHentai Login controller to a activity 2021-04-11 20:43:21 -04:00
Jobobby04 67cb42ff30 Some inset fixes 2021-04-11 20:32:44 -04:00
Jobobby04 e65ea94a08 Comment out Mangadex intents 2021-04-11 20:31:12 -04:00
arkon fdac8a0380 Lint fixes/ignore some errors
(cherry picked from commit a3f1b72126)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-04-11 18:48:14 -04:00
arkon 1c56624d13 Make library update/backup error log action clearer for non-technical users
(cherry picked from commit a82e5f5452)
2021-04-11 18:47:32 -04:00
arkon 7c05c59501 Add locales: jv, lt, ne
(cherry picked from commit e10cb0e632)
2021-04-11 18:47:23 -04:00
arkon af77a58dcb Update DoH translations
(cherry picked from commit c7e07a6df0)
2021-04-11 18:47:16 -04:00
Jozef Hollý 5ee87ce8fc Weblate translations (#4647)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Arlangue <virgilemp@outlook.fr>
Co-authored-by: August Wale <bleachlithium@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Edgar Mejía <edgar13155@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Hajba Károly <karoly.hajba98@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Kiroki Benjamin <heptahex999@gmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: LOKE__01 <luckylakshman378@gmail.com>
Co-authored-by: Luis Andrés Bajaña F <labfernandez2014@gmail.com>
Co-authored-by: Lusuho <jevpsychox@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Matyáš Caras <hernik27@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nikola Perović <nikolaperovicccc@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: P6N7L <nichitapospai@gmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pijus Bend <pijus.bend@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Q farfayoux <aym.belrhiti@gmail.com>
Co-authored-by: Riztard Lanthorn <riyanluqman@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Schrödinger's cat <schrodingers-kate@protonmail.com>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Tantia <ilovechocobi@yahoo.com>
Co-authored-by: TheLastMelody <swordofthefallen@hotmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Yardi van Nimwegen <yardivn@live.nl>
Co-authored-by: antocs <roxasthethund@yahoo.it>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 殺Mustafa <mustafasheref8@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/eo/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es_419/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hu/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/jv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/kn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/lt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/lv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/my/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ne/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ro/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Arlangue <virgilemp@outlook.fr>
Co-authored-by: August Wale <bleachlithium@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Edgar Mejía <edgar13155@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: FateXBlood <zecrofelix@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Hajba Károly <karoly.hajba98@gmail.com>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jakub Fabijan <animatorzPolski@gmail.com>
Co-authored-by: Kiroki Benjamin <heptahex999@gmail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: LOKE__01 <luckylakshman378@gmail.com>
Co-authored-by: Luis Andrés Bajaña F <labfernandez2014@gmail.com>
Co-authored-by: Lusuho <jevpsychox@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Matyáš Caras <contact@hernikplays.cz>
Co-authored-by: Matyáš Caras <hernik27@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nikola Perović <nikolaperovicccc@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: P6N7L <nichitapospai@gmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pijus Bend <pijus.bend@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Q farfayoux <aym.belrhiti@gmail.com>
Co-authored-by: Riztard Lanthorn <riyanluqman@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Schrödinger's cat <schrodingers-kate@protonmail.com>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: Shjosan <shjosan@kakmix.co>
Co-authored-by: Tantia <ilovechocobi@yahoo.com>
Co-authored-by: TheLastMelody <swordofthefallen@hotmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Yardi van Nimwegen <yardivn@live.nl>
Co-authored-by: antocs <roxasthethund@yahoo.it>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 殺Mustafa <mustafasheref8@gmail.com>
(cherry picked from commit 2e0c778090)
2021-04-11 18:47:09 -04:00
arkon 348ef2cf0f Log "Invalid download location" issues to error log
(cherry picked from commit d421401626)
2021-04-11 18:46:45 -04:00
arkon 828944950b Add Google DoH provider
(cherry picked from commit b2d4e5ab84)

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt
2021-04-11 18:46:37 -04:00
Ivan Iskandar 1c67e82325 BrowseSourceController: Fix navigation bar insets not properly applied (#4810)
(cherry picked from commit 84e023607c)
2021-04-11 18:44:02 -04:00
Ken Swenson a45e273e2c Move deletion actions to the IO thread (#4808)
(cherry picked from commit f145fd0dec)
2021-04-11 18:43:55 -04:00
arkon 45cf4adb5b Update some dependencies; downgrade core-ktx
Fixes ActionMode being underneath statusbar

(cherry picked from commit 42a9f911d8)
2021-04-11 18:43:46 -04:00
arkon eb823cb208 Revert manga title folder for saved pages (closes #4803)
People also didn't like it making their galleries more complicate to navigate.

(cherry picked from commit 9567d55312)
2021-04-11 18:43:37 -04:00
arkon 056358fb9d Update to Gradle 7
(cherry picked from commit 531cd99247)
2021-04-11 18:43:27 -04:00
Ivan Iskandar 9e40625c08 Draw edge-to-edge (#4802)
(cherry picked from commit f3660d88dd)

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
2021-04-11 18:43:19 -04:00
arkon 9684e34241 [SKIP CI] Add lock workflow
(cherry picked from commit 3accb9a08b)
2021-04-11 18:41:47 -04:00
arkon 84fdd097e0 Update some internal dependencies
They no longer rely on jcenter

(cherry picked from commit 63ce7371bb)
2021-04-11 18:41:36 -04:00
Riztard Lanthorn a3c44fc5ad Search in library include manga description (#4787)
Co-Authored-By: jobobby04 <jobobby04@gmail.com>

Co-authored-by: jobobby04 <jobobby04@gmail.com>
(cherry picked from commit 01c3498dbf)
2021-04-11 18:41:28 -04:00
Taco 196e437da5 Update NDK, more KTX usage (#4792)
* Update NDK

* Utilize more KTX extensions

(cherry picked from commit b3471234ad)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt
2021-04-11 18:41:20 -04:00
arkon 5e8b5ef6cf Add clarification for category exclusion (closes #4777)
(cherry picked from commit b2d697131c)
2021-04-11 18:40:31 -04:00
arkon 1ba07466ef Minor cleanup
(cherry picked from commit ef49fc91d8)
2021-04-11 18:40:23 -04:00
arkon eb88c9c94b Flip crop borders and orientation toggles
(cherry picked from commit 6222b47a4f)

# Conflicts:
#	app/src/main/res/layout/reader_activity.xml
2021-04-11 18:40:12 -04:00
arkon d6cab9f9a5 Update Kotlin and Kotlinter
(cherry picked from commit f58e3c390a)
2021-04-11 18:39:06 -04:00
arkon bcc120056c Make reader spinner colors a bit more consistent
(cherry picked from commit 7504621a24)

# Conflicts:
#	app/src/main/res/layout/reader_general_settings.xml
2021-04-11 18:38:58 -04:00
arkon 0e8aec7929 Align filter spinners (closes #2995)
(cherry picked from commit 88e49a9b8b)
2021-04-11 18:37:13 -04:00
Jobobby04 2d4e589db8 Search browse if tag clicked in manga from Index controller 2021-04-11 18:36:41 -04:00
Jobobby04 3eecf5cb20 Disable Mangadex delegation 2021-04-11 18:17:06 -04:00
Jobobby04 6b08889c15 Use a Enum for MigrationStatus 2021-04-06 13:39:25 -04:00
Jobobby04 3bf070d88a Use material dialogs for exclude from automatic deletion 2021-04-04 21:40:26 -04:00
arkon 6d9753f361 Revert using fetch date for updates list
Spamming the list post-migration is currently a more common usecase than sources without chapter dates. We'll need to figure out a better way of handling both scenarios.

(cherry picked from commit 5b23f29d06)
2021-04-04 19:12:44 -04:00
arkon f6b9867ce8 Fix global update category exclusion
(cherry picked from commit c1bdebee78)
2021-04-04 19:12:36 -04:00
Riztard Lanthorn 03366ae7e5 add sort by date fetched in library (#4773)
* add sort by date fetched in library

* chapter fetch date to 8

(cherry picked from commit ddd4cc10ff)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/database/queries/MangaQueries.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt
2021-04-04 19:12:25 -04:00
arkon a70a6cbe49 Allow excluding categories from auto-download
Closes #1412

Supersedes #4121

(cherry picked from commit 0ca62a4acc)
2021-04-04 19:10:51 -04:00
arkon b5a109440f Allow excluding categories from library update
Closes #3467, #4661, #1839

Supersedes #4474

(cherry picked from commit 4f1275ac01)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-04-04 19:10:42 -04:00
arkon f6acf9325a Use Material Dialogs for auto-download categories preference
To allow for negative selections in the future.

(cherry picked from commit b2fee7035f)
2021-04-04 19:09:25 -04:00
arkon b0c0b12499 Use Material Dialogs for global update categories preference
To allow for negative selections in the future.

(cherry picked from commit e15d7cb548)
2021-04-04 19:09:16 -04:00
arkon 30ed1f11ee Fix label overflow for reader spinner preferences
(cherry picked from commit 3257cbe21f)
2021-04-04 19:09:07 -04:00
arkon 3077dc24ec Move BiometricUtil to correct package
(cherry picked from commit 1237af1ff3)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt
2021-04-04 19:08:57 -04:00
arkon c2e882cb5b Allow weaker unlock methods (closes #4265)
(cherry picked from commit 68600b337e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt
2021-04-04 19:08:22 -04:00
arkon 835351f206 Use app name for page download folder and use manga title subfolders (closes #4684)
(cherry picked from commit dac2072eaa)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
2021-04-04 19:07:44 -04:00
arkon cee8335518 Make extension load error logs less verbose
(cherry picked from commit 1b921f9845)
2021-04-04 19:07:01 -04:00
arkon 3aa5a36fdd Minor cleanup
(cherry picked from commit a3992d9fbe)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
2021-04-04 19:05:54 -04:00
Tooster 74795bcc5e Replace reading mode snackbar with toast (#4752)
(cherry picked from commit efd2a0cb7b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-04-04 19:00:54 -04:00
Andreas 38a46825e2 Remove weird cropping from icon when showing missing chapter warning (#4769)
(cherry picked from commit fba428257b)
2021-04-04 18:56:56 -04:00
arkon 7073e9b9e5 Don't repeatedly vibrate/make sounds on download progress
(cherry picked from commit ff36901007)
2021-04-04 18:56:48 -04:00
arkon 620887f90b Add QuadStateCheckBox view
(cherry picked from commit 940d8389b5)
2021-04-04 18:56:39 -04:00
arkon e38a0d47ac Better handle webtoon SSIV crop border change
(cherry picked from commit 7aa379a857)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
2021-04-04 18:56:31 -04:00
arkon eb9de3e6f1 Add tooltips for previous/next chapter buttons
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/d0738f5b00dfc2f6225cf7a20758b61dcb720168

(cherry picked from commit 1657f04d55)
2021-04-04 18:54:49 -04:00
Jobobby04 37d9a51706 Lint 2021-04-04 18:54:18 -04:00
Jobobby04 acb9bafa0a Only enable search when mode is Catalogue 2021-04-04 18:54:07 -04:00
Jobobby04 7c4e89cbc5 Fix crashing when loading a chapter from manual search in migration 2021-03-31 16:40:38 -04:00
Jobobby04 5842765eda Update crashlytics and fast adapter 2021-03-31 14:32:07 -04:00
Jobobby04 0925bd6a37 Use a buffered reader instead of a scanner for custom manga info 2021-03-31 14:31:39 -04:00
Jobobby04 2ddf5f5037 Fix some search bugs when using the latest/browse menu 2021-03-31 14:31:08 -04:00
Jobobby04 367d95c825 Logging fixes and lint 2021-03-31 14:29:27 -04:00
Jobobby04 6951314744 Fix migration getting stopped when opening views under it 2021-03-31 01:23:51 -04:00
Jobobby04 d294db3e4e Continues -> Continuous 2021-03-30 20:00:55 -04:00
arkon b2cf1266ba Recreate webtoon SSIV when crop borders setting changes (fixes #4734)
(cherry picked from commit 407e798fdb)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
2021-03-30 19:24:46 -04:00
arkon fb01b547de Add icon for crop border shortcut off state
(cherry picked from commit 4054f2a6a0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/res/layout/reader_activity.xml
2021-03-30 19:24:46 -04:00
arkon d3482ef734 Allow translating DNS over HTTPS (closes #4747)
(cherry picked from commit 468cdf603c)
2021-03-30 19:24:45 -04:00
Jobobby04 d622c659eb Fix toggle crop borders button a bit 2021-03-30 19:24:45 -04:00
arkon d1c497aa60 Fix nav overlay always showing on start (fixes #4736)
(cherry picked from commit 988ec6a224)
2021-03-30 19:24:44 -04:00
Andreas 29a882eebb Remove insert page when dual page split get turned off (#4739)
(cherry picked from commit bdbdf211e2)
2021-03-30 19:24:44 -04:00
Johannes Joens 90ffb8cdf6 add support for Repos with Numbers in their name (#255)
* add support for Repos with Numbers in their name

* Update strings_sy.xml

changed invalid_repo_name to better reflect its meaning
2021-03-30 19:23:52 -04:00
Jays2Kings dc760c0596 Backing up custom data for manga
Using 800s from J2k in BackupManga for this(except for status)

(cherry picked from commit c21b91bc026213993a67089ef4bc76c68ade4445)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/models/BackupManga.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/library/CustomMangaManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt
#	app/src/main/res/values/strings.xml
2021-03-28 19:46:11 -04:00
arkon 7be8062a2e Fix binding of intarray preferences (maybe fixes #4728)
(cherry picked from commit 0437703cbf)
2021-03-28 19:10:36 -04:00
arkon de9ce8f949 Use regular crop icon
(cherry picked from commit 71aa592111)
2021-03-28 19:10:27 -04:00
arkon 3c3f5cf35d Add crop borders shortcut
(cherry picked from commit d501c02f8b)

# Conflicts:
#	app/src/main/res/layout/reader_activity.xml
2021-03-28 19:10:15 -04:00
arkon 7407e22b4e Remove ALPHA from dual page split label
(cherry picked from commit 9daf0e78b8)
2021-03-28 19:05:12 -04:00
arkon 3a18e76089 Clean up SpinnerPreference a bit
(cherry picked from commit dfa07a5f35)
2021-03-28 19:05:02 -04:00
arkon fa67ff165e Show nav overlay on invert tap change
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/db4eca90e957d70a102aa631708a156c29418bd3

(cherry picked from commit 437c995d12)
2021-03-28 19:04:55 -04:00
mutsumi b9d2591e2a Fix Some Bangumi Track Bug (#4726)
(cherry picked from commit cc6ae9d1a8)
2021-03-28 19:04:46 -04:00
arkon 404a6a621a Prevent manga title from jumping (fixes #4709)
(cherry picked from commit c58e4f4dee)
2021-03-28 19:04:38 -04:00
arkon aa376dc3a5 Show number of manga per source in migrate menu (#4703)
(cherry picked from commit c87b0e77de)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesPresenter.kt
2021-03-28 19:04:30 -04:00
arkon 4ee110e225 Dismiss action toolbar after download action in updates (closes #4729)
(cherry picked from commit 355d5af8ae)
2021-03-28 19:01:28 -04:00
arkon 26d52f5ad7 Fix fullscreen not applying on opening reader (fixes #4723)
(cherry picked from commit 3d99a8ebdb)
2021-03-28 19:01:19 -04:00
arkon 8b37c27a73 Cleanup reader spinner layouts
(cherry picked from commit c4b975b777)

# Conflicts:
#	app/src/main/res/layout/reader_general_settings.xml
#	app/src/main/res/layout/reader_webtoon_settings.xml
2021-03-28 19:01:08 -04:00
Antoine Gaudreau Simard 6e9043c633 Add onPause\onResume persistence to searchView. Fixes issue #3627 (#4494)
* Add onPause\onResume persistence to searchView. Fixes issue #3627

* New controller subclass with built-in SearchView support

* Implement new SearchableNucleusController in SourceController

* Add query to BasePresenter (for one field it is not worth create a subclass in my opinion), convert BrowseSourceController to inherit from SearchableNucleusController

* move to flows to fix an issue in GlobalSearch where it would trigger the search multiple times

* Continue conversion to SearchableNucleusController

* Convert LibraryController, convert to flows, Known ISSUE with empty string being posted after setting the query upon creation of UI

* Fix issues with the post being tide to the SearchView queue which is not processed until shown. Add COLLAPSING state capture which should wrap this up.

* refactoring & enforce @StringRes for queryHint

(cherry picked from commit 2911fe7a1a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
2021-03-28 18:33:41 -04:00
arkon 2988524fd8 Clean up reader sheet spinner preferences
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/fe2543b9d5da176b1dbb95058d1bfc54400fd47a

Co-Authored-By: Jays2Kings
(cherry picked from commit 14c114756d)

# Conflicts:
#	app/src/main/res/layout/reader_general_settings.xml
#	app/src/main/res/layout/reader_pager_settings.xml
#	app/src/main/res/layout/reader_webtoon_settings.xml
2021-03-28 18:01:39 -04:00
arkon 95c828bed6 Reduce height of sheet when on color filter tab
(cherry picked from commit e7a8107279)
2021-03-28 17:53:35 -04:00
arkon 8721d8c9ec Add tooltips to bottom reader menu items
(cherry picked from commit bff73b1b40)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-03-28 17:53:25 -04:00
arkon 5b9d2175e2 Reorganize reader sheet contents a bit
(cherry picked from commit c255f57d95)

# Conflicts:
#	app/src/main/res/layout/reader_general_settings.xml
2021-03-28 17:49:40 -04:00
arkon 75f0ab2f40 Split general and reading mode sheet settings
(cherry picked from commit 64c47bbaed)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderGeneralSettings.kt
#	app/src/main/res/layout/reader_general_settings.xml
#	app/src/main/res/layout/reader_pager_settings.xml
#	app/src/main/res/layout/reader_webtoon_settings.xml
2021-03-28 17:47:31 -04:00
arkon 709f76d53d Merge reader settings and color filter sheets
Heavily influenced by https://github.com/Jays2Kings/tachiyomiJ2K/commit/fe2543b9d5da176b1dbb95058d1bfc54400fd47a#diff-8f47d7b7b53769ac18c28fe9978140c6bef44709879567acab2c6ef3270cd3a8

(cherry picked from commit e0b7698d40)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/layout/reader_settings_sheet.xml
2021-03-28 17:19:57 -04:00
arkon ac654340d8 Maybe make opening file picker for choosing backup file more reliable
(cherry picked from commit a01792ac9a)
2021-03-28 16:51:40 -04:00
arkon 438f64a358 Use more common MIME type for protobuf
(cherry picked from commit 3ba078f64c)
2021-03-28 16:51:29 -04:00
arkon 41aec8bc96 Show unread entries first when sorting by unread (closes #4711)
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/b212f8233e2d3ceffaddc5fcd1ef884e137dae2a

(cherry picked from commit a16240f123)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
2021-03-28 16:51:17 -04:00
arkon 97342723bf Update plugins
(cherry picked from commit e5a120e778)
2021-03-28 16:50:41 -04:00
Jays2Kings a1cb3afe77 Added Start/Finished Date Support to AniList
Based on https://github.com/Jays2Kings/tachiyomiJ2K/commit/1e3de8a67f239a3126178b95f2b028fbba1e7633

Co-Authored-By: Jays2Kings
(cherry picked from commit 2ba60e9114)
2021-03-28 16:50:33 -04:00
CrepeTF 1165c57ffa Apply vertical seekbar hide logic to ReaderSettingsSheet
(cherry picked from commit 4e8006f329cc87438de9202cf0ac1d0d8ceb203f)
2021-03-22 21:10:23 -04:00
CrepeTF 565f005692 Vertical seekbar options hidden when force horizontal is enabled
(cherry picked from commit 4105d8de5618b4becd724a00070a2c5c43ba9c3c)
2021-03-22 21:07:34 -04:00
Ken Swenson 3a148c73ac Fix migration due to variable shadowing (#4689)
(cherry picked from commit 472ce5a5e4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchController.kt
2021-03-22 20:31:10 -04:00
Jobobby04 12962b3486 Minor cleanup 2021-03-22 20:25:46 -04:00
Jobobby04 75da7dcbdd Update dependancies 2021-03-22 20:11:43 -04:00
Jobobby04 f02e3ae28f More blocking fixes 2021-03-22 20:11:15 -04:00
arkon c6369ed73f Handle null Anilist start dates (fixes #4685)
(cherry picked from commit 99ba84c810)
2021-03-21 00:07:02 -04:00
arkon fae2bd7ab7 Minor code cleanup
(cherry picked from commit 78285bdf37)
2021-03-21 00:06:54 -04:00
Andreas 03912407d5 Add navigation layout overlay (#4683)
* Add navigation layout overlay

* Minor clean up

Destroy animator when done not on start
Move and change pref title
Add summary

(cherry picked from commit 5a7f2684b3)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/values/colors.xml
2021-03-21 00:06:46 -04:00
arkon 879b41e97d Fix chapters list getting updated from wrong thread (fixes #4505)
(cherry picked from commit d912a42249)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-03-21 00:04:17 -04:00
arkon 6c3a957733 Fix Bangumi search null image errors
(cherry picked from commit 6d8c4fb8b1)
2021-03-21 00:02:37 -04:00
arkon 3d7c00c057 Make tapping available extension row prompt install
(cherry picked from commit a63cecbfcb)
2021-03-21 00:02:25 -04:00
arkon 6e1adf6e04 Fix offline restore ignoring manga from not installed sources (fixes #4679)
(cherry picked from commit 4a5bceb4e4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
2021-03-21 00:02:16 -04:00
arkon 23091cf50a Update AGP
(cherry picked from commit 86541445b7)
2021-03-21 00:01:11 -04:00
Ken Swenson 78d49b0742 Implement migration for source search (#4657)
(cherry picked from commit b6e6f490e9)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
2021-03-20 15:40:14 -04:00
scb261 30250e350f Limit query for recent chapters to 500 (#4678)
(cherry picked from commit 2145e878a4)
2021-03-20 14:57:30 -04:00
CrepeTF d9b3b7b266 Add option to force disable vertical seekbar
(cherry picked from commit b5df33bf14d4eea8421d2e1e6b488b79e6daa9f5)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/exh/log/Logging.kt
2021-03-20 14:56:51 -04:00
Jobobby04 5558790e15 Fix Sync Favorites 2021-03-19 15:16:42 -04:00
Jobobby04 a1a9b4b812 Lint 2021-03-18 21:55:25 -04:00
Jobobby04 aac2fcb7d4 Catch more mangadex exceptions 2021-03-18 19:48:06 -04:00
KokaKiwi 69ddd04256 [SKIP CI] Update README.md (#4667)
Fix link to Code of Conduct.

(cherry picked from commit 355f6db255)
2021-03-18 17:16:01 -04:00
Jobobby04 7624abbebd Close mangadex login response body 2021-03-18 17:11:28 -04:00
Jobobby04 67310ada53 Move depercated logging to the bottom of the file 2021-03-18 17:06:19 -04:00
Jobobby04 aa73670d50 Fix MDList not getting max chapter/marked as completed 2021-03-18 17:05:18 -04:00
Soitora 2bde782211 [SKIP CI] Add Code of Conduct (#4665)
* Add Code of Conduct

* Update badge section

* Add Code of Conduct link to README

* Change to relative links

(cherry picked from commit bc7632bf02)

# Conflicts:
#	README.md
2021-03-18 15:42:07 -04:00
arkon 7b01f0c608 Add icons for reading mode toggle
(cherry picked from commit 609d8c9685)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
#	app/src/main/res/layout/reader_activity.xml
2021-03-18 15:40:12 -04:00
arkon 781f4e393e Less janky enum iteration
(cherry picked from commit 2f08515455)
2021-03-18 15:36:26 -04:00
scb261 93c92b674d Use fetch date instead of upload date when querying recent chapters (#4645)
(cherry picked from commit 7f450e185d)
2021-03-18 15:36:17 -04:00
arkon 368f565942 Remove __cfduid cookie check
As per email:

Cloudflare is deprecating the __cfduid cookie and the cf-request-id headers. The __cfduid cookie will be removed on 10 May 2021 and the cf-request-id headers will be removed on 1 July. We expect that most customers will not have to take action as a result of this removal. [...] Starting on 10 May 2021, we will stop adding a “Set-Cookie” header on all HTTP responses. The last __cfduid cookies will expire 30 days after that.

(cherry picked from commit 747879b4ec)
2021-03-18 15:36:08 -04:00
Riztard Lanthorn 01c298bbc1 Library update freq: add 4 & 8 hours (#4557)
(cherry picked from commit 4193870fa6)
2021-03-18 15:36:01 -04:00
arkon 1399042efb Flip order of previous chapter reader transition text (closes #4608)
(cherry picked from commit cdc5de3f1b)
2021-03-18 15:35:50 -04:00
arkon b2bfccdeae Round snackbar corners
(cherry picked from commit bc34d4fa88)
2021-03-18 15:35:41 -04:00
arkon 0d46e00b31 Adjust reader navigation button ripples
(cherry picked from commit 6fd4af8736)
2021-03-18 15:35:33 -04:00
arkon 9aca115977 Refactor LibraryUpdateService a bit for future changes
(cherry picked from commit b5c2934270)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-03-18 15:35:21 -04:00
arkon e31e71ad44 Remove online protobuf backup restore option
(cherry picked from commit 94f5117941)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
2021-03-18 15:20:30 -04:00
arkon df950219f5 Use Material dialogs for preferences
Partially addresses #2907

(cherry picked from commit 112e233498)
2021-03-18 15:11:13 -04:00
arkon 23e4b661bc Tweak dialog corner radius
(cherry picked from commit 18b1326f3a)
2021-03-18 15:11:02 -04:00
arkon 7164f686d4 Add reading mode toggle
(cherry picked from commit 1e58b05ead)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/res/layout/reader_activity.xml
2021-03-18 15:10:53 -04:00
arkon 3122f783a9 Move reader setting related classes
(cherry picked from commit 938919bd9b)
2021-03-18 14:55:52 -04:00
arkon 6be8e2de3c Move clear history from advanced settings to history screen menu (closes #4613)
(cherry picked from commit b6b78994d8)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt
2021-03-18 14:55:42 -04:00
arkon c092127404 Add "my" locale
(cherry picked from commit fddd8ce305)
2021-03-18 14:54:03 -04:00
Jozef Hollý e7dd5f3c25 Weblate translations (#4461)
Co-authored-by: Adaś <adam.prosniak@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Aung Myint Myat Oo <solidifyarmor@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Bail Adnan Farid <fks7dev@gmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Cream π <f.t.nayeem014@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: Eugene <eugcheung94@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Habibur Rahman <habiburr016@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: Iuri Jikidze <ijiki16@freeuni.edu.ge>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jimly Asshiddiqy <j_mly@ymail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Murat Topuz <mrt_tpz@outlook.com>
Co-authored-by: Murilo Simionato Arnemann <murilo2110@hotmail.com>
Co-authored-by: Nick Koroghlishvili <n.koroglishvili5@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rocco Casadei <roccobot@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Ryota Hasegawa <unkchn123456@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Yasin Chamsoy <tristeroni@gmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: dmswd <Bmswad1@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 赤城 悠 <hapipon815@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/bg/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/bn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fa/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ka/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ko/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/my/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uz/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Adaś <adam.prosniak@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Aung Myint Myat Oo <solidifyarmor@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Bail Adnan Farid <fks7dev@gmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Cream π <f.t.nayeem014@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <e.shlyapkin99@gmail.com>
Co-authored-by: Eugene <eugcheung94@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Habibur Rahman <habiburr016@gmail.com>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: Iuri Jikidze <ijiki16@freeuni.edu.ge>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jimly Asshiddiqy <j_mly@ymail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Murat Topuz <mrt_tpz@outlook.com>
Co-authored-by: Murilo Simionato Arnemann <murilo2110@hotmail.com>
Co-authored-by: Nick Koroghlishvili <n.koroglishvili5@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rocco Casadei <roccobot@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Ryota Hasegawa <unkchn123456@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Yasin Chamsoy <tristeroni@gmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: dmswd <Bmswad1@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 赤城 悠 <hapipon815@gmail.com>
(cherry picked from commit ccff337975)
2021-03-18 14:53:54 -04:00
arkon 142fc0e4a6 Disable sensor when using force orientation (closes #4618)
(cherry picked from commit fde6b7af4f)
2021-03-18 14:53:41 -04:00
arkon 300e04e8f6 Allow scrolling within reader color filter sheet (fixes #4612)
(cherry picked from commit 0657db7dcb)
2021-03-18 14:53:30 -04:00
Soitora 07f684ac9e Update URL for Local Manga guide (#4641)
(cherry picked from commit d1c2eaf6d5)
2021-03-18 14:52:54 -04:00
arkon 6840382df2 Dependency updates
(cherry picked from commit 91bb6b9016)
2021-03-18 14:52:29 -04:00
Jobobby04 c7b6216d24 Fix recursive call 2021-03-13 11:59:14 -05:00
Jobobby04 a989426d95 Sync Follows sync status choice 2021-03-12 18:22:21 -05:00
Jobobby04 d255ee805b Mdlist only set the status to reading if Unfollowed 2021-03-12 10:02:47 -05:00
Jobobby04 21240cad06 Cleanup 2021-03-11 22:39:46 -05:00
Jobobby04 5b8b10a96b Fix full backup restore locking up 2021-03-11 22:39:18 -05:00
Jobobby04 c600d45e84 Maybe fix EHentai dupes in browse issue 2021-03-11 22:39:17 -05:00
Jobobby04 e9fd6ab470 Revert "Experimental Backup Restore fix"
This reverts commit 3d507600cb.
2021-03-11 19:44:36 -05:00
Jobobby04 3d507600cb Experimental Backup Restore fix 2021-03-11 19:10:34 -05:00
Jobobby04 84abe044a3 Remove Hentai Cafe Delegation 2021-03-11 19:10:33 -05:00
Jobobby04 04200bb590 Cleanup 2021-03-11 19:10:33 -05:00
Jobobby04 42d49b7cba Log tracking errors 2021-03-11 19:10:32 -05:00
Jobobby04 5dace4fd74 Fix Mangadex Login, Fix Mangadex tracking, Set Mangadex track status to Reading on tracked 2021-03-11 19:10:32 -05:00
Jobobby04 ccdae6bb9a Deprecate throwable logging function, produces bad log 2021-03-11 19:10:31 -05:00
Jobobby04 984956ce95 Fix vertical reader scrollbar buttons cutoff 2021-03-11 19:10:31 -05:00
Jobobby04 0fd9b2a8f6 Fix migration not running sometimes 2021-03-11 19:10:31 -05:00
OncePunchedMan 39f4949189 Tweak "Hot Pink" theme (#239)
* fix backdrop

* remove unused line
2021-03-11 14:32:05 -05:00
OncePunchedMan f7d52e0372 Added "Hot Pink" theme (#238)
* first test

* added hot pink theme

* moved string to correct place
2021-03-10 19:28:07 -05:00
Riztard Lanthorn 6cad8411fe swap webview and filter (#235) 2021-03-08 22:44:31 -05:00
arkon f35abccfd9 Revert to core-ktx:1.5.0-beta01
Fixes bottom reader menu from being hidden behind navbar on Android 5.0.

(cherry picked from commit 90351c6e9e)
2021-03-07 23:21:37 -05:00
Jobobby04 f3573d16b4 Fix #154.6, downloading a merge in the library will properly download 2021-03-07 23:17:43 -05:00
Jobobby04 e6f288e2c9 Fix some cherry pick issues 2021-03-07 22:33:38 -05:00
arkon 833bd6e655 Automatically reopen issues when valid
(cherry picked from commit dd4740e54f)
2021-03-07 13:40:17 -05:00
inorichi 4a30c68cfc Fix a decoder crash with RAR files
(cherry picked from commit 48e7cbd76c)
2021-03-07 13:40:02 -05:00
arkon 346bd5f57a Hide subtitle in migration list of sources if no language set (i.e. uninstalled source)
(cherry picked from commit ae42f59102)
2021-03-07 13:39:41 -05:00
arkon c2e3b4d35a AndroidX dependency updates
(cherry picked from commit aa5861d3ca)
2021-03-07 13:38:41 -05:00
Andreas 1fdb03f7db Dual page split allow to have different setting for Paged and Webtoon (#4527)
(cherry picked from commit 7a64bf55cb)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt
2021-03-07 13:38:17 -05:00
Jobobby04 da3681e602 Dont throw a exception if the request fails for mdlist tracking 2021-03-07 13:04:53 -05:00
Jobobby04 d64a8907eb Many small changes
- Remove unused gridlayout dependency
- Add RECIEVE_BOOT permission for EH updater
- Some suspending db IO calls
2021-03-07 02:47:48 -05:00
Jobobby04 7e91ae02f1 Upgrade logging, now maps timber to XLog, new logging functions 2021-03-07 00:23:23 -05:00
Jobobby04 9457b832fc Surface errors when saving/sharing covers 2021-03-04 19:10:08 -05:00
Jobobby04 d0561705fe Clear db now has a option to keep read manga 2021-03-04 19:10:07 -05:00
Jobobby04 3601968342 Cleanup data saver 2021-03-04 19:10:07 -05:00
Jobobby04 fa2cde79ba Add errors to browse + latest 2021-03-04 19:10:06 -05:00
Jobobby04 1827fe0ce1 Fix merged manga library download button trying to download from localsource 2021-03-04 19:10:06 -05:00
Jobobby04 3447e0c237 Custom status fix for clean titles 2021-03-04 19:10:05 -05:00
Jobobby04 4f9ae9cc75 Fix clear db not effecting merged manga 2021-03-04 19:10:05 -05:00
Jobobby04 cd1c6cbc89 Add manga with pages read to backup 2021-03-04 19:10:04 -05:00
Jobobby04 66cd4c9b40 Move custom theme strings to strings_sy 2021-03-04 19:10:04 -05:00
CrepeTF 2e1cf49d99 Reader PR (with vertical sidebar) (#216)
* Reader PR

* Dealt with conflicts + updates

* Adeed missing import
2021-03-04 19:08:40 -05:00
curche 0c150694e7 Change Reader settings layout (#231)
* Change Reader settings layout

This commit changes the way the Reader settings are displayed. The
fork specific settings for the reader have been moved to the bottom
instead of being sandwiched between settings from the main app.
Makes it look a better organised now

* restore Cts Vertical to before in Reader settings

the current layout of the Reader settings is thus
  - Reader/Defaults/Meta
  - Display
  - Reading
  - Paged
  - Webtoon
  - Continuous vertical
  - Navigation
  - Fork Settings

Changes made based on review at PR https://github.com/jobobby04/TachiyomiSY/pull/231
2021-02-28 13:33:29 -05:00
scb261 a4c10394b6 Split transition animation setting for webtoon and pager (#230)
* Split transition animation setting for webtoon and pager

* Move variables

* Rename config variables back
2021-02-26 14:51:51 -05:00
curche f78836dac4 Change Similar manga settings layout (#228)
* convert Credit string to strings_sy element

* remove redundant similar screen title in Similar Manga settings
2021-02-25 14:52:44 -05:00
Eugene c88de1ab1b Russian localization (#215)
* Russian localization

* Delete "translatable"

* almost not translated

* more fix

* fix 2

* add and fix 3

* fix 4

* Move Themes and rolback strings main
2021-02-24 18:07:55 -05:00
Jobobby04 9694c8310c Make sure some toasts are used in the main thread 2021-02-24 17:26:08 -05:00
inorichi 1b09eecfce Fix a decoder crash
(cherry picked from commit d4c9ab793f)
2021-02-24 17:16:12 -05:00
inorichi 853e8faec5 Support CMYK and YCCK JPEGs and fix bad PNG cropping
(cherry picked from commit 48d2849d97)
2021-02-24 17:16:05 -05:00
Andreas cfd2d43f1c Let users invert dual page split (#4470)
* Let users invert dual page split

* Use Activity lifecycleScope and cleanup invert logic

(cherry picked from commit 776610d0e6)
2021-02-24 17:15:44 -05:00
Andreas 1d3542b648 Add Right and Left to reader settings (#4489)
* Add Right and Left to settings

* Fix whoopsie and minor tweak to how the array is fetched

(cherry picked from commit 3a790f3d66)
2021-02-24 17:15:33 -05:00
arkon 6dc7b9de92 Add Twitter link to About section
(cherry picked from commit 7382042288)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2021-02-24 17:15:23 -05:00
arkon 48a63e26f3 Add orientation toggle to bottom reader menu (not really)
(cherry picked from commit 33992d80bf)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt
#	app/src/main/res/layout/reader_activity.xml
2021-02-24 17:12:14 -05:00
arkon 33b1c93949 Reword bookmark strings to clarify it's for a chapter, not a page
(cherry picked from commit a92b0e567b)
2021-02-24 17:02:44 -05:00
arkon 7a115d8080 Adjust reader seekbar design
- Revert back to old prev/next chapter icons
- Make views taller for easier actions
- Use more consistent spacing
- Add ripples to prev/next chapter buttons

(cherry picked from commit 829a65e515)
2021-02-24 17:02:12 -05:00
arkon 9be7c5e6e1 Initial adoption of bottom reader menus from TachiyomiSY
Co-authored-by: Jobobby04 <jobobby04@users.noreply.github.com>
Co-authored-by: CrepeTF <CrepeTF@users.noreply.github.com>
(cherry picked from commit 89837e4ced)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/menu/reader.xml
2021-02-24 17:02:03 -05:00
arkon e38d1dfdc4 [SKIP CI] Add instructions on how to get crash logs in issue templates
(cherry picked from commit 03ad48c055)
2021-02-24 16:45:17 -05:00
arkon f1f993bf38 Rename drawable with more consistent naming
(cherry picked from commit ace1db21d1)
2021-02-24 16:44:46 -05:00
arkon 2845d8cc98 Allow clicking the toolbar to go to the manga
Co-authored-by: Jobobby04 <jobobby04@users.noreply.github.com>
(cherry picked from commit 8bb69c455b)
2021-02-24 16:44:20 -05:00
Jobobby04 0185d5f7d6 Fixes for browse + latest page 2021-02-24 16:18:13 -05:00
Jobobby04 079ca1d0b3 Small cleanup 2021-02-24 16:16:47 -05:00
Jobobby04 5a67d8169d Edit manga status + edit local manga fixes 2021-02-24 16:15:19 -05:00
Jobobby04 f1cb4c38a2 Fix Hentai Cafe and 8Muses with the new split extension 2021-02-15 19:35:50 -05:00
Jobobby04 50a5ec45b3 Do a bit of optimization and cleanup, remove old EH startup code 2021-02-14 21:24:26 -05:00
Jobobby04 f76216c038 Revert Jdk 11 update 2021-02-12 20:06:07 -05:00
arkon d55692dc0d [SKIP CI] Update to issue-closer-action@v2.0
(cherry picked from commit f4dd150b70)
2021-02-12 19:50:42 -05:00
arkon ded8f15913 Switch back to new image decoder for preview builds
(cherry picked from commit 2b35d22e25)
2021-02-12 19:50:31 -05:00
Jobobby04 845dbbfa1e Revert "Hide dedupe by priority"
This reverts commit 1a12caa487.
2021-02-12 19:49:51 -05:00
Jobobby04 d3416a4df5 Release 1.5.0 2021-02-12 19:49:07 -05:00
Jobobby04 1a12caa487 Hide dedupe by priority
(cherry picked from commit 2cf0475066)
2021-02-12 19:25:38 -05:00
arkon 72b7dc805c Avoid crash when source list is animating
(cherry picked from commit 2dae706198)
2021-02-12 18:54:29 -05:00
arkon 8029ff8ecc Avoid rare crashes in settings search for ListPreferences
(cherry picked from commit 3eda2a220a)
2021-02-12 18:54:21 -05:00
arkon cd8543d40b Avoid crash when device fails to handle opening a URL
(cherry picked from commit 61e5440b7c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/WhatsNewDialogController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2021-02-12 18:54:09 -05:00
arkon 7d1fd9f0bb Avoid crash if activity is already dead
(cherry picked from commit 2e2663bad9)
2021-02-12 18:41:31 -05:00
arkon fd65aa8fe4 Switch to stable image decoder
(cherry picked from commit f590378761)

# Conflicts:
#	.github/ISSUE_TEMPLATE.md
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/ISSUE_TEMPLATE/feature_request.md
#	app/build.gradle.kts
2021-02-12 18:41:16 -05:00
arkon 0f349da3bc Require minimum WebView v88, try to catch fatal errors too
(cherry picked from commit f5f592be91)
2021-02-12 18:40:12 -05:00
arkon 33d0507f98 Minor download icon optimizations
(cherry picked from commit 7a373fb43a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-02-12 18:40:02 -05:00
arkon 16f9ca381e Make backup restoring logic more sequential
(cherry picked from commit aded11e599)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupRestore.kt
2021-02-12 18:37:19 -05:00
arkon 2ff186eaec Remove ExperimentalSerializationApi opt-in annotations
(cherry picked from commit 41d7cee020)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
2021-02-12 16:31:23 -05:00
Jozef Hollý f3678e3fd3 Weblate translations (#4378)
Co-authored-by: Adaś <adam.prosniak@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Cream π <f.t.nayeem014@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <eugcheung94@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Habibur Rahman <habiburr016@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: Iuri Jikidze <ijiki16@freeuni.edu.ge>
Co-authored-by: Jimly Asshiddiqy <j_mly@ymail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Murilo Simionato Arnemann <murilo2110@hotmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rocco Casadei <roccobot@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 赤城 悠 <hapipon815@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/bn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ka/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Adaś <adam.prosniak@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Cream π <f.t.nayeem014@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Eugene <eugcheung94@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Habibur Rahman <habiburr016@gmail.com>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: Iuri Jikidze <ijiki16@freeuni.edu.ge>
Co-authored-by: Jimly Asshiddiqy <j_mly@ymail.com>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Michalis <michalisntovas@yahoo.gr>
Co-authored-by: Murilo Simionato Arnemann <murilo2110@hotmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rocco Casadei <roccobot@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Co-authored-by: 赤城 悠 <hapipon815@gmail.com>
(cherry picked from commit f2ef6a20e6)
2021-02-12 16:30:29 -05:00
arkon c29690282c Handle link for multisource extension commits (closes #4432)
(cherry picked from commit a398c3fb81)
2021-02-11 19:27:23 -05:00
arkon f93d21774f Adjust some scopes
(cherry picked from commit 2a454b44cc)
2021-02-11 19:27:15 -05:00
Jobobby04 efe0d9de05 Cleanup 2021-02-11 19:27:10 -05:00
arkon 04da26195e Fix invisible overflow icon in chapter filter sheet in light blue theme
(cherry picked from commit 7b66ece895)
2021-02-11 19:26:46 -05:00
Jobobby04 e8e7f96be5 Add monthly to SY strings 2021-02-11 19:26:17 -05:00
vance 37ce2140f3 Added dual page split setting (#4252)
* Add DualPageSplit option

* remove extra line

* Split double-page into two pages

* Remove !isAnimated check and add (ALPHA) to the label

* Fix missing insert pages

* Pager cleanup

* Add dual split to Webtoon and fix Vertical

* Fix L2R/R2L

* Add comments and refactor code in ImageUtil

* Use a simpler split solution in webtoon mode

Co-authored-by: weng <>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
(cherry picked from commit b5017eebbf)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt
2021-02-11 19:25:58 -05:00
arkon c5ef58ac72 Add weekly to library update frequency options (closes #4422)
(cherry picked from commit aa67229daf)
2021-02-11 19:17:57 -05:00
arkon cb1ea6f571 Clean up LibraryUpdateService a bit
(cherry picked from commit 5af68186d6)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-02-11 19:17:44 -05:00
Jobobby04 a207b4b729 Fix build after AboutLibraries update 2021-02-11 19:12:50 -05:00
arkon e9ec281159 Open manga when clicking thumbnail in migration list (closes #4152)
(cherry picked from commit 545bc0e605)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaPresenter.kt
2021-02-11 19:12:23 -05:00
arkon ede6a54b30 Remove unnecessary LayoutContainer implementations
(cherry picked from commit 291168f4de)
2021-02-11 18:13:41 -05:00
arkon 79770a9deb Add action to directly share crash log file from notification
(cherry picked from commit 9facb51f22)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt
2021-02-11 18:13:32 -05:00
arkon 197083e437 Show locales in list of sources to migrate
(cherry picked from commit 5b7d8c5e37)
2021-02-11 18:12:39 -05:00
arkon f8da1fba7d Update AboutLibraries
(cherry picked from commit 5945937e4b)
2021-02-11 18:12:32 -05:00
Jobobby04 56ead63798 Fix legacy backups
(cherry picked from commit ded58541f5)
(cherry picked from commit 9f9f9872eb)
2021-02-11 18:12:24 -05:00
arkon 7d81d812bc Revert attempt to programmatically determine user agent string; fallback to Edge
(cherry picked from commit 3566072f4a)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt
2021-02-11 18:12:14 -05:00
arkon e25991544e Add Esperanto locale
(cherry picked from commit b85cd86b24)
2021-02-11 18:11:27 -05:00
arkon f91837a019 Chapter backup optimization
From https://github.com/jobobby04/TachiyomiSY/commit/fc6d9aaf519ce8830d3b45fd704b32e37f3f786f#diff-9872ccc3c9af14d2872ec99199409e60a11cb754ab23e733b1d45843778f7c95R24

(cherry picked from commit 79c3767fff)
2021-02-11 18:11:14 -05:00
arkon 14db2351c6 Massage user agent string from WebView a bit more
(cherry picked from commit cf1609a429)
2021-02-11 18:11:05 -05:00
arkon a616193cdf Fix selected tab in sheets not being the accent color
(cherry picked from commit 3aeac7e7b5)
2021-02-11 18:10:58 -05:00
arkon 72b0fcca9d Don't restrict filter sheet height anymore
(cherry picked from commit 1557f713f4)
2021-02-11 18:10:49 -05:00
Andreas d4de925ec7 Add Right and Left navigation (#4392)
and remove default navigation classes in favor of the navigation classes

(cherry picked from commit b63d24ac1a)
2021-02-11 18:10:37 -05:00
arkon b6c7e96ddc Avoid some unnecessary re-renderings of download icons
(cherry picked from commit 348c1ff29d)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-02-11 18:10:28 -05:00
arkon c5b5c8c21d Fix downloads getting deleted when marked as unread
(cherry picked from commit 717e55497f)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-02-11 18:09:44 -05:00
Jobobby04 0ab28fd6d6 Remove useless var shadow 2021-02-11 18:08:30 -05:00
Jobobby04 7b5dd4fed4 Cleanup SyncFollows 2021-02-11 18:08:13 -05:00
Jobobby04 4896f3d16c Allow MDList tracking for all manga 2021-02-11 17:55:43 -05:00
Jobobby04 eb5469d362 Get MDList working with merged manga 2021-02-11 17:02:48 -05:00
Jobobby04 227de5d838 Separate MDList from Mangadex manga, allowing it to be used with other sources(not implemented) 2021-02-11 16:41:23 -05:00
Jobobby04 86c228243d Fix merged manga chapterlist not updating, fix merge chapter downloads 2021-02-10 16:39:11 -05:00
Carlos 88690008f7 use super high quality on mangaplus
(cherry picked from commit 2074fbc192b9cfe9475643583d3d77f3cd9e4b4c)
2021-02-07 23:39:51 -05:00
Carlos 4388e7bc3a fix more descriptions
(cherry picked from commit 2f69b74f3429ab94aaee0e55eefbb64047a9737c)
2021-02-07 23:39:41 -05:00
Jobobby04 ded58541f5 Fix legacy backups 2021-02-07 21:54:26 -05:00
arkon aadfa2aa8c Show help action when source fails to load
(cherry picked from commit d84b5e8b46)
2021-02-06 19:16:11 -05:00
arkon e63b15a133 Use AndroidX version of ContextThemeWrapper
(cherry picked from commit 5f9ddf9ff5)
2021-02-06 19:16:02 -05:00
arkon 84590688be Remove some logic around old legacy backup versions + minor optimizations
(cherry picked from commit bbee093c63)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupManager.kt
2021-02-06 19:15:48 -05:00
arkon 2270d3d8e3 Do a regular return to cancel update jobs instead of throwing an exception
(cherry picked from commit e8c35ae4e1)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-02-06 19:14:25 -05:00
arkon bc9602a0f2 Set clip data when sharing content URIs (closes #4198)
(cherry picked from commit 1607658c30)
2021-02-06 19:11:26 -05:00
arkon bd8084c565 Minor optimizations for restoring full backups
Based on https://github.com/jobobby04/TachiyomiSY/commit/fc6d9aaf519ce8830d3b45fd704b32e37f3f786f

(cherry picked from commit 2e9ef373f3)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupManager.kt
2021-02-06 19:11:13 -05:00
arkon 6be485ea79 Switch back to new image decoder for preview builds
(cherry picked from commit ec6eef6d37)

# Conflicts:
#	app/build.gradle.kts
2021-02-06 19:09:43 -05:00
arkon e80a4bea18 Avoid crash when changing spinner indeterminate state
(cherry picked from commit 7191552126)
2021-02-06 19:08:20 -05:00
arkon 73a1c27dd9 Update dependencies
(cherry picked from commit cfa07490e5)

# Conflicts:
#	build.gradle.kts
2021-02-06 19:08:07 -05:00
arkon eb2ceebeeb Update to Gradle 6.8.2
(cherry picked from commit ae40990eb9)

# Conflicts:
#	gradle/wrapper/gradle-wrapper.jar
2021-02-06 19:06:58 -05:00
Jobobby04 d7eac12eee Use some core ktx 2021-02-06 19:02:35 -05:00
Jobobby04 e633da5567 Backup read manga that are not in library 2021-02-06 18:59:40 -05:00
Jobobby04 e26ab22e41 Update manga from differernt sources in parallel 2021-02-04 19:05:35 -05:00
arkon 9a3faad499 Fix unreadable sheet tab text in light blue theme
(cherry picked from commit 9f2fe33ce0)
2021-02-04 17:13:11 -05:00
arkon c635d72b30 Remove buildSrc module's dependency on JCenter
(cherry picked from commit 33660de6b1)

# Conflicts:
#	build.gradle.kts
2021-02-04 17:12:06 -05:00
arkon 15b826074f Don't automatically set MAL start date (closes #4349)
(cherry picked from commit 13d25e0849)
2021-02-04 17:07:56 -05:00
arkon b235521dd1 Rounded bottom sheets
(cherry picked from commit 6662e2002f)
2021-02-04 17:07:39 -05:00
Jobobby04 fc6d9aaf51 Restore offline optimization
Should make restore offline faster when data is already there
2021-02-04 17:06:28 -05:00
Jobobby04 e629703afd Build fix 2021-01-31 19:39:11 -05:00
arkon 24d5d5737e Remove strings that shouldn't have been translated
(cherry picked from commit d4081dc899)
2021-01-31 19:38:53 -05:00
arkon 6168dadba3 Pad trackers list a bit
(cherry picked from commit 62dffb8226)
2021-01-31 19:38:45 -05:00
Jozef Hollý a0c9418174 Weblate translations (#4346)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Byron Vanstien <byronvanstien@rocketmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nestor A. Sanchez <help.toastcode@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tantia <ilovechocobi@yahoo.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/eo/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es_419/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hu/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ko/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ro/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: Byron Vanstien <byronvanstien@rocketmail.com>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Flamm <robindevaux25@gmail.com>
Co-authored-by: Lyfja <yassinelaoud@gmail.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nestor A. Sanchez <help.toastcode@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tantia <ilovechocobi@yahoo.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit cb6aa18480)
2021-01-31 19:38:37 -05:00
arkon 08bf113dcb Minor cleanup
(cherry picked from commit d5cfbef42b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-01-31 19:38:27 -05:00
Andreas 369e075ed9 Move tracking to a bottom sheet (#4364)
* Move tracking to a bottom sheet

* Give methods better names and remove unnecessary annotation

(cherry picked from commit 535abcbb8b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt
2021-01-31 19:36:22 -05:00
Jobobby04 7bb4191d41 Maybe fix merge chapter downloads 2021-01-31 18:33:56 -05:00
Unlocked 8539d5b4db Add manga count to the library header (#3884)
* Add manga count to the library header

* Make showing the number of manga configurable

Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit c34b548a3e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
2021-01-31 18:33:22 -05:00
Taco f8763c71ff Regenerate drawables (#4352)
(cherry picked from commit 9bf452856c)
2021-01-31 18:32:13 -05:00
arkon 925ecb282c Handle failures when updating metadata in library updater
(cherry picked from commit 17109ab760)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-01-31 18:31:53 -05:00
arkon 675d6e95d3 Remove unused dimen values
(cherry picked from commit 6bc6e1a1d1)
2021-01-31 18:30:25 -05:00
Jobobby04 0ccfca51e7 Fix weirdly aligned merge button 2021-01-30 01:47:32 -05:00
Jobobby04 284a456184 Handle failures in the library updater 2021-01-28 15:04:17 -05:00
arkon 4cbb2ae082 Apply bottom sheet dialog with restriction consistently
(cherry picked from commit 7eef4f7fbf)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt
2021-01-28 14:19:04 -05:00
arkon 466cfd82c9 Update AndroidX dependencies
(cherry picked from commit 75bec6a8e3)
2021-01-28 13:41:10 -05:00
Andreas 9cb600e9d6 Unify history and update item (#4361)
* Unify history and update item

* Use card_radius

(cherry picked from commit 0a10f66053)
2021-01-28 13:41:01 -05:00
arkon 4f50fcadeb Ignore failures when updating metadata as part of library update
(cherry picked from commit 58860b51a2)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-01-28 13:40:25 -05:00
Jobobby04 1eb8ee502e Optimize imports 2021-01-26 23:47:44 -05:00
Jobobby04 2b845ec01f Cleanup MetadataViewPresenter 2021-01-26 23:47:26 -05:00
Jobobby04 dbadec2c67 Revert "Fix reader bug with new suspend getFlatMetadata"
This reverts commit 9603186927.
2021-01-26 23:36:40 -05:00
Jobobby04 dc6aa11bc7 Revert "Run more db queries inside the IO pool, convert some RxJava references to Coroutines"
This reverts commit 18f02a85ac.

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsEhController.kt
2021-01-26 23:36:03 -05:00
Jobobby04 628eedf15a Remove duplicate raised search metadata code 2021-01-26 23:33:51 -05:00
arkon fcc095ffa3 Add comments to not translate the word "WebView"
(cherry picked from commit 426ed7308b)
2021-01-26 20:36:20 -05:00
Jobobby04 4a86f39a40 Handle blank NHentai Scanlator 2021-01-26 20:31:44 -05:00
Jobobby04 9603186927 Fix reader bug with new suspend getFlatMetadata 2021-01-26 20:31:04 -05:00
Jobobby04 5d600166ea Move EnhancedSource helper functions to SourceHelpers 2021-01-26 20:26:31 -05:00
arkon 2e580cfb55 Address unit test compilation errors
They don't actually run since they broke a long time ago (AndroidX + Roboelectric issues?), but it addresses the annoying red squigglies in Android Studio at least.

(cherry picked from commit 0ecfef3f70)
2021-01-26 16:11:25 -05:00
Taco ec1fe205ad Update Okio, use more KTX stuff (#4353)
* Update Okio to 2.10.0

* Use some more KTX extensions

(cherry picked from commit 5f7e34b6a1)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/CategoryTypeMapping.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/MangaTypeMapping.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaFavoritePutResolver.kt
2021-01-26 16:11:02 -05:00
arkon 9a70f25552 Update total number of chapters when refreshing MAL entries (fixes #4348)
(cherry picked from commit 34cb24fe34)
2021-01-26 15:51:27 -05:00
arkon 78fbef637c Parse correct object when finding existing MAL list item (fixes #4347)
(cherry picked from commit 1490112135)
2021-01-26 15:51:17 -05:00
arkon 26385c9225 Fix cancelling library updates not working
(cherry picked from commit c4716a3f4c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-01-26 15:51:09 -05:00
arkon deaefe8fa6 Refactor tracker name strings
(cherry picked from commit 0a54901eb0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
2021-01-26 15:48:36 -05:00
Jobobby04 fbc041846b Fix track filter for Mangadex unfollowed 2021-01-26 15:26:35 -05:00
Andreas a2aad23eae Extend track filter (#4344)
* Allow to filter for each tracker logged in

* Simplify filter logic

* Use variable names instead of it

and rename variables

* Change how trackFilters and items are setup

* Use variable name instead of it and try cleanup filterFnTracking

* Changes from feedback

(cherry picked from commit fea2e0a265)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
2021-01-26 15:26:16 -05:00
Jozef Hollý 1619282e19 Weblate translations (#4204)
Co-authored-by: ARiyou Jahan <AR.Jahan2000@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Ciavola Pennelli <loxli91@gmail.com>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alessandro Zangrandi <alessandro@mzit.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Jozef Hollý <j2.00ghz@gmail.com>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Redya Rachmandanu <redyarachmandanu@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Sl3iN <fddf.ddrf2015@ya.ru>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Woodyx <shiposhouyou@gmail.com>
Co-authored-by: Yassin <yassinelaoud@gmail.com>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: arkon <eugcheung94@gmail.com>
Co-authored-by: waquack <idragonus@gmail.com>
Co-authored-by: Николаев Дмитрий <nikolaevddv@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cs/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fa/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hu/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sah/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: ARiyou Jahan <AR.Jahan2000@gmail.com>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Ciavola Pennelli <loxli91@gmail.com>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alessandro Zangrandi <alessandro@mzit.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: Marco Santos <enum.scima@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Redya Rachmandanu <redyarachmandanu@gmail.com>
Co-authored-by: Samuel Carvalho de Araújo <samuelnegro12345@gmail.com>
Co-authored-by: Sl3iN <fddf.ddrf2015@ya.ru>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Woodyx <shiposhouyou@gmail.com>
Co-authored-by: Yassin <yassinelaoud@gmail.com>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: arkon <eugcheung94@gmail.com>
Co-authored-by: waquack <idragonus@gmail.com>
Co-authored-by: Николаев Дмитрий <nikolaevddv@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit d3c087375b)
2021-01-26 14:19:40 -05:00
arkon 9320221a4e Minor cleanup
(cherry picked from commit a93c0577ac)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/lang/RxCoroutineBridge.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt
2021-01-26 14:19:29 -05:00
arkon 6fdff1b03b Perform metadata update in global scope
(cherry picked from commit e4dc35674d)
2021-01-26 14:10:24 -05:00
arkon bf7af0c099 Revert async metadata updates to fix lag when updating (fixes #4341)
(cherry picked from commit 8a668ba7b9)
2021-01-26 14:10:12 -05:00
arkon ffc628fc97 Update AboutLibraries plugin
(cherry picked from commit 78e8d40649)
2021-01-26 14:09:53 -05:00
arkon 87db322ec6 Remove some unused rx/coroutine bridge code
(cherry picked from commit 660e13b701)
2021-01-26 14:07:20 -05:00
arkon 55f3ade9e7 Extract user agent string from WebView
(cherry picked from commit 0685382083)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt
2021-01-26 14:07:11 -05:00
arkon 788ed6dcc9 Update trackers in parallel, update manga metadata asynchronously
(cherry picked from commit 04a993c997)
2021-01-26 14:06:26 -05:00
arkon dd3b8c7967 Minor dependency updates
(cherry picked from commit 7cae3095c4)
2021-01-26 14:06:17 -05:00
arkon c376699c37 Reword download chapter number sorting options
(cherry picked from commit e288bf902b)
2021-01-26 14:06:07 -05:00
Riztard Lanthorn 8bd5b75fd9 add sort by chapter number in download queue (#4337)
* add sort by chapter number in download queue

* Bigest, smallest chapter download

* grouped

(cherry picked from commit a083e1f71a)
2021-01-26 14:05:59 -05:00
arkon e3ee3159fc Remove usage of RxJava from LibraryUpdateService
(cherry picked from commit 86b9d7e843)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
2021-01-26 14:05:48 -05:00
Riztard Lanthorn 355170b8ff add source name in download queue (#4338)
(cherry picked from commit 628bd5d6b4)
2021-01-26 13:42:21 -05:00
arkon 9fe039ba3f Ignore error when cover is missing in Kitsu search results (fixes #4334)
(cherry picked from commit 00285a782c)
2021-01-26 13:42:12 -05:00
arkon cdd5f3b345 Surface tracking search errors properly
(cherry picked from commit 16be469ecb)
2021-01-26 13:42:03 -05:00
arkon c270a8c51d Add QUERY_ALL_PACKAGES permission (maybe fixes #4313)
(cherry picked from commit fdcbc4cffa)
2021-01-26 13:41:55 -05:00
arkon 80c11a32c2 Remove unused RECEIVE_BOOT_COMPLETED permission
Was originally added for the library check mechanism: https://github.com/tachiyomiorg/tachiyomi/commit/fcb5bf4dd4a75cf9cdeeee82463cf044ef1ed41d

(cherry picked from commit fc548304cf)
2021-01-26 13:41:44 -05:00
arkon fc481e4fd4 Don't stop downloader after deleting downloads if it wasn't running (fixes #4309)
(cherry picked from commit 7c7ff8165e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt
2021-01-26 13:41:33 -05:00
Clarence Castillo 41607ab259 Fix multi-select phantom anchor bug in manga chapters and library (#4201)
* Fix phantom anchor bug in manga chapters list when multi-selecting

* Fix phantom bug when long pressing selected items not at top of stack

* Fix phantom anchor bug in library page

(cherry picked from commit 496a476c13)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-01-26 13:40:43 -05:00
Andreas 3927c62a32 Match color for download, header, and pin buttons (#4331)
* Match download button color to pin color

* Match manga header buttons color to pin color

(cherry picked from commit 441fc6e45b)
2021-01-26 13:38:13 -05:00
Jobobby04 b0981a00bd Fix Reder PR build errors 2021-01-26 13:37:31 -05:00
Jobobby04 295af5306b Handle delegated source id lists better using a LisenterMutableMap
Better source id comparisons
2021-01-26 13:31:22 -05:00
Jobobby04 cf1ce9e069 Search in the regular coroutine scope instead of a custom one 2021-01-26 13:31:21 -05:00
Jobobby04 18f02a85ac Run more db queries inside the IO pool, convert some RxJava references to Coroutines 2021-01-26 13:31:20 -05:00
Jobobby04 64eeab7c5e Use a Enum for genre color 2021-01-26 13:31:18 -05:00
Jobobby04 1e2f4fc35e Cleanup MigrationSource 2021-01-26 13:31:17 -05:00
Jobobby04 a088e1ffc2 Cleanup removeArticals extension function 2021-01-26 13:31:17 -05:00
Jobobby04 0b7f8da84e Cleanup EHentai Description extension 2021-01-26 13:31:14 -05:00
Jobobby04 9f2e582281 Cleanup view extensions 2021-01-26 13:31:14 -05:00
Jobobby04 d63eae4444 Use bundleOf in merge settings dialog 2021-01-26 13:31:13 -05:00
Jobobby04 4552b9f849 Cleanup edit manga info dialog 2021-01-26 13:31:12 -05:00
Jobobby04 02e3b49dc7 Move StringBuilderExtensions to utils 2021-01-26 13:31:12 -05:00
Jobobby04 5c21f7ec30 Fix deprecated Parcelize annotation 2021-01-26 13:31:11 -05:00
Jobobby04 9235f0e5ed Fix similar manga notification channel name 2021-01-26 13:31:10 -05:00
jobobby04 2a211c68a9 Merge pull request #186 from CrepeTF/Reader_PR
Reader PR + stuff
2021-01-26 13:30:25 -05:00
CrepeTF 653ae10caf Reader PR 2021-01-26 13:11:42 -05:00
arkon 9ec67db8cb Use proper method to clear notification actions
(cherry picked from commit cf7ec6aa76)
2021-01-21 19:06:57 -05:00
arkon 4d6bd382e8 Add method for users to save error logs to a file
(cherry picked from commit db2dd4b6c6)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt
2021-01-21 19:06:38 -05:00
arkon 48b713aad5 Update AGP for Android Studio 4.1.2
(cherry picked from commit a68417a0b0)
2021-01-21 18:55:28 -05:00
Jobobby04 677909cd6e Fix compile error 2021-01-21 18:49:37 -05:00
Andreas e0afe65096 Fix Kitsu toasting "Logged in" when there is an error (#4329)
(cherry picked from commit 2a5102a457)
2021-01-21 18:48:51 -05:00
Jobobby04 003e916ab0 Fix app crash if mangadex logout dialog has a issue 2021-01-21 18:46:54 -05:00
arkon 94f0dd8362 Delay restoring AppBar elevation on Android 5.0 (fixes #4311)
(cherry picked from commit 837d8f5f30)
2021-01-21 15:00:13 -05:00
Andreas 2b8a0f2215 Hide tracking when no tracker is logged in and change filter logic (#4310)
* Hide tracking when not logged in

* Change string name and value

(cherry picked from commit 1a5858e99b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
2021-01-21 15:00:06 -05:00
Jobobby04 34f8407983 Fix MangaPlus chapters for MangaDex 2021-01-21 14:47:03 -05:00
Jobobby04 a17c4c151f Cleanup custom info, fix custom genre not saving if you dont edit it 2021-01-20 21:00:58 -05:00
Jobobby04 0a4fcb480d Small cleanup and optimizations, add a coroutine version of insertFlatMetadata 2021-01-20 21:00:23 -05:00
Jobobby04 e6d62dd1dc Support MDList unfollowed for tracking filter 2021-01-17 22:17:37 -05:00
Jobobby04 3b364c91f1 Do quite a bit of code cleanup 2021-01-17 22:17:15 -05:00
arkon 8db57aef6c Add shortcut to see commit history for official extensions
(cherry picked from commit 4044427d93)
2021-01-17 18:04:33 -05:00
arkon 25caba6905 More consistent injectLazy style
(cherry picked from commit f667f85fa5)
2021-01-17 18:04:25 -05:00
Andreas c92c9fada5 Add filter for tracking (#4276)
* Add filter for tracking or not

* Use .any

* Access database only when needed

(cherry picked from commit 5cddc0c387)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
2021-01-17 18:03:57 -05:00
arkon 84a28ddb87 [SKIP CI] Update fork change checklist
(cherry picked from commit cbc01dd6f1)
2021-01-17 17:06:59 -05:00
arkon 3d400981b8 Remove duplicated info from CONTRIBUTING.md
(cherry picked from commit b820c7debf)
2021-01-17 17:06:51 -05:00
arkon 0248e2b5d0 Add list of things to change in forks to CONTRIBUTING.md
(cherry picked from commit 2bee072cba)
2021-01-17 17:06:41 -05:00
arkon 3844615a98 Move CONTRIBUTING.md to top level
(cherry picked from commit 80710b0b94)
2021-01-17 17:06:32 -05:00
arkon a47e88a953 Move ACRA endpoint config to build.gradle.kts
(cherry picked from commit 3319ccfd41)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
2021-01-17 17:06:21 -05:00
arkon 54071507c1 Reimplement MAL start/end date support
(cherry picked from commit 878008e93b)
2021-01-16 19:50:28 -05:00
arkon 7a893e3009 Revert removal of tracker start/end date
(cherry picked from commit 0cd551d4fd)
2021-01-16 19:50:20 -05:00
arkon 70d5907cc8 Handle download cancelation from icon properly (fixes #4241)
(cherry picked from commit f85194ec46)
2021-01-16 19:50:12 -05:00
arkon d5a912bda2 Fix display mode not updating in source view
(cherry picked from commit 271489bdfd)
2021-01-16 19:50:00 -05:00
arkon 3340ca83c6 Update Material Components (fixes #4251)
(cherry picked from commit bd5f22a049)
2021-01-16 19:49:51 -05:00
arkon b6acb3d7f6 Simplify lookup for existing MAL list item
(cherry picked from commit 189f18b112)
2021-01-16 19:49:41 -05:00
arkon 64f6904ddb Update AndroidX dependencies
(cherry picked from commit df166184ea)
2021-01-16 19:49:20 -05:00
Carlos e713340ced switch off kotson for chapter deeplink
(cherry picked from commit 6b545e84aba0d5657a09a8c00735f9f9d4ee28bb)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
#	app/src/main/java/exh/md/handlers/serializers/ApiChapterSerializer.kt
2021-01-15 22:59:37 -05:00
Carlos 5fefefcb23 Mark manga complete on mangadex when all chapters are marked in mdlist
(cherry picked from commit b95cca91fc19fedb42fce895e0a5f062e342dc21)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/track/mdlist/MdList.kt
2021-01-15 22:52:44 -05:00
Carlos 4a268de6dc fix more descriptions
(cherry picked from commit a04a0f534f679a9f908ffaf6f8bcff0018d742be)
2021-01-15 22:38:32 -05:00
Jobobby04 80c7abe098 Fix chapters not updating correctly on mdlist 2021-01-15 22:38:16 -05:00
Jobobby04 37787f040c Mangadex code cleanup 2021-01-15 22:29:57 -05:00
Jobobby04 ae15a178e5 Cleanup 2021-01-15 22:21:10 -05:00
Jobobby04 9465803e5b Cleanup NHentai tags code 2021-01-15 22:20:25 -05:00
Jobobby04 f29ad69534 Remove uneeded preferences from a Mangadex file 2021-01-15 22:18:59 -05:00
Jobobby04 05793d8a60 Remove a uneeded .asObservable call 2021-01-15 22:18:23 -05:00
inorichi 6ea90d982d Fix jpeg decoder when used with high samples
(cherry picked from commit ce42cba096)
2021-01-15 22:17:45 -05:00
Jobobby04 fe5058c94b Fix FAB when going to index controller to browse source controller 2021-01-15 22:06:30 -05:00
Carlos 85425a66a2 fix chapter deeplink
(cherry picked from commit f0dd30587a98c27bca59088f119d85f2fc044f25)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
2021-01-13 19:49:14 -05:00
arkon 7b4311c7dc Show error when trying to download chapters from not installed source (closes #4283)
(cherry picked from commit 9670863a41)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt
2021-01-10 19:38:10 -05:00
arkon d4b0e2869d Update SubsamplingScaleImageView
Merged with upstream master and disabled Jetifier.

(cherry picked from commit 1ae52bd33f)
2021-01-10 19:37:07 -05:00
Jobobby04 a0ac2daad1 Deal with SY for the coroutine function changes 2021-01-10 19:36:24 -05:00
arkon 0edff11353 More coroutine tweaks
(cherry picked from commit c9cf9cfff0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
#	app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/lang/RxCoroutineBridge.kt
2021-01-10 18:43:47 -05:00
arkon c7bedb96a0 Avoid using global scope where appropriate
Also fixes the crash in tracking when an exception is thrown during a refresh.

(cherry picked from commit 2ffbee3db2)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubUpdateChecker.kt
#	app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
2021-01-10 18:25:57 -05:00
inorichi 954573fc33 Fix png artifacts & banding when ratio > 1
(cherry picked from commit 96b8beb9cd)

# Conflicts:
#	app/build.gradle.kts
2021-01-10 18:14:04 -05:00
Jobobby04 cda886ecb3 Unknown source compile fix 2021-01-10 18:12:14 -05:00
Carlos 57c4ead5fb fix a description
(cherry picked from commit c1a603c68bf5a9fb34e2681862e4769e157a5966)
2021-01-10 17:33:07 -05:00
Carlos 3a5182103a fix manga plus entries
(cherry picked from commit 1b5624a601144b4ccdebf379d53a2b4c5f90c2f6)

# Conflicts:
#	app/src/main/java/exh/md/handlers/ApiChapterParser.kt
2021-01-10 17:32:53 -05:00
Carlos 85853b159d fix descriptions
(cherry picked from commit 74a06675d4b42cd700fdbe210cf2e281dfae7d45)
2021-01-10 17:29:43 -05:00
Jobobby04 a04f848ad1 Unknown source error for Deeplink 2021-01-10 17:28:52 -05:00
Jobobby04 73e861ec9e Mangadex replace list of langs with just the source lang 2021-01-10 17:28:20 -05:00
Carlos 6bb7b676bd fix mdlist
(cherry picked from commit ebf5e492ca8dcc6771349b631ebf7661dfbb7d44)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/FollowsHandler.kt
#	app/src/main/java/exh/md/utils/FollowStatus.kt
2021-01-10 17:21:08 -05:00
Jobobby04 33fac3e96b Search manga descriptions 2021-01-10 15:22:47 -05:00
Carlos 35936e3c9a finish transition to api v2
(cherry picked from commit 4039f6927e627279cf1b324279a2d817a007d29b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt
#	app/src/main/java/exh/md/handlers/MangaHandler.kt
#	app/src/main/java/exh/md/utils/MdUtil.kt
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/layout/reader_chapters_sheet.xml
#	app/src/main/res/menu/reader.xml
2021-01-09 16:11:15 -05:00
Jobobby04 7006341fab Cleanup 2021-01-09 15:16:23 -05:00
Jobobby04 4afe227e02 Revert "Request a new image from E-Hentai if it fails to download, should make E-Hentai downloads more relaible"
This reverts commit a21d7f4f90.
2021-01-08 16:24:42 -05:00
Jobobby04 fca7dad7b0 Address coroutine scope leaks for SY 2021-01-07 23:14:08 -05:00
arkon 3683665e8a Address coroutine scope leaks in custom views
(cherry picked from commit 8e613d03e3)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt
2021-01-07 22:29:35 -05:00
arkon a68f18d180 Use lifecycleScope directly
(cherry picked from commit b18a794eca)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
2021-01-07 22:22:27 -05:00
arkon d09406dc29 Revert "Use flows instead of relays for extensions loading"
This reverts commit 07e76f35fa.

(cherry picked from commit c620c924f9)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
2021-01-07 22:12:29 -05:00
Andreas E d41c619c8a Fix navigation from feedback (#4238)
* Fix navigation from feedback (fixes #4237)

* Add additional enum values to NavigationRegion mainly for PagerViewer

Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit 9db81a5a49)
2021-01-07 22:11:24 -05:00
arkon 7330be555d Address more coroutine scope leaks
(cherry picked from commit 6fb7a85e8a)

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
2021-01-07 22:11:14 -05:00
Jobobby04 fd3e0bc449 Import cleanup 2021-01-07 21:56:33 -05:00
inorichi c8dd2190ba Minor fixes regarding leaks
(cherry picked from commit 36f81b4a62)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
2021-01-07 14:27:22 -05:00
arkon 1b41546bc9 Fix crash when no chapters can't be loaded
(cherry picked from commit 2caecc01b2)
2021-01-07 01:14:05 -05:00
inorichi 6da1654825 Fix a crash with the new decoder when cropping borders of an entirely white or black image
(cherry picked from commit dedb8d2d68)

# Conflicts:
#	app/build.gradle.kts
2021-01-07 01:13:58 -05:00
arkon 25e56f3c77 Switch to version of SubsamplingScaleImageView with new image decoder
Courtesy of @inorichi.
Branch: https://github.com/tachiyomiorg/subsampling-scale-image-view/commits/tachiyomi-new-decoder

Decoding speed will be a bit slower now due to two passes if crop borders is enabled, but should be more
reliable on colored images and work for black borders. Memory usage (re: leaks) should also be better.

(cherry picked from commit 762f5bdc33)

# Conflicts:
#	app/build.gradle.kts
2021-01-07 01:13:15 -05:00
arkon fd050b8178 Allow typing in tracker score similar to chapters (closes #2498)
(cherry picked from commit bebb52b4e8)
2021-01-07 01:12:34 -05:00
arkon 5387e24bb4 Revert bad RxJava conversion that prevented tracking data to be updated in UI
(cherry picked from commit 2c9f8bb9ce)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt
2021-01-07 01:12:23 -05:00
arkon e363e2fbb2 Reword unmetered network restriction for library updates
(cherry picked from commit efbefabb01)
2021-01-07 01:11:34 -05:00
arkon b7986a6773 Remove usage of RxJava from backup/restore
(cherry picked from commit 990fb22d3e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupRestore.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupRestore.kt
2021-01-07 01:11:22 -05:00
arkon d6d8cbd346 Use JDK 11 for build workflow (#4250)
(cherry picked from commit 9b2c22b2d9)
2021-01-07 00:59:44 -05:00
arkon 27496ae77b Surface "NSFW" (includes things like ecchi) results in MAL search (closes #4249)
(cherry picked from commit df7e0d2f2f)
2021-01-07 00:59:36 -05:00
arkon bd73b1b068 Refactor bridged RxJava/coroutine calls in SearchPresenters
(cherry picked from commit 5cfda1b1bf)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
2021-01-07 00:59:27 -05:00
arkon 208d4574db Refactor bridged RxJava/coroutine calls in MangaPresenter
(cherry picked from commit ac9bf1f3ff)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-01-07 00:58:46 -05:00
arkon e92e942fcd Remove use of RxJava from TrackPresenter
(cherry picked from commit 7eb0868791)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt
2021-01-07 00:55:47 -05:00
Jobobby04 a6d4644713 Cleanup 2021-01-07 00:55:00 -05:00
Carlos c9062cc089 switch to v2 and api server + old style chapter urls for delegation
(cherry picked from commit b79c1572470fea4568708d3526f5170868a0c3c1)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiChapterParser.kt
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/FollowsHandler.kt
#	app/src/main/java/exh/md/handlers/SearchHandler.kt
2021-01-07 00:32:12 -05:00
Carlos ac2301e4be fix group serializer
(cherry picked from commit e47d84f1af1eebe63b3dfc618daee29e18ee4156)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt
#	app/src/main/res/raw/changelog_release.xml
#	buildSrc/src/main/kotlin/Configs.kt
2021-01-06 22:48:22 -05:00
Carlos c073f71ec1 fix v2 api call for groups
(cherry picked from commit 01903e341be6cd5ae50ce6eee88be6ad40fd1835)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
2021-01-06 22:46:07 -05:00
Carlos f1a65edd3a Mangadex api v2 for manga info
(cherry picked from commit 38ec991a15d2eebc7ebd0522f8615c2d8dd7003b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/ApiMangaParser.kt
#	app/src/main/java/eu/kanade/tachiyomi/source/online/handlers/serializers/CoversSerializer.kt
#	app/src/main/java/exh/md/handlers/MangaHandler.kt
#	app/src/main/java/exh/md/handlers/SearchHandler.kt
#	app/src/main/java/exh/md/handlers/serializers/ApiMangaSerializer.kt
#	app/src/main/res/drawable/manga_info_more_gradient.xml
2021-01-06 22:42:55 -05:00
CrepeTF 4b91013750 Change merge manga icon 2021-01-06 03:11:06 -05:00
CrepeTF 556fdb2e8d Modify midnight dusk theme colurs 2021-01-06 03:09:37 -05:00
Jobobby04 68c12d79ee CoroutinePresenter changes 2021-01-06 00:54:11 -05:00
arkon 142aa0f02a MAL: add way to search by list items' titles
(cherry picked from commit 8a792e6d76)
2021-01-04 14:37:46 -05:00
arkon a1102d790f Fix content focusiblity issues when using remote/controllers (closes #3766)
(cherry picked from commit d8a3692d92)
2021-01-04 14:24:47 -05:00
arkon f4549c5910 Fix malformed extension URLs
(cherry picked from commit 95ce0e39ef)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
2021-01-04 14:23:31 -05:00
arkon 4e026c1cf1 Refactor Kitsu API to remove Retrofit usage
(cherry picked from commit 17b70ab38c)
2021-01-04 14:21:21 -05:00
arkon 73fc1ac80f Use flows instead of relays for extensions loading
(cherry picked from commit 07e76f35fa)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
2021-01-04 14:21:13 -05:00
arkon 838953a739 More consistent wording for NSFW warning strings
(cherry picked from commit a4cab9876a)
2021-01-04 14:17:56 -05:00
arkon 66d2e8090a Remove some OptIn annotations
(cherry picked from commit c06a932c95)
2021-01-04 14:17:46 -05:00
Jobobby04 7bd5157bca Update MDList tracker with the new tracker changes, also library update may be a bit faster 2021-01-04 03:38:30 -05:00
arkon 298c1e92db Fully remove usages of RxJava from tracker classes
TODO: refactor usages to coroutines as well
(cherry picked from commit 7d713b87b1)
2021-01-04 02:01:26 -05:00
arkon 5ba087f2ee Adjust download icon alignment more
(cherry picked from commit b1167146c5)
2021-01-04 02:01:18 -05:00
arkon 68113f8c7d Convert more TrackService methods to coroutines
(cherry picked from commit 2d0a5eb02c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupRestore.kt
2021-01-04 01:55:08 -05:00
arkon b824f09966 Change MAL ID search prefix to "id:"
(cherry picked from commit 8d68859c2a)
2021-01-04 01:19:30 -05:00
arkon 0f000caa9d Use updated Tachiyomi version of DirectionalViewPager
(cherry picked from commit 444cefc9a2)
2021-01-04 01:17:39 -05:00
arkon ae3a36cc5a Tint downloaded icons with primary color
Makes them more easily distinguishable from other states.

(cherry picked from commit d0deceabbd)
2021-01-04 01:17:30 -05:00
arkon ee0625e9a6 Adjust padding of text before download icons
(cherry picked from commit 9cc6491c2a)
2021-01-04 01:16:16 -05:00
arkon 6028fdfc4d Note valid backup file extensions in error toast
(cherry picked from commit 710179f4b4)
2021-01-04 01:16:08 -05:00
arkon 68f209b91b Replace global search context menu option with share target
(cherry picked from commit d11c72fd48)

# Conflicts:
#	app/src/main/res/values/strings.xml
2021-01-04 01:16:01 -05:00
arkon 74dc7a645d Add more padding to download buttons
(cherry picked from commit 0af505828e)
2021-01-04 01:14:56 -05:00
arkon a0981c4944 Minor cleanup
(cherry picked from commit 135cf9960f)
2021-01-04 01:14:45 -05:00
Andreas E aab3ba5b48 Navigation settings and split invert tapping for webtoon and pager (#4233)
(cherry picked from commit 3bf7c74f93)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
#	app/src/main/res/layout/reader_settings_sheet.xml
2021-01-04 01:08:35 -05:00
Riztard Lanthorn 2bd67860a7 add date Format (#4236)
(cherry picked from commit cea4911c4d)
2021-01-04 00:28:15 -05:00
Jobobby04 b57dc1a6c8 Add android proguard to release test builds 2021-01-03 15:01:09 -05:00
Jobobby04 cbd25332e1 Fix proguard rules, re-enable proguard 2021-01-02 17:36:44 -05:00
Jobobby04 d8bb15cdcd Disable proguard for now 2021-01-02 17:28:32 -05:00
Jobobby04 ce0726d863 Update SY fetchMangaInfo and getchChapterList to use the new 1.x functions 2021-01-02 16:36:13 -05:00
Jobobby04 28fca8c839 Make internal and delegated sources able to use getMangaDetails, getChapterList, and getPageList properly 2021-01-02 03:28:03 -05:00
arkon 23ac4b271c Replace usages of fetchChapterList with 1.x getChapterList API
(cherry picked from commit 54dc01253d)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/AbstractBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-01-02 03:08:16 -05:00
arkon 423983d41a Replace usages of fetchMangaDetails with 1.x getMangaDetails API
(cherry picked from commit 4db9a90da2)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/FullBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupManager.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-01-02 02:59:33 -05:00
Andreas E 651f4659a5 Viewer navigation (#3869)
* Viewer navigation

Co-authored-by: Harsh Parekh <h.x.dev@outlook.com>

* Match current reader behavior and add ability to invert it

* A bit of clean up

* Clean up inversion

* Only create navigator when changed

and change tap zone when invertTapping is changed

* Clean up PagerConfig

* Change how Viewer navigation works

* Add Edge Navigation

Co-authored-by: Harsh Parekh <h.x.dev@outlook.com>
(cherry picked from commit d69e9034ab)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
#	app/src/main/res/layout/reader_settings_sheet.xml
2021-01-01 23:49:25 -05:00
Clarence Castillo b8751f6d15 Direct user back to global search when coming from source search results (#4196)
(cherry picked from commit 71ece73d99)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
2021-01-01 23:44:45 -05:00
arkon 8a8d8f7189 Include source name in backup restore error logs (closes #4230)
(cherry picked from commit 3bb2102eb4)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/legacy/LegacyBackupRestore.kt
2021-01-01 23:43:15 -05:00
arkon 7a6a33d5fe Remove some unnecessary coroutine dispatcher switching
(cherry picked from commit b7914909d0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2021-01-01 23:42:02 -05:00
Jobobby04 3e6c3ac151 Do some cleanup 2021-01-01 15:15:16 -05:00
arkon 8dd435b5b5 Implement click events for chapter download icons
(cherry picked from commit 63398fe491)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt
2020-12-31 19:45:26 -05:00
arkon 6d4136248c Use coroutines instead of rx for some MangaPresenter operations
(cherry picked from commit bf32bf28da)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2020-12-31 19:38:33 -05:00
arkon 67b919423a Remove some unused variables
(cherry picked from commit dcb6bfb18d)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/SourceAdapter.kt
2020-12-31 19:36:53 -05:00
arkon d5af2ed80c Adjust chapters filter icon to line up with download icons
(cherry picked from commit 8f605dc0f6)
2020-12-31 19:32:33 -05:00
arkon 8ee8cae1f7 Fix download progress bar sizing to match icons
(cherry picked from commit 47e770948b)
2020-12-31 19:32:26 -05:00
arkon 171a610d0d Move some build.gradle.kts content around
(cherry picked from commit 9ab29f5b7f)

# Conflicts:
#	app/build.gradle.kts
2020-12-31 19:31:43 -05:00
arkon 1d134a94a6 Only include Firebase dependency in standard flavor
(cherry picked from commit 10bf430ce6)
2020-12-31 19:29:39 -05:00
jobobby04 f143ac1572 Convert app build.gradle to Kotlin DSL 2020-12-31 19:29:18 -05:00
arkon 1f3c805a0f Handle last read page being above total page count (fixes #4010)
(cherry picked from commit 141f9b7730)
2020-12-31 17:33:20 -05:00
arkon 426af9c93c Increase per-page limit when searching MAL manga list
(cherry picked from commit 139a589ad6)
2020-12-31 17:33:06 -05:00
arkon 50cc6e5e83 Minor cleanup of some tracker observables
(cherry picked from commit 97a308b114)
2020-12-31 17:32:48 -05:00
arkon b6d0594d10 Find existing entry in MAL list when binding
(cherry picked from commit 430714e67f)
2020-12-31 17:32:41 -05:00
arkon f5f71fa4a7 Add ID search workaround for MAL tracking
(cherry picked from commit a49adbd09c)
2020-12-31 17:32:33 -05:00
arkon 9085c142d5 Fix crash on updating trackers after reading with no network (closes #4207)
(cherry picked from commit 3df98d576e)
2020-12-31 17:32:25 -05:00
arkon 73092a2832 Adjust download icon sizing
(cherry picked from commit 8135136c86)
2020-12-31 17:32:14 -05:00
arkon d2e594be0c Tweak manga info header backdrop
(cherry picked from commit cef1c4b8a1)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt
2020-12-31 17:32:09 -05:00
arkon aef21dabd5 Refactor tracker response parsing
(cherry picked from commit 2e8791a101)
2020-12-31 17:23:55 -05:00
arkon cd9c26f278 Show download progress in download icons
(cherry picked from commit 0e2b8b10d1)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2020-12-31 17:23:39 -05:00
arkon dbda419d29 Animate download icon
(cherry picked from commit 3cb64669e4)
2020-12-31 17:17:05 -05:00
arkon 92cc022fb4 Add Telugu to language setting
(cherry picked from commit bc0d32f330)
2020-12-31 17:16:55 -05:00
Jozef Hollý 1c5ffcca24 Weblate translations (#4173)
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alessandro Zangrandi <alessandro@mzit.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Alperen Arslan <slyvioborin@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Damiano Mason <damicricio99@gmail.com>
Co-authored-by: Dams <qashdzn@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Edgar Mejía <edgar13155@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Luis Andrés Bajaña F <labfernandez2014@gmail.com>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: MINEJHAZZ <minecrafterngt@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nicolas Meunier <minecraft.arsenof@gmail.com>
Co-authored-by: Nikola Perović <nikolaperovicccc@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Redya Rachmandanu <redyarachmandanu@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Samiul Azam <yeasin.sanny99@gmail.com>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: SmolderingGummy <bairamsaieesh@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Woodyx <shiposhouyou@gmail.com>
Co-authored-by: Xoko14 <xoquinperezb@gmail.com>
Co-authored-by: Yassin <yassinelaoud@gmail.com>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: vlad hateg <vhateg@gmail.com>
Co-authored-by: Đỗ Vũ Minh Quang <quacmichael@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ar/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/bn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ca/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/cv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/de/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/el/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/es_419/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fil/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/fr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/gl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/hr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/id/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/it/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ja/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/kn/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ms/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/nl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pl/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ro/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/ru/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sc/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/sv/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/te/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/tr/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/uk/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/vi/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/tachiyomi/strings/zh_Hant/
Translation: Tachiyomi/Strings
Translation: Tachiyomi/Tachiyomi 0.x

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Alessandro Jean <alessandrojean@gmail.com>
Co-authored-by: Alessandro Zangrandi <alessandro@mzit.it>
Co-authored-by: Alex <linuxrf@gmail.com>
Co-authored-by: Alperen Arslan <slyvioborin@gmail.com>
Co-authored-by: Andreas E <andreas.everos@gmail.com>
Co-authored-by: Ava <Sasu.ruotsalainen@live.fi>
Co-authored-by: C201 <derasetad@gmail.com>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: Damiano Mason <damicricio99@gmail.com>
Co-authored-by: Dams <qashdzn@gmail.com>
Co-authored-by: DarKCroX <darkcrox.2020@outlook.com>
Co-authored-by: Edgar Mejía <edgar13155@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Eric <spice2wolf@gmail.com>
Co-authored-by: Huang Zhiyi <hzy980512@126.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Kurocon <weblate@kurocon.nl>
Co-authored-by: Luis Andrés Bajaña F <labfernandez2014@gmail.com>
Co-authored-by: Lyaiya <hipsnafoha@outlook.com>
Co-authored-by: Lzmxya <lzmxya@gmail.com>
Co-authored-by: MINEJHAZZ <minecrafterngt@gmail.com>
Co-authored-by: Matteo Gaeta <matteo.gaeta.1998@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Nicolas Meunier <minecraft.arsenof@gmail.com>
Co-authored-by: Nikola Perović <nikolaperovicccc@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: Paulo Pinho <kebrus@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Redya Rachmandanu <redyarachmandanu@gmail.com>
Co-authored-by: Rostyslav <info@ubilling.net.ua>
Co-authored-by: Samiul Azam <yeasin.sanny99@gmail.com>
Co-authored-by: Shashank Pujari <shashankppujari@gmail.com>
Co-authored-by: SmolderingGummy <bairamsaieesh@gmail.com>
Co-authored-by: Soitora <simon.mattila@protonmail.com>
Co-authored-by: Tooster <max@polarczyk.pl>
Co-authored-by: Woodyx <shiposhouyou@gmail.com>
Co-authored-by: Xoko14 <xoquinperezb@gmail.com>
Co-authored-by: Yassin <yassinelaoud@gmail.com>
Co-authored-by: Zulkifli <zulhaha1@gmail.com>
Co-authored-by: darkbeast13 <nikhil15mps@gmail.com>
Co-authored-by: vlad hateg <vhateg@gmail.com>
Co-authored-by: Đỗ Vũ Minh Quang <quacmichael@gmail.com>
Co-authored-by: Роман <Rozhenkov69@gmail.com>
(cherry picked from commit 0db17beacc)
2020-12-31 17:16:44 -05:00
arkon 59fb4a71e6 Minor cleanup of UpdatesHolder
(cherry picked from commit 6378a41b6d)
2020-12-31 17:15:01 -05:00
arkon 157f7802b2 Hide chapter download icons for local manga
(cherry picked from commit 23bf7faf9f)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt
2020-12-31 17:14:53 -05:00
arkon 406f77c645 Add error state to chapter download icons
(cherry picked from commit 01ff3af63f)
2020-12-31 17:14:03 -05:00
arkon 959559a89f Refactor response parsing helper function
(cherry picked from commit 8f98055e9e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubUpdateChecker.kt
#	app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
2020-12-31 17:13:49 -05:00
arkon df1daa6b7f Refactor download states into enum
(cherry picked from commit 84ae61f72c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
2020-12-31 17:12:02 -05:00
arkon 56a4ef33f5 Initial chapter download icon implementation
(cherry picked from commit 6dd280205b)
2020-12-31 17:07:32 -05:00
arkon 4be204e0b1 Log exception on invalid download directory issue
(cherry picked from commit 1365d553a4)
2020-12-31 17:07:22 -05:00
Jobobby04 8e659f3355 Remove usage of retrofit in similar manga pull 2020-12-31 17:07:03 -05:00
arkon e78197ab48 Remove usage of Retrofit for update check and extensions list
(cherry picked from commit 61a594493c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubService.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubUpdateChecker.kt
#	app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
#	app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubService.kt
2020-12-31 17:06:36 -05:00
arkon a25d7b39a7 Remove unnecessary BaseWebViewActivity class
(cherry picked from commit 62ab70f889)
2020-12-31 16:39:39 -05:00
Jobobby04 08e52cca97 Remove manga tags scrollbar 2020-12-29 20:01:51 -05:00
CrepeTF 4b3d92a050 Added "Midnight Dusk" theme (#183)
* Added Midnight Dusk theme + tweaks

* Added Midnight Dusk theme + tweaks

* Colouring mistakes

* Space error
2020-12-26 19:25:34 -05:00
Jobobby04 a907c93147 Fix Index adapter crash 2020-12-26 19:23:46 -05:00
Jobobby04 294bb286e9 Deal with the SY ProgressBars 2020-12-26 17:02:07 -05:00
arkon 54736ea410 Replace circular ProgressBars with Material component
(cherry picked from commit eaccfdde59)
2020-12-26 16:42:07 -05:00
arkon 897f5f1732 Replace ProgressBars with Material component
(cherry picked from commit a8e536478c)
2020-12-26 16:41:58 -05:00
arkon 7fc7ea9c9b Update dependencies
(cherry picked from commit e94d5626dd)
2020-12-26 16:41:47 -05:00
arkon 7cdda6241f Try to avoid crashing when unable to get backup filename for some reason
(cherry picked from commit be3e31ddc4)
2020-12-26 16:41:38 -05:00
Andreas E 45ef778e6d Reader snackbar dismissible (#4190)
* Make Reading Mode Snackbar dismissible

* Change reader FrameLayout to CoordinatorLayout

(cherry picked from commit b92b6520cb)
2020-12-26 16:41:29 -05:00
Jobobby04 528c2dbae7 Allow clicking the toolbar to go to the manga 2020-12-26 16:39:56 -05:00
Jobobby04 e078e34ab0 Add chapter deeplink, make MangaDex use it 2020-12-26 16:13:55 -05:00
Jobobby04 1a609e557b Refactor and cleanup 2020-12-26 16:12:52 -05:00
arkon d3b7f639b5 Convert tracker add/update/login methods to coroutines
(cherry picked from commit ea33179a95)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt
2020-12-26 00:36:08 -05:00
arkon f99aa721d0 Use coroutines for Bangumi and Shikimori APIs
(cherry picked from commit 6fcf6ae1f5)
2020-12-26 00:34:40 -05:00
arkon 0519d8ea17 Remove usage of Gson in Kitsu tracker
(cherry picked from commit f2a9247b68)
2020-12-26 00:34:32 -05:00
arkon 0c84d51e1b Use coroutines for Anilist API
(cherry picked from commit dc3ed7fffc)
2020-12-26 00:34:23 -05:00
arkon bcd7a2d21b Migrate Kitsu API to coroutines and kotlinx.serialization
(cherry picked from commit 271de31d51)
2020-12-26 00:34:15 -05:00
arkon d332be88ba Make OkHttp coroutine calls always throw exceptions on errors
(cherry picked from commit 1268caf3e0)
2020-12-26 00:34:04 -05:00
arkon f10a499a36 Surface MAL HTTP errors properly
(cherry picked from commit c0cef58e39)
2020-12-26 00:33:56 -05:00
arkon db06c6614e Fix trackers after MAL not updating
(cherry picked from commit d363d205c3)
2020-12-26 00:33:47 -05:00
arkon 51032fa65b Filter out novels from MAL search results
(cherry picked from commit 2fd5a9e883)
2020-12-26 00:33:40 -05:00
arkon 98a20b2756 Format MAL search result status/type better
(cherry picked from commit e7ef974a39)
2020-12-26 00:33:28 -05:00
specterflare c00ba701b3 Remove License Appendix That Should Have Been Removed Initially (#4158)
http://www.apache.org/licenses/LICENSE-2.0 makes it pretty clear the appendix is supposed to be separate from the rest of the license. I guess inorichi just forget to get rid of it at the end of LICENSES.txt
(cherry picked from commit 2d28750782)
2020-12-26 00:33:11 -05:00
Taco 52c5c35e1a Update NDK & buildTools, fix deprecated Parcelize (#4157)
* Update buildTools and NDK

* Fix deprecated Parcelize

(cherry picked from commit e2054a0ab7)
2020-12-26 00:33:02 -05:00
arkon de03174131 Strip out no longer used tracker start/end date code
Unfortunately MAL was the only one that supported it in the app, but the official API doesn't support it, so now no trackers have it.

(cherry picked from commit 6e7fefb8b2)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/full/models/BackupTracking.kt
2020-12-26 00:32:26 -05:00
Jobobby04 f33a4e2ecc Also do the last commit for SY 2020-12-26 00:31:38 -05:00
arkon 118e1d302b Add forced MAL logout for next release migration
(cherry picked from commit 450bef278b)
2020-12-26 00:30:07 -05:00
arkon 1dcead9d79 Migrate to official MyAnimeList API (closes #4140)
(cherry picked from commit 0affc0d58b)
2020-12-26 00:29:58 -05:00
arkon b001768b96 Don't surface hidden settings when searching
(cherry picked from commit 3d153b6c8e)
2020-12-26 00:29:47 -05:00
Jobobby04 78f48d28c3 Convert SmartSearch channel to SharedFlow 2020-12-26 00:06:52 -05:00
Jobobby04 a7b05f372b Cleanup 2020-12-25 23:59:11 -05:00
Jobobby04 d392b58ced Change mangadex deeplink to PathPrefix deeplinks 2020-12-25 23:58:59 -05:00
Jobobby04 1dcf161131 Fix Hentai Cafe deeplinking, fixes other deeplinks 2020-12-25 23:58:40 -05:00
Jobobby04 dfabe1d2fa Revert "Deeplink using pathPattern instead of pathPrefix"
This reverts commit 8e03375664.
2020-12-25 23:20:12 -05:00
Jobobby04 bbc70801db Fix weird MangaDex login dialog fill-in 2020-12-25 20:07:06 -05:00
Jobobby04 d68341aaba Allow editing local manga even if not in library 2020-12-21 22:51:46 -05:00
Jobobby04 e1e64c79d2 Revert "Hide dedupe by priority"
This reverts commit 2cf0475066.
2020-12-21 17:29:33 -05:00
Jobobby04 7d53c7af4a Fix crop borders webtoon/cont vertical settings inversion 2020-12-21 17:29:06 -05:00
Jobobby04 2cf0475066 Hide dedupe by priority 2020-12-21 14:46:38 -05:00
Jobobby04 0923cd6509 Release 1.4.1 2020-12-21 14:41:49 -05:00
Jobobby04 330908c49d Add continues vertical crop borders to the reading settings 2020-12-21 14:39:54 -05:00
Jobobby04 644140b617 Make a coroutine presenter 2020-12-21 14:21:43 -05:00
Jobobby04 d302a0fbc7 Cleanup 2020-12-21 14:21:43 -05:00
Jobobby04 ce8f7da9ca Use ContextCompat to get custom source icons 2020-12-21 14:21:42 -05:00
Jobobby04 f1a4811030 In batch add and deeplink, only use enabled sources 2020-12-21 14:21:42 -05:00
Jobobby04 a439ffcafc Add separate continues vertical crop borders setting 2020-12-21 14:21:42 -05:00
Jobobby04 5eeab103c2 Fix external repo preference conflict 2020-12-21 14:21:41 -05:00
Jobobby04 78ffd9d56e Cleanup 2020-12-21 14:21:41 -05:00
Jobobby04 96213900ac Add external repo support 2020-12-21 14:21:40 -05:00
Jobobby04 85e30ef6ca Cleanup 2020-12-21 14:21:40 -05:00
arkon f38df69983 Update app repo URL
(cherry picked from commit 04fff91e23)

# Conflicts:
#	.github/workflows/TachiyomiSY-Release-Builder.yml
#	README.md
#	app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubUpdateChecker.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/main/WhatsNewDialogController.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt
2020-12-21 14:21:40 -05:00
arkon 64e9515293 Update extensions repo URL
(cherry picked from commit 28a23452f2)

# Conflicts:
#	README.md
2020-12-21 14:21:39 -05:00
arkon 67e676d4ae Apply theme to OAuth login redirect activities
(cherry picked from commit 6d403851cf)
2020-12-21 14:21:39 -05:00
arkon ef36a9c28c Misc tracker code cleanup
(cherry picked from commit 395a749bce)
2020-12-21 14:21:38 -05:00
arkon 513bcbb80d Refactor CustomTabsIntent creation
(cherry picked from commit 2cc2a90941)
2020-12-21 14:21:38 -05:00
Jobobby04 3d5952ebbd Cleanup some unneeded lambas 2020-12-21 14:21:38 -05:00
arkon 1d55a1bec4 Fix loading fallback thumbnails in browse view (closes #4127)
(cherry picked from commit c5ca739b49)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
2020-12-21 14:21:37 -05:00
arkon 962344f5fc Minor code cleanup
(cherry picked from commit 00fe4cdf2d)
2020-12-21 14:21:37 -05:00
Jobobby04 ba6bcc82b6 More dialog fixes 2020-12-21 14:21:36 -05:00
arkon 6659935f3d Complete migration off of Kotlin synthetics
(cherry picked from commit 69be3e1e87)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt
2020-12-21 14:21:36 -05:00
arkon ccca9e8828 Show MAL relogin message on update, localize error message
(cherry picked from commit 2cb3984d68)
2020-12-21 14:21:36 -05:00
arkon b4cce2b3e0 Use view binding for date headers
(cherry picked from commit 5901978889)
2020-12-21 14:21:35 -05:00
arkon 9737d847fd Update to coroutines 1.4.2
Should fix crashes on some devices. See https://github.com/Kotlin/kotlinx.coroutines/issues/2371

(cherry picked from commit 8bf1cf3cc5)
2020-12-21 14:21:35 -05:00
arkon f180c6a07c Reword NSFW settings section
(cherry picked from commit f6af1184bc)
2020-12-21 14:21:35 -05:00
arkon 024c2d4ce0 More crash fixes
(cherry picked from commit 4880741b8b)
2020-12-21 14:21:34 -05:00
arkon 17731f3904 Remove bundled fallback file picker
(cherry picked from commit e8627800fe)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt
#	app/src/main/res/layout/common_listitem_dir.xml
#	app/src/main/res/values/styles.xml
2020-12-21 14:21:34 -05:00
arkon e2dadd4213 Require WebView 86+
(cherry picked from commit 907fbb94a2)
2020-12-21 14:21:34 -05:00
Jobobby04 b4fedf9a87 Maybe fix push to mangadex 2020-12-21 14:21:33 -05:00
Jobobby04 beaf6284fd Fixes to merged settings dialog and edit manga dialog 2020-12-21 14:21:33 -05:00
arkon 3300eb0e79 Some crash fixes
(cherry picked from commit fd2028557e)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
2020-12-21 14:21:33 -05:00
arkon 3599526fde Suppress some deprecation warnings
(cherry picked from commit 91fa1ec6b2)
2020-12-21 14:21:32 -05:00
arkon 8b6a0ad891 Note that toggling NSFW sources requires a restart
(cherry picked from commit bbc00768f0)
2020-12-21 14:21:32 -05:00
arkon cf99ee73f5 Break out NSFW hiding/labeling into separate settings
(cherry picked from commit 5b09461ccf)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt
2020-12-21 14:21:31 -05:00
arkon bbd3e3c29c Remove source overwrite logic since built-in sources no longer exist
(cherry picked from commit 1a439ecece)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt
2020-12-21 14:21:31 -05:00
arkon 972579bbec Flip left/right key events for Webtoon viewer (fixes #4111)
(cherry picked from commit 836aec4396)
2020-12-21 14:21:31 -05:00
Jobobby04 4044b0897e Make S Pen action ids unique 2020-12-21 14:21:30 -05:00
Jobobby04 5e6c0bbc14 Change Search in Tachiyomi to Search in TachiyomiSY 2020-12-21 14:21:30 -05:00
she11sh0cked a8c6474f5e Use a different title for japanese manga vs other manga (#181)
* Use a different title for japanese manga vs other manga

* Revert wildcard import
2020-12-21 14:20:49 -05:00
jobobby04 820279634e [SKIP CI] Update readme 2020-12-12 14:47:55 -05:00
jobobby04 ce7577a2b4 [SKIP CI] Update readme 2020-12-12 14:46:35 -05:00
Jobobby04 31376e5a52 Revert "Hide incomplete NSFW source labelling settings"
This reverts commit 134f776a86.
2020-12-12 14:07:33 -05:00
905 changed files with 30088 additions and 21488 deletions
-33
View File
@@ -1,33 +0,0 @@
1. **Before reporting a new issue, take a look at the [FAQ](https://tachiyomi.org/help/faq/), the [changelog](https://github.com/inorichi/tachiyomi/releases) and the already opened [issues](https://github.com/inorichi/tachiyomi/issues).**
2. If you are unsure, ask here: [![Discord](https://img.shields.io/discord/349436576037732353.svg)](https://discord.gg/tachiyomi)
3. What is your type of issue?
* [Catalogue request](#catalogue-requests)
* [Bugs](#bugs)
* [Feature requests](#feature-requests)
* [Translations](https://tachiyomi.org/help/contribution/#translation)
4. After following 1. and 3. you can [open your issue](https://github.com/inorichi/tachiyomi/issues/new)
***
# Catalogue requests
* Catalogue requests should be created at https://github.com/inorichi/tachiyomi-extensions#readme, not here
# Bugs
* Include version (More > About > Version)
* If not latest, try updating, it may have already been solved
* Preview version is equal to the number of commits as seen in the main page
* Include steps to reproduce (if not obvious from description)
* Include screenshot (if needed)
* If it could be device-dependent, try reproducing on another device (if possible)
* For large logs use http://pastebin.com/ (or similar)
* Don't group unrelated requests into one issue
DO: https://github.com/inorichi/tachiyomi/issues/24 https://github.com/inorichi/tachiyomi/issues/71
DON'T: https://github.com/inorichi/tachiyomi/issues/75
# Feature requests
* Write a detailed issue, explaining what it should do or how. Avoid writing just "like X app does"
* Include screenshot (if needed)
-1
View File
@@ -1,2 +1 @@
github: inorichi
ko_fi: inorichi ko_fi: inorichi
+11 -3
View File
@@ -2,9 +2,15 @@
I acknowledge that: I acknowledge that:
- I have updated to the latest version of the app (stable is v1.4.0) - I have updated:
- I have updated all extensions - To the latest version of the app (stable is v1.7.0)
- If this is an issue with an extension, that I should be opening an issue in https://github.com/inorichi/tachiyomi-extensions - All extensions
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- If this is an issue with an extension, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi-extensions
- I have searched the existing issues and this is new ticket **NOT** a duplicate or related to another open issue
- I will fill out the title and the information in this template
Note that the issue will be automatically closed if you do not fill out the title or requested information.
**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** **DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT**
@@ -24,3 +30,5 @@ I acknowledge that:
## Other details ## Other details
Additional details and attachments. Additional details and attachments.
If you're experiencing crashes, share the crash logs from More → Settings → Advanced → Dump crash logs.
+11 -3
View File
@@ -9,9 +9,15 @@ labels: "bug"
I acknowledge that: I acknowledge that:
- I have updated to the latest version of the app (stable is v1.4.0) - I have updated:
- I have updated all extensions - To the latest version of the app (stable is v1.7.0)
- If this is an issue with an extension, that I should be opening an issue in https://github.com/inorichi/tachiyomi-extensions - All extensions
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- If this is an issue with an extension, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi-extensions
- I have searched the existing issues and this is new ticket **NOT** a duplicate or related to another open issue
- I will fill out the title and the information in this template
Note that the issue will be automatically closed if you do not fill out the title or requested information.
**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** **DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT**
@@ -34,3 +40,5 @@ This happened instead.
## Other details ## Other details
Additional details and attachments. Additional details and attachments.
If you're experiencing crashes, share the crash logs from More → Settings → Advanced → Dump crash logs.
+1 -1
View File
@@ -4,5 +4,5 @@ contact_links:
url: https://tachiyomi.org/help/ url: https://tachiyomi.org/help/
about: Common questions are answered here. about: Common questions are answered here.
- name: Tachiyomi extensions GitHub repository - name: Tachiyomi extensions GitHub repository
url: https://github.com/inorichi/tachiyomi-extensions url: https://github.com/tachiyomiorg/tachiyomi-extensions
about: Issues about an extension/source/catalogue should be opened here instead. about: Issues about an extension/source/catalogue should be opened here instead.
+8 -3
View File
@@ -9,9 +9,14 @@ labels: "feature"
I acknowledge that: I acknowledge that:
- I have updated to the latest version of the app (stable is v1.4.0) - I have updated:
- I have updated all extensions - To the latest version of the app (stable is v1.7.0)
- If this is an issue with an extension, that I should be opening an issue in https://github.com/inorichi/tachiyomi-extensions - All extensions
- If this is an issue with an extension, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi-extensions
- I have searched the existing issues and this is new ticket **NOT** a duplicate or related to another open issue
- I will fill out the title and the information in this template
Note that the issue will be automatically closed if you do not fill out the title or requested information.
**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** **DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT**
+3 -3
View File
@@ -1,8 +1,8 @@
--- ---
name: "Extension/source/catalogue issue" name: "Extension/source/catalogue issue"
about: "Do not open an issue here. See https://github.com/inorichi/tachiyomi-extensions" about: "Do not open an issue here. See https://github.com/tachiyomiorg/tachiyomi-extensions"
title: "THIS ISSUE IS IN THE WRONG REPO; SEE https://github.com/inorichi/tachiyomi-extensions" title: "THIS ISSUE IS IN THE WRONG REPO; SEE https://github.com/tachiyomiorg/tachiyomi-extensions"
labels: "catalog, invalid" labels: "catalog, invalid"
--- ---
DO NOT OPEN AN ISSUE IN THIS REPO. SEE https://github.com/inorichi/tachiyomi-extensions DO NOT OPEN AN ISSUE IN THIS REPO. SEE https://github.com/tachiyomiorg/tachiyomi-extensions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 489 KiB

@@ -18,7 +18,7 @@ jobs:
uses: gradle/wrapper-validation-action@v1 uses: gradle/wrapper-validation-action@v1
build: build:
name: Build app release name: Build app
needs: check_wrapper needs: check_wrapper
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')" if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -60,21 +60,16 @@ jobs:
dependencies-cache-enabled: true dependencies-cache-enabled: true
configuration-cache-enabled: true configuration-cache-enabled: true
- name: Sign Android Release - name: Sign APK
uses: r0adkll/sign-android-release@v1 uses: r0adkll/sign-android-release@v1
with: with:
# The directory to find your release to sign
releaseDirectory: app/build/outputs/apk/standard/release releaseDirectory: app/build/outputs/apk/standard/release
# The key used to sign your release in base64 encoded format
signingKeyBase64: ${{ secrets.SIGNING_KEY }} signingKeyBase64: ${{ secrets.SIGNING_KEY }}
# The key alias
alias: ${{ secrets.ALIAS }} alias: ${{ secrets.ALIAS }}
# The password to the keystore
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# The password for the key
keyPassword: ${{ secrets.KEY_PASSWORD }} keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Create Release - name: Create release
id: create_release id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1
env: env:
@@ -85,7 +80,7 @@ jobs:
draft: true draft: true
prerelease: false prerelease: false
- name: Upload Release APK - name: Upload APK to release
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+27 -28
View File
@@ -7,31 +7,30 @@ jobs:
autoclose: autoclose:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Autoclose when created in wrong repo - name: Autoclose issues
uses: arkon/issue-closer-action@v1.1 uses: arkon/issue-closer-action@v3.4
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
type: title rules: |
regex: ".*THIS ISSUE IS IN THE WRONG REPO.*" [
message: "@${issue.user.login} this issue was automatically closed because it was not opened in the correct repo, as the template mentioned." {
- name: Autoclose when no short description provided "type": "title",
uses: arkon/issue-closer-action@v1.1 "regex": ".*THIS ISSUE IS IN THE WRONG REPO.*",
with: "message": "It was not opened in the correct repo, as the template mentioned."
repo-token: ${{ secrets.GITHUB_TOKEN }} },
type: title {
regex: ".*<Write short description here>*" "type": "title",
message: "@${issue.user.login} this issue was automatically closed because you did not fill out the description in the title." "regex": ".*<Write short description here>*",
- name: Autoclose when body acknowledgement section not removed "message": "The description in the title was not filled out."
uses: arkon/issue-closer-action@v1.1 },
with: {
repo-token: ${{ secrets.GITHUB_TOKEN }} "type": "body",
type: body "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*",
regex: ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*" "message": "The acknowledgment section was not removed."
message: "@${issue.user.login} this issue was automatically closed because the acknowledgment section was not removed." },
- name: Autoclose when body requested information not filled out {
uses: arkon/issue-closer-action@v1.1 "type": "body",
with: "regex": ".*\\* (Tachiyomi version|Android version|Device): \\?.*",
repo-token: ${{ secrets.GITHUB_TOKEN }} "message": "Requested information in the template was not filled out."
type: body }
regex: ".*\\* (Tachiyomi version|Android version|Device): \\?.*" ]
message: "@${issue.user.login} this issue was automatically closed because the requested information was not filled out."
+14
View File
@@ -0,0 +1,14 @@
name: Issue moderator
on:
issue_comment:
types: [created]
jobs:
moderate:
runs-on: ubuntu-latest
steps:
- name: Moderate issues
uses: tachiyomiorg/issue-moderator-action@v1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
+19
View File
@@ -0,0 +1,19 @@
name: Lock threads
on:
# Daily
schedule:
- cron: '0 * * * *'
# Manual trigger
workflow_dispatch:
inputs:
jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '2'
pr-lock-inactive-days: '2'
+76
View File
@@ -0,0 +1,76 @@
# Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at the Tachiyomi [Discord server](https://discord.gg/tachiyomi). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+34
View File
@@ -0,0 +1,34 @@
Looking to report an issue/bug or make a feature request? Please refer to the [README file](https://github.com/tachiyomiorg/tachiyomi#issues-feature-requests-and-contributing).
---
Thanks for your interest in contributing to Tachiyomi!
# Code contributions
Pull requests are welcome!
If you're interested in taking on [an open issue](https://github.com/tachiyomiorg/tachiyomi/issues), please comment on it so others are aware.
# Translations
Translations are done externally via Weblate. See [our website](https://tachiyomi.org/help/contribution/#translation) for more details.
# Forks
Forks are allowed so long as they abide by [the project's LICENSE](https://github.com/tachiyomiorg/tachiyomi/blob/master/LICENSE).
When creating a fork, remember to:
- To avoid confusion with the main app:
- Change the app name
- Change the app icon
- Change or disable the [app update checker](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/src/main/java/eu/kanade/tachiyomi/data/updater/github/GithubUpdateChecker.kt)
- To avoid installation conflicts:
- Change the `applicationId` in [`build.gradle.kts`](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/build.gradle.kts)
- To avoid having your data polluting the main app's analytics and crash report services:
- If you want to use Firebase analytics, replace [`google-services.json`](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/src/standard/google-services.json) with your own
- If you want to use ACRA crash reporting, replace the `ACRA_URI` endpoint in [`build.gradle.kts`](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/build.gradle.kts) with your own
-26
View File
@@ -174,29 +174,3 @@
of your accepting any such warranty or additional liability. of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+29 -18
View File
@@ -1,17 +1,17 @@
| Preview Builds | Release Builds | Tachiyomi Support Server | | Preview Builds | Release Builds | Tachiyomi Support Server |
|-------|----------|----------| |-------|----------|----------|
| [![Preview](https://github.com/jobobby04/TachiyomiSYPreview/workflows/Remote%20Dispatch%20Build%20App/badge.svg)](https://github.com/jobobby04/TachiyomiSYPreview/releases) | [![stable release](https://img.shields.io/github/release/jobobby04/tachiyomisy.svg?maxAge=3600&label=download)](https://github.com/jobobby04/tachiyomisy/releases/latest) | [![Discord](https://img.shields.io/discord/349436576037732353.svg)](https://discord.gg/tachiyomi) | | [![Preview](https://github.com/jobobby04/TachiyomiSYPreview/workflows/Remote%20Dispatch%20Build%20App/badge.svg)](https://github.com/jobobby04/TachiyomiSYPreview/releases) | [![stable release](https://img.shields.io/github/release/jobobby04/tachiyomisy.svg?maxAge=3600&label=download)](https://github.com/jobobby04/tachiyomisy/releases/latest) | [![Discord](https://img.shields.io/discord/349436576037732353.svg?label=discord&labelColor=7289da&color=2c2f33&style=flat)](https://discord.gg/tachiyomi) |
# ![app icon](./.github/readme-images/app-icon.png)TachiyomiSY # ![app icon](./.github/readme-images/app-icon.png)TachiyomiSY
Tachiyomi is a free and open source manga reader for Android 5.0 and above. This version of Tachiyomi, TachiyomiSY was based off TachiyomiAZ. This version is meant to push forward in the ways of usability and features. TachiyomiSY tries to push forward where it can, but staying in a place where it can easily grab updates and features from the main app, it tries to make new features, or take features from other forks like J2K and Neko. Tachiyomi is a free and open source manga reader for Android 6.0 and above. This version of Tachiyomi, TachiyomiSY was based off TachiyomiAZ. This version is meant to push forward in the ways of usability and features. TachiyomiSY tries to push forward where it can, but staying in a place where it can easily grab updates and features from the main app, it tries to make new features, or take features from other forks like J2K and Neko.
![screenshots of app](./.github/readme-images/screens.png) ![screenshots of app](./.github/readme-images/screens.png)
## Features ## Features
Features of Tachiyomi(original) include: Features of Tachiyomi(original) include:
* Online reading from sources such as MangaDex, MangaSee, Mangakakalot, [and more](https://github.com/inorichi/tachiyomi-extensions) * Online reading from [a variety of sources](https://github.com/tachiyomiorg/tachiyomi-extensions)
* Local reading of downloaded manga * Local reading of downloaded manga
* A configurable reader with multiple viewers, reading directions and other settings. * A configurable reader with multiple viewers, reading directions and other settings.
* [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.io/), [Shikimori](https://shikimori.one), and [Bangumi](https://bgm.tv/) support * [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.io/), [Shikimori](https://shikimori.one), and [Bangumi](https://bgm.tv/) support
@@ -52,18 +52,19 @@ Features of TachiyomiSY include:
* Enhanced views for internal and integrated sources * Enhanced views for internal and integrated sources
* Enhanced usability for internal and delegated sources * Enhanced usability for internal and delegated sources
* Custom sources: Custom sources:
* * E-Hentai/ExHentai * E-Hentai/ExHentai
* Additional features for some extensions, features include custom description, opening in app, batch add to library, and a bunch of other things based on the source:
* * 8Muses (EroMuse) Additional features for some extensions, features include custom description, opening in app, batch add to library, and a bunch of other things based on the source:
* * HBrowse * 8Muses (EroMuse)
* * HentaiCafe (inside Foolside) * HBrowse
* * Hitomi.la * HentaiCafe (inside Foolside)
* * Mangadex * Hitomi.la
* * NHentai * Mangadex
* * PervEden (EN and IT) * NHentai
* * Puruin * PervEden (EN and IT)
* * Tsumino * Puruin
* Tsumino
## Download ## Download
Get the app from our [releases page](https://github.com/jobobby04/tachiyomisy/releases/latest). Get the app from our [releases page](https://github.com/jobobby04/tachiyomisy/releases/latest).
@@ -92,9 +93,9 @@ Please make sure to read the full guidelines. Your issue may be closed without w
* For large logs use http://pastebin.com/ (or similar) * For large logs use http://pastebin.com/ (or similar)
* Don't group unrelated requests into one issue * Don't group unrelated requests into one issue
DO: https://github.com/inorichi/tachiyomi/issues/24 https://github.com/inorichi/tachiyomi/issues/71 DO: https://github.com/tachiyomiorg/tachiyomi/issues/24 https://github.com/tachiyomiorg/tachiyomi/issues/71
DON'T: https://github.com/inorichi/tachiyomi/issues/75 DON'T: https://github.com/tachiyomiorg/tachiyomi/issues/75
</details> </details>
@@ -103,7 +104,17 @@ DON'T: https://github.com/inorichi/tachiyomi/issues/75
* Write a detailed issue, explaining what it should do or how. Avoid writing just "like X app does" * Write a detailed issue, explaining what it should do or how. Avoid writing just "like X app does"
* Include screenshot (if needed) * Include screenshot (if needed)
Source requests should be created at https://github.com/inorichi/tachiyomi-extensions, they do not belong in this repository. Source requests should be created at https://github.com/tachiyomiorg/tachiyomi-extensions, they do not belong in this repository.
</details>
<details><summary>Contributing</summary>
See [CONTRIBUTING.md](./CONTRIBUTING.md).
</details>
<details><summary>Code of Conduct</summary>
See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).
</details> </details>
## FAQ ## FAQ
-372
View File
@@ -1,372 +0,0 @@
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.github.zellius.shortcut-helper'
// Realm (EH)
apply plugin: 'realm-android'
shortcutHelper.filePath = './shortcuts.xml'
ext {
// Git is needed in your system PATH for these commands to work.
// If it's not installed, you can return a random value as a workaround
getCommitCount = {
return 'git rev-list --count HEAD'.execute().text.trim()
// return "1"
}
getGitSha = {
return 'git rev-parse --short HEAD'.execute().text.trim()
// return "1"
}
getBuildTime = {
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}
}
android {
compileSdkVersion AndroidConfig.compileSdk
buildToolsVersion AndroidConfig.buildTools
ndkVersion AndroidConfig.ndk
defaultConfig {
applicationId "eu.kanade.tachiyomi.sy"
minSdkVersion AndroidConfig.minSdk
targetSdkVersion AndroidConfig.targetSdk
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionCode 10
versionName "1.4.0"
buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
buildConfigField "boolean", "INCLUDE_UPDATER", "true"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
}
}
buildFeatures {
viewBinding = true
}
buildTypes {
debug {
versionNameSuffix "-${getCommitCount()}"
applicationIdSuffix ".debug"
}
releaseTest {
applicationIdSuffix ".rt"
// minifyEnabled true
// shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "default"
productFlavors {
standard {
buildConfigField "boolean", "INCLUDE_UPDATER", "true"
dimension "default"
}
fdroid {
dimension "default"
}
dev {
resConfigs "en", "xxhdpi"
dimension "default"
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/*.kotlin_module'
// Compatibility for two RxJava versions (EXH)
exclude 'META-INF/rxjava.properties'
}
dependenciesInfo {
includeInApk = false
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
abortOnError false
checkReleaseBuilds false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
androidExtensions {
experimental = true
}
dependencies {
// Source models and interfaces from Tachiyomi 1.x
implementation 'tachiyomi.sourceapi:source-api:1.1'
// AndroidX libraries
implementation 'androidx.annotation:annotation:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha01'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-alpha1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'androidx.core:core-ktx:1.5.0-alpha05'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.0-beta01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01'
final lifecycle_version = '2.3.0-beta01'
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
// Job scheduling
implementation "androidx.work:work-runtime-ktx:2.5.0-beta02"
// UI library
implementation 'com.google.android.material:material:1.3.0-alpha04'
standardImplementation 'com.google.firebase:firebase-core:18.0.0'
// ReactiveX
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.8'
implementation 'com.jakewharton.rxrelay:rxrelay:1.2.0'
implementation 'com.github.pwittchen:reactivenetwork:0.13.0'
// Network client
final okhttp_version = '4.10.0-RC1'
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation "com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttp_version"
implementation 'com.squareup.okio:okio:2.9.0'
// TLS 1.3 support for Android < 10
implementation 'org.conscrypt:conscrypt-android:2.5.1'
// REST
final retrofit_version = '2.9.0'
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
// JSON
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
// JavaScript engine
implementation 'com.squareup.duktape:duktape-android:1.3.0'
// Disk
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation 'com.github.inorichi:unifile:e9ee588'
implementation 'com.github.junrar:junrar:7.4.0'
// HTML parser
implementation 'org.jsoup:jsoup:1.13.1'
// [EXH] Android 7 SSL Workaround
implementation 'com.google.android.gms:play-services-safetynet:17.0.0'
// Changelog
implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
// Database
implementation 'androidx.sqlite:sqlite-ktx:2.1.0'
implementation 'com.github.inorichi.storio:storio-common:8be19de@aar'
implementation 'com.github.inorichi.storio:storio-sqlite:8be19de@aar'
implementation 'io.requery:sqlite-android:3.33.0'
// Preferences
implementation 'com.github.tfcporciuncula.flow-preferences:flow-preferences:1.3.3'
// Model View Presenter
final nucleus_version = '3.0.0'
implementation "info.android15.nucleus:nucleus:$nucleus_version"
implementation "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
// Dependency injection
implementation "com.github.inorichi.injekt:injekt-core:65b0440"
// Image library
final glide_version = '4.11.0'
implementation "com.github.bumptech.glide:glide:$glide_version"
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
implementation 'com.github.tachiyomiorg:subsampling-scale-image-view:6caf219'
// Logging
implementation 'com.jakewharton.timber:timber:4.7.1'
// Crash reports
//implementation 'ch.acra:acra-http:5.7.0'
// Sort
implementation 'com.github.gpanther:java-nat-sort:natural-comparator-1.1'
// UI
implementation 'com.dmitrymalkovich.android:material-design-dimens:1.4'
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
implementation 'eu.davidea:flexible-adapter:5.1.0'
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
implementation 'com.nononsenseapps:filepicker:2.5.2'
implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a'
// 3.2.0+ introduces weird UI blinking or cut off issues on some devices
final material_dialogs_version = '3.1.1'
implementation "com.afollestad.material-dialogs:core:$material_dialogs_version"
implementation "com.afollestad.material-dialogs:input:$material_dialogs_version"
implementation "com.afollestad.material-dialogs:datetime:$material_dialogs_version"
// Conductor
implementation 'com.bluelinelabs:conductor:2.1.5'
implementation("com.bluelinelabs:conductor-support:2.1.5") {
exclude group: "com.android.support"
}
implementation 'com.github.tachiyomiorg:conductor-support-preference:1.1.1'
// FlowBinding
final flowbinding_version = '0.12.0'
implementation "io.github.reactivecircus.flowbinding:flowbinding-android:$flowbinding_version"
implementation "io.github.reactivecircus.flowbinding:flowbinding-appcompat:$flowbinding_version"
implementation "io.github.reactivecircus.flowbinding:flowbinding-recyclerview:$flowbinding_version"
implementation "io.github.reactivecircus.flowbinding:flowbinding-swiperefreshlayout:$flowbinding_version"
implementation "io.github.reactivecircus.flowbinding:flowbinding-viewpager:$flowbinding_version"
// Licenses
implementation "com.mikepenz:aboutlibraries:$BuildPluginsVersion.ABOUTLIB_PLUGIN"
// Tests
testImplementation 'junit:junit:4.13'
testImplementation 'org.assertj:assertj-core:3.16.1'
testImplementation 'org.mockito:mockito-core:1.10.19'
final robolectric_version = '3.1.4'
testImplementation "org.robolectric:robolectric:$robolectric_version"
testImplementation "org.robolectric:shadows-multidex:$robolectric_version"
testImplementation "org.robolectric:shadows-play-services:$robolectric_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$BuildPluginsVersion.KOTLIN"
final coroutines_version = '1.4.1'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
// For detecting memory leaks; see https://square.github.io/leakcanary/
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// SY for mangadex utils
implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.0.1"
// Text distance (EH)
implementation 'info.debatty:java-string-similarity:2.0.0'
// Firebase (EH)
implementation 'com.google.firebase:firebase-analytics-ktx:18.0.0'
implementation 'com.google.firebase:firebase-crashlytics-ktx:17.3.0'
// Better logging (EH)
implementation 'com.elvishew:xlog:1.7.1'
// Debug utils (EH)
final def debug_overlay_version = '1.1.3'
debugImplementation "com.ms-square:debugoverlay:$debug_overlay_version"
releaseTestImplementation "com.ms-square:debugoverlay:$debug_overlay_version"
releaseImplementation "com.ms-square:debugoverlay-no-op:$debug_overlay_version"
testImplementation "com.ms-square:debugoverlay-no-op:$debug_overlay_version"
// RatingBar (SY)
implementation 'me.zhanghai.android.materialratingbar:library:1.4.0'
// JsonReader for similar manga
implementation 'com.squareup.moshi:moshi:1.11.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$BuildPluginsVersion.KOTLIN"
}
}
repositories {
mavenCentral()
jcenter()
}
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api-markers
tasks.withType(AbstractKotlinCompile).all {
kotlinOptions.freeCompilerArgs += [
"-Xopt-in=kotlin.Experimental",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xuse-experimental=kotlin.ExperimentalStdlibApi",
"-Xuse-experimental=kotlinx.coroutines.FlowPreview",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xuse-experimental=kotlinx.serialization.ExperimentalSerializationApi",
]
}
// Duplicating Hebrew string assets due to some locale code issues on different devices
task copyHebrewStrings(type: Copy) {
from './src/main/res/values-he'
into './src/main/res/values-iw'
include '**/*'
}
preBuild.dependsOn(formatKotlin, copyHebrewStrings)
if (!getGradle().getStartParameter().getTaskRequests().toString().contains("Debug")) {
apply plugin: 'com.google.gms.google-services'
// Firebase Crashlytics
apply plugin: 'com.google.firebase.crashlytics'
}
+367
View File
@@ -0,0 +1,367 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
plugins {
id("com.android.application")
id("com.mikepenz.aboutlibraries.plugin")
kotlin("android")
kotlin("plugin.parcelize")
kotlin("plugin.serialization")
id("com.github.zellius.shortcut-helper")
// Realm (EH)
kotlin("kapt")
id("realm-android")
}
if (!gradle.startParameter.taskRequests.toString().contains("Debug")) {
apply(plugin = "com.google.gms.google-services")
// Firebase Crashlytics
apply(plugin = "com.google.firebase.crashlytics")
}
shortcutHelper.setFilePath("./shortcuts.xml")
android {
compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(AndroidConfig.buildTools)
ndkVersion = AndroidConfig.ndk
defaultConfig {
applicationId = "eu.kanade.tachiyomi.sy"
minSdkVersion(AndroidConfig.minSdk)
targetSdkVersion(AndroidConfig.targetSdk)
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
versionCode = 19
versionName = "1.7.0"
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
multiDexEnabled = true
ndk {
abiFilters += setOf("armeabi-v7a", "arm64-v8a", "x86")
}
}
buildFeatures {
viewBinding = true
}
buildTypes {
named("debug") {
versionNameSuffix = "-${getCommitCount()}"
applicationIdSuffix = ".debug"
}
create("releaseTest") {
applicationIdSuffix = ".rt"
//isMinifyEnabled = true
//isShrinkResources = true
setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
}
named("release") {
isMinifyEnabled = true
isShrinkResources = true
setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
}
}
flavorDimensions("default")
productFlavors {
create("standard") {
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
dimension = "default"
}
create("fdroid") {
dimension = "default"
}
create("dev") {
resConfigs("en", "xxhdpi")
dimension = "default"
}
}
packagingOptions {
exclude("META-INF/DEPENDENCIES")
exclude("LICENSE.txt")
exclude("META-INF/LICENSE")
exclude("META-INF/LICENSE.txt")
exclude("META-INF/NOTICE")
exclude("META-INF/*.kotlin_module")
// Compatibility for two RxJava versions (EXH)
exclude("META-INF/rxjava.properties")
}
dependenciesInfo {
includeInApk = false
}
lintOptions {
disable("MissingTranslation", "ExtraTranslation")
isAbortOnError = false
isCheckReleaseBuilds = false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {
// Source models and interfaces from Tachiyomi 1.x
implementation("org.tachiyomi:source-api:1.1")
// AndroidX libraries
implementation("androidx.annotation:annotation:1.3.0-alpha01")
implementation("androidx.appcompat:appcompat:1.4.0-alpha01")
implementation("androidx.biometric:biometric-ktx:1.2.0-alpha03")
implementation("androidx.browser:browser:1.3.0")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.0-beta02")
implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
implementation("androidx.core:core-ktx:1.6.0-beta01")
implementation("androidx.multidex:multidex:2.0.1")
implementation("androidx.preference:preference-ktx:1.1.1")
implementation("androidx.recyclerview:recyclerview:1.2.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01")
val lifecycleVersion = "2.4.0-alpha01"
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
// Job scheduling
implementation("androidx.work:work-runtime-ktx:2.7.0-alpha03")
// UI library
implementation("com.google.android.material:material:1.4.0-beta01")
"standardImplementation"("com.google.firebase:firebase-core:19.0.0")
// ReactiveX
implementation("io.reactivex:rxandroid:1.2.1")
implementation("io.reactivex:rxjava:1.3.8")
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
implementation("com.github.pwittchen:reactivenetwork:0.13.0")
// Network client
val okhttpVersion = "4.9.1"
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
implementation("com.squareup.okio:okio:2.10.0")
// TLS 1.3 support for Android < 10
implementation("org.conscrypt:conscrypt-android:2.5.1")
// JSON
val kotlinSerializationVersion = "1.1.0"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinSerializationVersion")
implementation("com.google.code.gson:gson:2.8.6")
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
// JavaScript engine
implementation("com.squareup.duktape:duktape-android:1.3.0")
// Disk
implementation("com.jakewharton:disklrucache:2.0.2")
implementation("com.github.tachiyomiorg:unifile:17bec43")
implementation("com.github.junrar:junrar:7.4.0")
// HTML parser
implementation("org.jsoup:jsoup:1.13.1")
// Database
implementation("androidx.sqlite:sqlite-ktx:2.1.0")
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
implementation("com.github.requery:sqlite-android:3.35.5")
// Preferences
implementation("com.github.tfcporciuncula.flow-preferences:flow-preferences:1.4.0")
// Model View Presenter
val nucleusVersion = "3.0.0"
implementation("info.android15.nucleus:nucleus:$nucleusVersion")
implementation("info.android15.nucleus:nucleus-support-v7:$nucleusVersion")
// Dependency injection
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
// Image library
val coilVersion = "1.2.0"
implementation("io.coil-kt:coil:$coilVersion")
implementation("io.coil-kt:coil-gif:$coilVersion")
implementation("com.github.tachiyomiorg:subsampling-scale-image-view:846abe0") {
exclude(module = "image-decoder")
}
implementation("com.github.tachiyomiorg:image-decoder:7a44c9b")
// Logging
implementation("com.jakewharton.timber:timber:4.7.1")
// Crash reports
//implementation("ch.acra:acra-http:5.7.0")
// Sort
implementation("com.github.gpanther:java-nat-sort:natural-comparator-1.1")
// UI
implementation("com.github.dmytrodanylyk.android-process-button:library:1.0.4")
implementation("eu.davidea:flexible-adapter:5.1.0")
implementation("eu.davidea:flexible-adapter-ui:1.0.0")
implementation("com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0")
implementation("com.github.chrisbanes:PhotoView:2.3.0")
implementation("com.github.tachiyomiorg:DirectionalViewPager:1.0.0")
implementation("dev.chrisbanes.insetter:insetter:0.6.0")
// 3.2.0+ introduces weird UI blinking or cut off issues on some devices
val materialDialogsVersion = "3.1.1"
implementation("com.afollestad.material-dialogs:core:$materialDialogsVersion")
implementation("com.afollestad.material-dialogs:input:$materialDialogsVersion")
implementation("com.afollestad.material-dialogs:datetime:$materialDialogsVersion")
// Conductor
implementation("com.bluelinelabs:conductor:2.1.5")
implementation("com.bluelinelabs:conductor-support:2.1.5") {
exclude(group = "com.android.support")
}
implementation("com.github.tachiyomiorg:conductor-support-preference:2.0.1")
// FlowBinding
val flowbindingVersion = "1.0.0"
implementation("io.github.reactivecircus.flowbinding:flowbinding-android:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-appcompat:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-recyclerview:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-swiperefreshlayout:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-viewpager:$flowbindingVersion")
// Licenses
implementation("com.mikepenz:aboutlibraries:${BuildPluginsVersion.ABOUTLIB_PLUGIN}")
// Tests
testImplementation("junit:junit:4.13.2")
testImplementation("org.assertj:assertj-core:3.16.1")
testImplementation("org.mockito:mockito-core:1.10.19")
val robolectricVersion = "3.1.4"
testImplementation("org.robolectric:robolectric:$robolectricVersion")
testImplementation("org.robolectric:shadows-multidex:$robolectricVersion")
testImplementation("org.robolectric:shadows-play-services:$robolectricVersion")
implementation(kotlin("reflect", version = BuildPluginsVersion.KOTLIN))
val coroutinesVersion = "1.5.0"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
// For detecting memory leaks; see https://square.github.io/leakcanary/
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7")
// SY -->
// [EXH] Android 7 SSL Workaround
implementation("com.google.android.gms:play-services-safetynet:17.0.0")
// Changelog
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")
// Text distance (EH)
implementation ("info.debatty:java-string-similarity:2.0.0")
// Firebase (EH)
implementation("com.google.firebase:firebase-analytics-ktx:19.0.0")
implementation("com.google.firebase:firebase-crashlytics-ktx:18.0.0")
// Better logging (EH)
implementation("com.elvishew:xlog:1.9.0")
// Debug utils (EH)
val debugOverlayVersion = "1.1.3"
debugImplementation("com.ms-square:debugoverlay:$debugOverlayVersion")
"releaseTestImplementation"("com.ms-square:debugoverlay-no-op:$debugOverlayVersion")
releaseImplementation("com.ms-square:debugoverlay-no-op:$debugOverlayVersion")
testImplementation("com.ms-square:debugoverlay-no-op:$debugOverlayVersion")
// RatingBar (SY)
implementation("me.zhanghai.android.materialratingbar:library:1.4.0")
}
tasks {
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xopt-in=kotlin.Experimental",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xuse-experimental=kotlin.ExperimentalStdlibApi",
"-Xuse-experimental=kotlinx.coroutines.FlowPreview",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi",
"-Xuse-experimental=kotlinx.serialization.ExperimentalSerializationApi",
"-Xuse-experimental=coil.annotation.ExperimentalCoilApi",
)
}
// Duplicating Hebrew string assets due to some locale code issues on different devices
val copyHebrewStrings = task("copyHebrewStrings", type = Copy::class) {
from("./src/main/res/values-he")
into("./src/main/res/values-iw")
include("**/*")
}
preBuild {
dependsOn(formatKotlin, copyHebrewStrings)
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(kotlin("gradle-plugin", version = BuildPluginsVersion.KOTLIN))
}
}
// Git is needed in your system PATH for these commands to work.
// If it's not installed, you can return a random value as a workaround
fun getCommitCount(): String {
return runCommand("git rev-list --count HEAD")
// return "1"
}
fun getGitSha(): String {
return runCommand("git rev-parse --short HEAD")
// return "1"
}
fun getBuildTime(): String {
val df = SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
df.timeZone = TimeZone.getTimeZone("UTC")
return df.format(Date())
}
fun runCommand(command: String): String {
val byteOut = ByteArrayOutputStream()
project.exec {
commandLine = command.split(" ")
standardOutput = byteOut
}
return String(byteOut.toByteArray()).trim()
}
+34
View File
@@ -0,0 +1,34 @@
-allowaccessmodification
-dontusemixedcaseclassnames
-verbose
-keepattributes *Annotation*
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <init>(...);
}
+15 -42
View File
@@ -58,6 +58,7 @@
kotlinx.serialization.KSerializer serializer(...); kotlinx.serialization.KSerializer serializer(...);
} }
# Filter serializer
-keep,includedescriptorclasses class xyz.nulldev.ts.api.http.serializer.**$$serializer { *; } -keep,includedescriptorclasses class xyz.nulldev.ts.api.http.serializer.**$$serializer { *; }
-keepclassmembers class xyz.nulldev.ts.api.http.serializer.** { -keepclassmembers class xyz.nulldev.ts.api.http.serializer.** {
*** Companion; *** Companion;
@@ -66,37 +67,22 @@
kotlinx.serialization.KSerializer serializer(...); kotlinx.serialization.KSerializer serializer(...);
} }
# Madokami extension username and password crash fix # Keep extension's common dependencies
-keepclassmembers class androidx.preference.EditTextPreference { -keep,allowoptimization class eu.kanade.tachiyomi.** { public protected *; }
*** mOnBindEditTextListener; -keep,allowoptimization class kotlin.** { public protected *; }
*** mText; -keep,allowoptimization class okhttp3.** { public protected *; }
public *; -keep,allowoptimization class rx.** { public protected *; }
} -keep,allowoptimization class org.jsoup.** { public protected *; }
-keep,allowoptimization class com.google.gson.** { public protected *; }
# Hitomi extension crash fix -keep,allowoptimization class com.github.salomonbrys.kotson.** { public protected *; }
-keepclassmembers class rx.Single { -keep,allowoptimization class com.squareup.duktape.** { public protected *; }
*** onSubscribe; -keep,allowoptimization class androidx.preference.** { *; }
final *; -keep,allowoptimization class okio.** { *; }
protected *; -keep,allowoptimization class kotlinx.serialization.** { *; }
public *;
}
# RxJava 1.1.0 # RxJava 1.1.0
-dontwarn sun.misc.** -dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
-dontnote rx.internal.util.PlatformDependent -dontnote rx.internal.util.PlatformDependent
# === Reactive network: https://github.com/pwittchen/ReactiveNetwork/tree/v0.12.4#proguard-configuration # === Reactive network: https://github.com/pwittchen/ReactiveNetwork/tree/v0.12.4#proguard-configuration
@@ -133,8 +119,9 @@
# Application classes that will be serialized/deserialized over Gson # Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; } -keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapterFactory, # Prevent proguard from stripping interface information from TypeAdapterFactory, TypeAdapter,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer -keep class * implements com.google.gson.JsonDeserializer
@@ -155,20 +142,6 @@
## From original config: "Attempt to fix: java.lang.NoClassDefFoundError: uy.kohesive.injekt.registry.default.DefaultRegistrar$NOKEY$1" ## From original config: "Attempt to fix: java.lang.NoClassDefFoundError: uy.kohesive.injekt.registry.default.DefaultRegistrar$NOKEY$1"
-keep class uy.kohesive.injekt.** { *; } -keep class uy.kohesive.injekt.** { *; }
# === Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
# === Glide-transformations: https://github.com/wasabeef/glide-transformations/blob/3aa8e53c6a51b8351d312f802ba1354c5b115168/transformations/proguard-rules.txt
-dontwarn jp.co.cyberagent.android.gpuimage.**
# === Conductor # === Conductor
# This isn't in the consumer proguard rules yet: https://github.com/bluelinelabs/Conductor/pull/550/files # This isn't in the consumer proguard rules yet: https://github.com/bluelinelabs/Conductor/pull/550/files
-keepclassmembers public class * extends com.bluelinelabs.conductor.ControllerChangeHandler { -keepclassmembers public class * extends com.bluelinelabs.conductor.ControllerChangeHandler {
+1 -1
View File
@@ -17,7 +17,7 @@
android:shortcutDisabledMessage="@string/app_not_available" android:shortcutDisabledMessage="@string/app_not_available"
android:shortcutId="show_recently_updated" android:shortcutId="show_recently_updated"
android:shortcutLongLabel="@string/label_recent_updates" android:shortcutLongLabel="@string/label_recent_updates"
android:shortcutShortLabel="@string/short_recent_updates"> android:shortcutShortLabel="@string/label_recent_updates">
<intent <intent
android:action="eu.kanade.tachiyomi.SHOW_RECENTLY_UPDATED" android:action="eu.kanade.tachiyomi.SHOW_RECENTLY_UPDATED"
android:targetClass="eu.kanade.tachiyomi.ui.main.MainActivity" /> android:targetClass="eu.kanade.tachiyomi.ui.main.MainActivity" />
+80 -47
View File
@@ -2,16 +2,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.kanade.tachiyomi"> package="eu.kanade.tachiyomi">
<!-- Internet -->
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- Storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- For background jobs -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- For managing extensions -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- To view extension packages in API 30+ -->
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<application <application
android:name=".App" android:name=".App"
@@ -24,7 +33,7 @@
android:largeHeap="true" android:largeHeap="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.Tachiyomi.Light" android:theme="@style/Theme.Base"
android:networkSecurityConfig="@xml/network_security_config"> android:networkSecurityConfig="@xml/network_security_config">
<activity <activity
android:name=".ui.main.MainActivity" android:name=".ui.main.MainActivity"
@@ -43,7 +52,7 @@
android:name=".ui.main.DeepLinkActivity" android:name=".ui.main.DeepLinkActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@android:style/Theme.NoDisplay" android:theme="@android:style/Theme.NoDisplay"
android:label="@string/process_text_action_name"> android:label="@string/action_global_search">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.SEARCH" />
<action android:name="com.google.android.gms.actions.SEARCH_ACTION" /> <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
@@ -55,7 +64,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" /> <data android:mimeType="text/plain" />
</intent-filter> </intent-filter>
@@ -75,15 +84,11 @@
android:resource="@xml/s_pen_actions"/> android:resource="@xml/s_pen_actions"/>
</activity> </activity>
<activity <activity
android:name=".ui.security.BiometricUnlockActivity" android:name=".ui.security.UnlockActivity"
android:theme="@style/Theme.Splash" /> android:theme="@style/Theme.Base" />
<activity <activity
android:name=".ui.webview.WebViewActivity" android:name=".ui.webview.WebViewActivity"
android:configChanges="uiMode|orientation|screenSize" /> android:configChanges="uiMode|orientation|screenSize" />
<activity
android:name=".widget.CustomLayoutPickerActivity"
android:label="@string/app_name"
android:theme="@style/FilePickerTheme" />
<activity <activity
android:name=".ui.setting.track.AnilistLoginActivity" android:name=".ui.setting.track.AnilistLoginActivity"
android:label="Anilist"> android:label="Anilist">
@@ -100,7 +105,18 @@
</activity> </activity>
<activity <activity
android:name=".ui.setting.track.MyAnimeListLoginActivity" android:name=".ui.setting.track.MyAnimeListLoginActivity"
android:configChanges="uiMode|orientation|screenSize" /> android:label="MyAnimeList">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="myanimelist-auth"
android:scheme="tachiyomi" />
</intent-filter>
</activity>
<activity <activity
android:name=".ui.setting.track.ShikimoriLoginActivity" android:name=".ui.setting.track.ShikimoriLoginActivity"
android:label="Shikimori"> android:label="Shikimori">
@@ -134,6 +150,10 @@
android:name=".extension.util.ExtensionInstallActivity" android:name=".extension.util.ExtensionInstallActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" /> android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="exh.ui.login.EhLoginActivity"
android:label="EHentaiLogin" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider" android:authorities="${applicationId}.provider"
@@ -169,10 +189,6 @@
android:exported="false" /> android:exported="false" />
<!-- EH --> <!-- EH -->
<service
android:name="exh.md.similar.SimilarUpdateService"
android:exported="false" />
<service <service
android:name="exh.eh.EHentaiUpdateWorker" android:name="exh.eh.EHentaiUpdateWorker"
android:permission="android.permission.BIND_JOB_SERVICE" android:permission="android.permission.BIND_JOB_SERVICE"
@@ -180,7 +196,7 @@
<activity <activity
android:name="exh.ui.intercept.InterceptActivity" android:name="exh.ui.intercept.InterceptActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/Theme.EHActivity"> android:theme="@style/Theme.Base">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
@@ -190,39 +206,39 @@
<!-- EH --> <!-- EH -->
<data <data
android:host="g.e-hentai.org" android:host="g.e-hentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="g.e-hentai.org" android:host="g.e-hentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="https" /> android:scheme="https" />
<data <data
android:host="e-hentai.org" android:host="e-hentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="e-hentai.org" android:host="e-hentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="https" /> android:scheme="https" />
<!-- EXH --> <!-- EXH -->
<data <data
android:host="exhentai.org" android:host="exhentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="exhentai.org" android:host="exhentai.org"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="https" /> android:scheme="https" />
<!-- nhentai --> <!-- nhentai -->
<data <data
android:host="nhentai.net" android:host="nhentai.net"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="nhentai.net" android:host="nhentai.net"
android:pathPattern="/g/.*" android:pathPrefix="/g/"
android:scheme="https" /> android:scheme="https" />
<!-- Perv Eden --> <!-- Perv Eden -->
@@ -238,57 +254,57 @@
<!-- Hentai Cafe --> <!-- Hentai Cafe -->
<data <data
android:host="hentai.cafe" android:host="hentai.cafe"
android:pathPattern="/.*/.*" android:pathPrefix="/hc.fyi/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="hentai.cafe" android:host="hentai.cafe"
android:pathPattern="/.*/.*" android:pathPrefix="/hc.fyi/"
android:scheme="https" /> android:scheme="https" />
<!-- Tsumino --> <!-- Tsumino -->
<data <data
android:host="www.tsumino.com" android:host="www.tsumino.com"
android:pathPattern="/Book/Info/.*" android:pathPrefix="/Book/Info/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="www.tsumino.com" android:host="www.tsumino.com"
android:pathPattern="/Book/Info/.*" android:pathPrefix="/Book/Info/"
android:scheme="https" /> android:scheme="https" />
<data <data
android:host="www.tsumino.com" android:host="www.tsumino.com"
android:pathPattern="/Read/View/.*" android:pathPrefix="/Read/View/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="www.tsumino.com" android:host="www.tsumino.com"
android:pathPattern="/Read/View/.*" android:pathPrefix="/Read/View/"
android:scheme="https" /> android:scheme="https" />
<!-- Hitomi.la --> <!-- Hitomi.la -->
<data <data
android:host="hitomi.la" android:host="hitomi.la"
android:pathPattern="/galleries/.*" android:pathPrefix="/galleries/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="hitomi.la" android:host="hitomi.la"
android:pathPattern="/reader/.*" android:pathPrefix="/reader/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="hitomi.la" android:host="hitomi.la"
android:pathPattern="/galleries/.*" android:pathPrefix="/galleries/"
android:scheme="https" /> android:scheme="https" />
<data <data
android:host="hitomi.la" android:host="hitomi.la"
android:pathPattern="/reader/.*" android:pathPrefix="/reader/"
android:scheme="https" /> android:scheme="https" />
<!-- Pururin.io --> <!-- Pururin.io -->
<data <data
android:host="pururin.io" android:host="pururin.io"
android:pathPattern="/gallery/.*" android:pathPrefix="/gallery/"
android:scheme="http" /> android:scheme="http" />
<data <data
android:host="pururin.io" android:host="pururin.io"
android:pathPattern="/gallery/.*" android:pathPrefix="/gallery/"
android:scheme="https" /> android:scheme="https" />
<!-- HBrowse --> <!-- HBrowse -->
@@ -300,44 +316,61 @@
android:scheme="https" /> android:scheme="https" />
<!-- MangaDex --> <!-- MangaDex -->
<data <!--<data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.org" android:host="www.mangadex.org"
android:pathPattern="/manga/..*" /> android:pathPrefix="/manga/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="mangadex.org" android:host="mangadex.org"
android:pathPattern="/manga/..*" /> android:pathPrefix="/manga/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.cc" android:host="www.mangadex.cc"
android:pathPattern="/manga/..*" /> android:pathPrefix="/manga/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.cc" android:host="www.mangadex.cc"
android:pathPattern="/manga/..*" /> android:pathPrefix="/manga/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.org" android:host="www.mangadex.org"
android:pathPattern="/title/..*" /> android:pathPrefix="/title/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="mangadex.org" android:host="mangadex.org"
android:pathPattern="/title/..*" /> android:pathPrefix="/title/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.cc" android:host="www.mangadex.cc"
android:pathPattern="/title/..*" /> android:pathPrefix="/title/" />
<data <data
android:scheme="https" android:scheme="https"
android:host="www.mangadex.cc" android:host="www.mangadex.cc"
android:pathPattern="/title/..*" /> android:pathPrefix="/title/" />
<data
android:scheme="https"
android:host="www.mangadex.org"
android:pathPrefix="/chapter/" />
<data
android:scheme="https"
android:host="mangadex.org"
android:pathPrefix="/chapter/" />
<data
android:scheme="https"
android:host="www.mangadex.cc"
android:pathPrefix="/chapter/" />
<data
android:scheme="https"
android:host="www.mangadex.cc"
android:pathPrefix="/chapter/" />-->
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name="exh.ui.captcha.BrowserActionActivity" android:name="exh.ui.captcha.BrowserActionActivity"
android:theme="@style/Theme.EHActivity" /> android:theme="@style/Theme.Base" />
</application> </application>
</manifest> </manifest>
+122 -64
View File
@@ -1,16 +1,29 @@
package eu.kanade.tachiyomi package eu.kanade.tachiyomi
import android.app.ActivityManager
import android.app.Application import android.app.Application
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.res.Configuration import android.content.res.Configuration
import android.graphics.Color import android.graphics.Color
import android.os.Build import android.os.Build
import android.os.Environment import android.os.Environment
import android.webkit.WebView
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.getSystemService
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.OnLifecycleEvent
import androidx.lifecycle.ProcessLifecycleOwner import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import androidx.multidex.MultiDex import androidx.multidex.MultiDex
import coil.ImageLoader
import coil.ImageLoaderFactory
import coil.decode.GifDecoder
import coil.decode.ImageDecoderDecoder
import com.elvishew.xlog.LogConfiguration import com.elvishew.xlog.LogConfiguration
import com.elvishew.xlog.LogLevel import com.elvishew.xlog.LogLevel
import com.elvishew.xlog.XLog import com.elvishew.xlog.XLog
@@ -22,73 +35,74 @@ import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import com.google.android.gms.common.GooglePlayServicesNotAvailableException import com.google.android.gms.common.GooglePlayServicesNotAvailableException
import com.google.android.gms.common.GooglePlayServicesRepairableException import com.google.android.gms.common.GooglePlayServicesRepairableException
import com.google.android.gms.security.ProviderInstaller import com.google.android.gms.security.ProviderInstaller
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase import com.google.firebase.ktx.Firebase
import com.ms_square.debugoverlay.DebugOverlay import com.ms_square.debugoverlay.DebugOverlay
import com.ms_square.debugoverlay.modules.FpsModule import com.ms_square.debugoverlay.modules.FpsModule
import eu.kanade.tachiyomi.data.coil.ByteBufferFetcher
import eu.kanade.tachiyomi.data.coil.MangaCoverFetcher
import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import eu.kanade.tachiyomi.util.system.notification
import exh.debug.DebugToggles import exh.debug.DebugToggles
import exh.log.CrashlyticsPrinter import exh.log.CrashlyticsPrinter
import exh.log.EHDebugModeOverlay import exh.log.EHDebugModeOverlay
import exh.log.EHLogLevel import exh.log.EHLogLevel
import exh.log.EnhancedFilePrinter import exh.log.EnhancedFilePrinter
import exh.log.XLogTree
import exh.log.xLogD
import exh.log.xLogE
import exh.syDebugVersion import exh.syDebugVersion
import io.realm.Realm import io.realm.Realm
import io.realm.RealmConfiguration import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import org.conscrypt.Conscrypt import org.conscrypt.Conscrypt
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.InjektScope import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import uy.kohesive.injekt.registry.default.DefaultRegistrar
import java.io.File import java.io.File
import java.security.NoSuchAlgorithmException import java.security.NoSuchAlgorithmException
import java.security.Security import java.security.Security
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import javax.net.ssl.SSLContext import javax.net.ssl.SSLContext
import kotlin.concurrent.thread
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
import kotlin.time.days import kotlin.time.days
open class App : Application(), LifecycleObserver { open class App : Application(), LifecycleObserver, ImageLoaderFactory {
private lateinit var firebaseAnalytics: FirebaseAnalytics private val preferences: PreferencesHelper by injectLazy()
private val disableIncognitoReceiver = DisableIncognitoReceiver()
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) // if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
setupExhLogging() // EXH logging setupExhLogging() // EXH logging
Timber.plant(XLogTree()) // SY Redirect Timber to XLog
if (!BuildConfig.DEBUG) addAnalytics() if (!BuildConfig.DEBUG) addAnalytics()
workaroundAndroid7BrokenSSL() workaroundAndroid7BrokenSSL()
// Debug tool; see https://fbflipper.com/
// SoLoader.init(this, false)
// if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) {
// val client = AndroidFlipperClient.getInstance(this)
// client.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()))
// client.addPlugin(DatabasesFlipperPlugin(this))
// client.start()
// }
// TLS 1.3 support for Android < 10 // TLS 1.3 support for Android < 10
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
Security.insertProviderAt(Conscrypt.newProvider(), 1) Security.insertProviderAt(Conscrypt.newProvider(), 1)
} }
Injekt = InjektScope(DefaultRegistrar()) // Avoid potential crashes
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
val process = getProcessName()
if (packageName != process) WebView.setDataDirectorySuffix(process)
}
Injekt.importModule(AppModule(this)) Injekt.importModule(AppModule(this))
setupNotificationChannels() setupNotificationChannels()
Realm.init(this) Realm.init(this)
GlobalScope.launch { deleteOldMetadataRealm() } // Delete old metadata DB (EH)
if ((BuildConfig.DEBUG || BuildConfig.BUILD_TYPE == "releaseTest") && DebugToggles.ENABLE_DEBUG_OVERLAY.enabled) { if ((BuildConfig.DEBUG || BuildConfig.BUILD_TYPE == "releaseTest") && DebugToggles.ENABLE_DEBUG_OVERLAY.enabled) {
setupDebugOverlay() setupDebugOverlay()
} }
@@ -96,6 +110,34 @@ open class App : Application(), LifecycleObserver {
LocaleHelper.updateConfiguration(this, resources.configuration) LocaleHelper.updateConfiguration(this, resources.configuration)
ProcessLifecycleOwner.get().lifecycle.addObserver(this) ProcessLifecycleOwner.get().lifecycle.addObserver(this)
// Show notification to disable Incognito Mode when it's enabled
preferences.incognitoMode().asFlow()
.onEach { enabled ->
val notificationManager = NotificationManagerCompat.from(this)
if (enabled) {
disableIncognitoReceiver.register()
val notification = notification(Notifications.CHANNEL_INCOGNITO_MODE) {
setContentTitle(getString(R.string.pref_incognito_mode))
setContentText(getString(R.string.notification_incognito_text))
setSmallIcon(R.drawable.ic_glasses_black_24dp)
setOngoing(true)
val pendingIntent = PendingIntent.getBroadcast(
this@App,
0,
Intent(ACTION_DISABLE_INCOGNITO_MODE),
PendingIntent.FLAG_ONE_SHOT
)
setContentIntent(pendingIntent)
}
notificationManager.notify(Notifications.ID_INCOGNITO_MODE, notification)
} else {
disableIncognitoReceiver.unregister()
notificationManager.cancel(Notifications.ID_INCOGNITO_MODE)
}
}
.launchIn(ProcessLifecycleOwner.get().lifecycleScope)
} }
override fun attachBaseContext(base: Context) { override fun attachBaseContext(base: Context) {
@@ -108,6 +150,23 @@ open class App : Application(), LifecycleObserver {
LocaleHelper.updateConfiguration(this, newConfig, true) LocaleHelper.updateConfiguration(this, newConfig, true)
} }
override fun newImageLoader(): ImageLoader {
return ImageLoader.Builder(this).apply {
componentRegistry {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
add(ImageDecoderDecoder(this@App))
} else {
add(GifDecoder())
}
add(ByteBufferFetcher())
add(MangaCoverFetcher())
}
okHttpClient(Injekt.get<NetworkHelper>().coilClient)
crossfade(300)
allowRgb565(getSystemService<ActivityManager>()!!.isLowRamDevice)
}.build()
}
private fun workaroundAndroid7BrokenSSL() { private fun workaroundAndroid7BrokenSSL() {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N || if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N ||
Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1 Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1
@@ -115,30 +174,28 @@ open class App : Application(), LifecycleObserver {
try { try {
SSLContext.getInstance("TLSv1.2") SSLContext.getInstance("TLSv1.2")
} catch (e: NoSuchAlgorithmException) { } catch (e: NoSuchAlgorithmException) {
XLog.tag("Init").e("Could not install Android 7 broken SSL workaround!", e) xLogE("Could not install Android 7 broken SSL workaround!", e)
} }
try { try {
ProviderInstaller.installIfNeeded(applicationContext) ProviderInstaller.installIfNeeded(applicationContext)
} catch (e: GooglePlayServicesRepairableException) { } catch (e: GooglePlayServicesRepairableException) {
XLog.tag("Init").e("Could not install Android 7 broken SSL workaround!", e) xLogE("Could not install Android 7 broken SSL workaround!", e)
} catch (e: GooglePlayServicesNotAvailableException) { } catch (e: GooglePlayServicesNotAvailableException) {
XLog.tag("Init").e("Could not install Android 7 broken SSL workaround!", e) xLogE("Could not install Android 7 broken SSL workaround!", e)
} }
} }
} }
private fun addAnalytics() { private fun addAnalytics() {
firebaseAnalytics = Firebase.analytics
if (syDebugVersion != "0") { if (syDebugVersion != "0") {
firebaseAnalytics.setUserProperty("preview_version", syDebugVersion) Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
} }
} }
@OnLifecycleEvent(Lifecycle.Event.ON_STOP) @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
@Suppress("unused") @Suppress("unused")
fun onAppBackgrounded() { fun onAppBackgrounded() {
val preferences: PreferencesHelper by injectLazy()
if (preferences.lockAppAfter().get() >= 0) { if (preferences.lockAppAfter().get() >= 0) {
SecureActivityDelegate.locked = true SecureActivityDelegate.locked = true
} }
@@ -148,36 +205,13 @@ open class App : Application(), LifecycleObserver {
Notifications.createChannels(this) Notifications.createChannels(this)
} }
// EXH
private fun deleteOldMetadataRealm() {
val config = RealmConfiguration.Builder()
.name("gallery-metadata.realm")
.schemaVersion(3)
.deleteRealmIfMigrationNeeded()
.build()
Realm.deleteRealm(config)
// Delete old paper db files
listOf(
File(filesDir, "gallery-ex"),
File(filesDir, "gallery-perveden"),
File(filesDir, "gallery-nhentai")
).forEach {
if (it.exists()) {
thread {
it.deleteRecursively()
}
}
}
}
// EXH // EXH
private fun setupExhLogging() { private fun setupExhLogging() {
EHLogLevel.init(this) EHLogLevel.init(this)
val logLevel = when { val logLevel = when {
EHLogLevel.shouldLog(EHLogLevel.EXTRA) -> LogLevel.ALL EHLogLevel.shouldLog(EHLogLevel.EXTREME) -> LogLevel.ALL
BuildConfig.DEBUG -> LogLevel.DEBUG EHLogLevel.shouldLog(EHLogLevel.EXTRA) || BuildConfig.DEBUG -> LogLevel.DEBUG
else -> LogLevel.WARN else -> LogLevel.WARN
} }
@@ -199,9 +233,8 @@ open class App : Application(), LifecycleObserver {
@OptIn(ExperimentalTime::class) @OptIn(ExperimentalTime::class)
printers += EnhancedFilePrinter printers += EnhancedFilePrinter
.Builder(logFolder.absolutePath) .Builder(logFolder.absolutePath) {
.fileNameGenerator( fileNameGenerator = object : DateFileNameGenerator() {
object : DateFileNameGenerator() {
override fun generateFileName(logLevel: Int, timestamp: Long): String { override fun generateFileName(logLevel: Int, timestamp: Long): String {
return super.generateFileName( return super.generateFileName(
logLevel, logLevel,
@@ -209,13 +242,12 @@ open class App : Application(), LifecycleObserver {
) + "-${BuildConfig.BUILD_TYPE}.log" ) + "-${BuildConfig.BUILD_TYPE}.log"
} }
} }
) flattener { timeMillis, level, tag, message ->
.flattener { timeMillis, level, tag, message -> "${dateFormat.format(timeMillis)} ${LogLevel.getShortLevelName(level)}/$tag: $message"
"${dateFormat.format(timeMillis)} ${LogLevel.getShortLevelName(level)}/$tag: $message" }
cleanStrategy = FileLastModifiedCleanStrategy(7.days.toLongMilliseconds())
backupStrategy = NeverBackupStrategy()
} }
.cleanStrategy(FileLastModifiedCleanStrategy(7.days.toLongMilliseconds()))
.backupStrategy(NeverBackupStrategy())
.build()
// Install Crashlytics in prod // Install Crashlytics in prod
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
@@ -227,8 +259,8 @@ open class App : Application(), LifecycleObserver {
*printers.toTypedArray() *printers.toTypedArray()
) )
XLog.tag("Init").d("Application booting...") xLogD("Application booting...")
XLog.tag("Init").disableStackTrace().d( xLogD(
"App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE})\n" + "App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE})\n" +
"Preview build: $syDebugVersion\n" + "Preview build: $syDebugVersion\n" +
"Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT}) \n" + "Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT}) \n" +
@@ -253,7 +285,33 @@ open class App : Application(), LifecycleObserver {
.install() .install()
} catch (e: IllegalStateException) { } catch (e: IllegalStateException) {
// Crashes if app is in background // Crashes if app is in background
XLog.tag("Init").e("Failed to initialize debug overlay, app in background?", e) xLogE("Failed to initialize debug overlay, app in background?", e)
} }
} }
private inner class DisableIncognitoReceiver : BroadcastReceiver() {
private var registered = false
override fun onReceive(context: Context, intent: Intent) {
preferences.incognitoMode().set(false)
}
fun register() {
if (!registered) {
registerReceiver(this, IntentFilter(ACTION_DISABLE_INCOGNITO_MODE))
registered = true
}
}
fun unregister() {
if (registered) {
unregisterReceiver(this)
registered = false
}
}
}
companion object {
private const val ACTION_DISABLE_INCOGNITO_MODE = "tachi.action.DISABLE_INCOGNITO_MODE"
}
} }
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi package eu.kanade.tachiyomi
import android.app.Application import android.app.Application
import com.google.gson.Gson import android.os.Handler
import eu.kanade.tachiyomi.data.cache.ChapterCache import eu.kanade.tachiyomi.data.cache.ChapterCache
import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.DatabaseHelper
@@ -13,8 +13,6 @@ import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import exh.eh.EHentaiUpdateHelper import exh.eh.EHentaiUpdateHelper
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import uy.kohesive.injekt.api.InjektModule import uy.kohesive.injekt.api.InjektModule
import uy.kohesive.injekt.api.InjektRegistrar import uy.kohesive.injekt.api.InjektRegistrar
@@ -45,8 +43,6 @@ class AppModule(val app: Application) : InjektModule {
addSingletonFactory { TrackManager(app) } addSingletonFactory { TrackManager(app) }
addSingletonFactory { Gson() }
addSingletonFactory { Json { ignoreUnknownKeys = true } } addSingletonFactory { Json { ignoreUnknownKeys = true } }
// SY --> // SY -->
@@ -56,19 +52,20 @@ class AppModule(val app: Application) : InjektModule {
// SY <-- // SY <--
// Asynchronously init expensive components for a faster cold start // Asynchronously init expensive components for a faster cold start
Handler().post {
get<PreferencesHelper>()
GlobalScope.launch { get<PreferencesHelper>() } get<NetworkHelper>()
GlobalScope.launch { get<NetworkHelper>() } get<SourceManager>()
GlobalScope.launch { get<SourceManager>() } get<DatabaseHelper>()
GlobalScope.launch { get<DatabaseHelper>() } get<DownloadManager>()
GlobalScope.launch { get<DownloadManager>() } // SY -->
get<CustomMangaManager>()
// SY --> // SY <--
GlobalScope.launch { get<CustomMangaManager>() } }
// SY <--
} }
} }
@@ -1,5 +1,6 @@
package eu.kanade.tachiyomi package eu.kanade.tachiyomi
import android.os.Build
import androidx.core.content.edit import androidx.core.content.edit
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import eu.kanade.tachiyomi.data.backup.BackupCreatorJob import eu.kanade.tachiyomi.data.backup.BackupCreatorJob
@@ -9,7 +10,10 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.data.updater.UpdaterJob
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
import eu.kanade.tachiyomi.ui.library.LibrarySort import eu.kanade.tachiyomi.ui.library.LibrarySort
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.widget.ExtendedNavigationView import eu.kanade.tachiyomi.widget.ExtendedNavigationView
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@@ -117,10 +121,71 @@ object Migrations {
putInt(PreferenceKeys.filterCompleted, convertBooleanPrefToTriState("pref_filter_completed_key")) putInt(PreferenceKeys.filterCompleted, convertBooleanPrefToTriState("pref_filter_completed_key"))
remove("pref_filter_completed_key") remove("pref_filter_completed_key")
} }
}
if (oldVersion < 53) {
// Force MAL log out due to login flow change // Force MAL log out due to login flow change
// v52: switched from scraping to WebView
// v53: switched from WebView to OAuth
val trackManager = Injekt.get<TrackManager>() val trackManager = Injekt.get<TrackManager>()
trackManager.myAnimeList.logout() if (trackManager.myAnimeList.isLogged) {
trackManager.myAnimeList.logout()
context.toast(R.string.myanimelist_relogin)
}
}
if (oldVersion < 57) {
// Migrate DNS over HTTPS setting
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
val wasDohEnabled = prefs.getBoolean("enable_doh", false)
if (wasDohEnabled) {
prefs.edit {
putInt(PreferenceKeys.dohProvider, PREF_DOH_CLOUDFLARE)
remove("enable_doh")
}
}
}
if (oldVersion < 59) {
// Reset rotation to Free after replacing Lock
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
if (prefs.contains("pref_rotation_type_key")) {
prefs.edit {
putInt("pref_rotation_type_key", 1)
}
}
// Disable update check for Android 5.x users
if (BuildConfig.INCLUDE_UPDATER && Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
UpdaterJob.cancelTask(context)
}
}
if (oldVersion < 60) {
// Migrate Rotation and Viewer values to default values for viewer_flags
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
val newOrientation = when (prefs.getInt("pref_rotation_type_key", 1)) {
1 -> OrientationType.FREE.flagValue
2 -> OrientationType.PORTRAIT.flagValue
3 -> OrientationType.LANDSCAPE.flagValue
4 -> OrientationType.LOCKED_PORTRAIT.flagValue
5 -> OrientationType.LOCKED_LANDSCAPE.flagValue
else -> OrientationType.FREE.flagValue
}
// Reading mode flag and prefValue is the same value
val newReadingMode = prefs.getInt("pref_default_viewer_key", 1)
prefs.edit {
putInt("pref_default_orientation_type_key", newOrientation)
remove("pref_rotation_type_key")
putInt("pref_default_reading_mode_key", newReadingMode)
remove("pref_default_viewer_key")
}
}
if (oldVersion < 61) {
// Handle removed every 1 or 2 hour library updates
val updateInterval = preferences.libraryUpdateInterval().get()
if (updateInterval == 1 || updateInterval == 2) {
preferences.libraryUpdateInterval().set(3)
LibraryUpdateJob.setupTask(context, 3)
}
} }
return true return true
} }
@@ -5,14 +5,16 @@ import android.net.Uri
import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.toMangaInfo
import eu.kanade.tachiyomi.data.library.CustomMangaManager
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.source.model.toSChapter
import eu.kanade.tachiyomi.source.online.all.EHentai import eu.kanade.tachiyomi.source.online.all.EHentai
import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource
import exh.eh.EHentaiThrottleManager import exh.eh.EHentaiThrottleManager
import rx.Observable
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
abstract class AbstractBackupManager(protected val context: Context) { abstract class AbstractBackupManager(protected val context: Context) {
@@ -22,6 +24,10 @@ abstract class AbstractBackupManager(protected val context: Context) {
internal val trackManager: TrackManager by injectLazy() internal val trackManager: TrackManager by injectLazy()
protected val preferences: PreferencesHelper by injectLazy() protected val preferences: PreferencesHelper by injectLazy()
// SY -->
protected val customMangaManager: CustomMangaManager by injectLazy()
// SY <--
abstract fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String? abstract fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String?
/** /**
@@ -33,29 +39,29 @@ abstract class AbstractBackupManager(protected val context: Context) {
databaseHelper.getManga(manga.url, manga.source).executeAsBlocking() databaseHelper.getManga(manga.url, manga.source).executeAsBlocking()
/** /**
* [Observable] that fetches chapter information * Fetches chapter information.
* *
* @param source source of manga * @param source source of manga
* @param manga manga that needs updating * @param manga manga that needs updating
* @param chapters list of chapters in the backup * @param chapters list of chapters in the backup
* @return [Observable] that contains manga * @return Updated manga chapters.
*/ */
internal open fun restoreChapterFetchObservable(source: Source, manga: Manga, chapters: List<Chapter>, throttleManager: EHentaiThrottleManager): Observable<Pair<List<Chapter>, List<Chapter>>> { internal open suspend fun restoreChapters(source: Source, manga: Manga, chapters: List<Chapter> /* SY --> */, throttleManager: EHentaiThrottleManager /* SY <-- */): Pair<List<Chapter>, List<Chapter>> {
return ( // SY -->
if (source is EHentai) { val fetchedChapters = if (source is EHentai) {
source.fetchChapterList(manga, throttleManager::throttle) source.getChapterList(manga.toMangaInfo(), throttleManager::throttle)
} else { .map { it.toSChapter() }
source.fetchChapterList(manga) } else {
} source.getChapterList(manga.toMangaInfo())
).map { .map { it.toSChapter() }
syncChaptersWithSource(databaseHelper, it, manga, source)
} }
.doOnNext { (first) -> // SY <--
if (first.isNotEmpty()) { val syncedChapters = syncChaptersWithSource(databaseHelper, fetchedChapters, manga, source)
chapters.forEach { it.manga_id = manga.id } if (syncedChapters.first.isNotEmpty()) {
updateChapters(chapters) chapters.forEach { it.manga_id = manga.id }
} updateChapters(chapters)
} }
return syncedChapters
} }
/** /**
@@ -67,6 +73,9 @@ abstract class AbstractBackupManager(protected val context: Context) {
databaseHelper.getFavoriteMangas().executeAsBlocking() databaseHelper.getFavoriteMangas().executeAsBlocking()
// SY --> // SY -->
protected fun getReadManga(): List<Manga> =
databaseHelper.getReadNotInLibraryMangas().executeAsBlocking()
/** /**
* Returns list containing merged manga that are possibly not in the library * Returns list containing merged manga that are possibly not in the library
* *
@@ -98,6 +107,13 @@ abstract class AbstractBackupManager(protected val context: Context) {
databaseHelper.updateChaptersBackup(chapters).executeAsBlocking() databaseHelper.updateChaptersBackup(chapters).executeAsBlocking()
} }
/**
* Updates a list of chapters with known database ids
*/
protected fun updateKnownChapters(chapters: List<Chapter>) {
databaseHelper.updateKnownChaptersBackup(chapters).executeAsBlocking()
}
/** /**
* Return number of backups. * Return number of backups.
* *
@@ -7,12 +7,13 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.data.library.CustomMangaManager
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.util.chapter.NoChaptersException import eu.kanade.tachiyomi.util.chapter.NoChaptersException
import eu.kanade.tachiyomi.util.system.createFileInCacheDir
import exh.eh.EHentaiThrottleManager import exh.eh.EHentaiThrottleManager
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import rx.Observable
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.io.File import java.io.File
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@@ -24,6 +25,10 @@ abstract class AbstractBackupRestore<T : AbstractBackupManager>(protected val co
protected val db: DatabaseHelper by injectLazy() protected val db: DatabaseHelper by injectLazy()
protected val trackManager: TrackManager by injectLazy() protected val trackManager: TrackManager by injectLazy()
// SY -->
protected val customMangaManager: CustomMangaManager by injectLazy()
// SY <--
var job: Job? = null var job: Job? = null
protected lateinit var backupManager: T protected lateinit var backupManager: T
@@ -42,9 +47,9 @@ abstract class AbstractBackupRestore<T : AbstractBackupManager>(protected val co
protected val errors = mutableListOf<Pair<Date, String>>() protected val errors = mutableListOf<Pair<Date, String>>()
abstract fun performRestore(uri: Uri): Boolean abstract suspend fun performRestore(uri: Uri): Boolean
fun restoreBackup(uri: Uri): Boolean { suspend fun restoreBackup(uri: Uri): Boolean {
val startTime = System.currentTimeMillis() val startTime = System.currentTimeMillis()
restoreProgress = 0 restoreProgress = 0
errors.clear() errors.clear()
@@ -63,48 +68,48 @@ abstract class AbstractBackupRestore<T : AbstractBackupManager>(protected val co
} }
/** /**
* [Observable] that fetches chapter information * Fetches chapter information.
* *
* @param source source of manga * @param source source of manga
* @param manga manga that needs updating * @param manga manga that needs updating
* @return [Observable] that contains manga * @return Updated manga chapters.
*/ */
internal fun chapterFetchObservable(source: Source, manga: Manga, chapters: List<Chapter>): Observable<Pair<List<Chapter>, List<Chapter>>> { internal suspend fun updateChapters(source: Source, manga: Manga, chapters: List<Chapter>): Pair<List<Chapter>, List<Chapter>> {
return backupManager.restoreChapterFetchObservable(source, manga, chapters /* SY --> */, throttleManager /* SY <-- */) return try {
backupManager.restoreChapters(source, manga, chapters /* SY --> */, throttleManager /* SY <-- */)
} catch (e: Exception) {
// If there's any error, return empty update and continue. // If there's any error, return empty update and continue.
.onErrorReturn { val errorMessage = if (e is NoChaptersException) {
val errorMessage = if (it is NoChaptersException) { context.getString(R.string.no_chapters_error)
context.getString(R.string.no_chapters_error) } else {
} else { e.message
it.message
}
errors.add(Date() to "${manga.title} - $errorMessage")
Pair(emptyList(), emptyList())
} }
errors.add(Date() to "${manga.title} - $errorMessage")
Pair(emptyList(), emptyList())
}
} }
/** /**
* [Observable] that refreshes tracking information * Refreshes tracking information.
*
* @param manga manga that needs updating. * @param manga manga that needs updating.
* @param tracks list containing tracks from restore file. * @param tracks list containing tracks from restore file.
* @return [Observable] that contains updated track item
*/ */
internal fun trackingFetchObservable(manga: Manga, tracks: List<Track>): Observable<Track> { internal suspend fun updateTracking(manga: Manga, tracks: List<Track>) {
return Observable.from(tracks) tracks.forEach { track ->
.flatMap { track -> val service = trackManager.getService(track.sync_id)
val service = trackManager.getService(track.sync_id) if (service != null && service.isLogged) {
if (service != null && service.isLogged) { try {
service.refresh(track) val updatedTrack = service.refresh(track)
.doOnNext { db.insertTrack(it).executeAsBlocking() } db.insertTrack(updatedTrack).executeAsBlocking()
.onErrorReturn { } catch (e: Exception) {
errors.add(Date() to "${manga.title} - ${it.message}") errors.add(Date() to "${manga.title} - ${e.message}")
track
}
} else {
errors.add(Date() to "${manga.title} - ${context.getString(R.string.tracker_not_logged_in, service?.name)}")
Observable.empty()
} }
} else {
val serviceName = service?.nameRes()?.let { context.getString(it) }
errors.add(Date() to "${manga.title} - ${context.getString(R.string.tracker_not_logged_in, serviceName)}")
} }
}
} }
/** /**
@@ -125,15 +130,15 @@ abstract class AbstractBackupRestore<T : AbstractBackupManager>(protected val co
internal fun writeErrorLog(): File { internal fun writeErrorLog(): File {
try { try {
if (errors.isNotEmpty()) { if (errors.isNotEmpty()) {
val destFile = File(context.externalCacheDir, "tachiyomi_restore.txt") val file = context.createFileInCacheDir("tachiyomi_restore.txt")
val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault()) val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault())
destFile.bufferedWriter().use { out -> file.bufferedWriter().use { out ->
errors.forEach { (date, message) -> errors.forEach { (date, message) ->
out.write("[${sdf.format(date)}] $message\n") out.write("[${sdf.format(date)}] $message\n")
} }
} }
return destFile return file
} }
} catch (e: Exception) { } catch (e: Exception) {
// Empty // Empty
@@ -8,7 +8,6 @@ object BackupConst {
const val EXTRA_URI = "$ID.$NAME.EXTRA_URI" const val EXTRA_URI = "$ID.$NAME.EXTRA_URI"
const val EXTRA_FLAGS = "$ID.$NAME.EXTRA_FLAGS" const val EXTRA_FLAGS = "$ID.$NAME.EXTRA_FLAGS"
const val EXTRA_MODE = "$ID.$NAME.EXTRA_MODE" const val EXTRA_MODE = "$ID.$NAME.EXTRA_MODE"
const val EXTRA_TYPE = "$ID.$NAME.EXTRA_TYPE"
const val BACKUP_TYPE_LEGACY = 0 const val BACKUP_TYPE_LEGACY = 0
const val BACKUP_TYPE_FULL = 1 const val BACKUP_TYPE_FULL = 1
@@ -10,7 +10,6 @@ import androidx.core.content.ContextCompat
import androidx.core.net.toUri import androidx.core.net.toUri
import com.hippo.unifile.UniFile import com.hippo.unifile.UniFile
import eu.kanade.tachiyomi.data.backup.full.FullBackupManager import eu.kanade.tachiyomi.data.backup.full.FullBackupManager
import eu.kanade.tachiyomi.data.backup.legacy.LegacyBackupManager
import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.acquireWakeLock
import eu.kanade.tachiyomi.util.system.isServiceRunning import eu.kanade.tachiyomi.util.system.isServiceRunning
@@ -30,7 +29,14 @@ class BackupCreateService : Service() {
internal const val BACKUP_HISTORY_MASK = 0x4 internal const val BACKUP_HISTORY_MASK = 0x4
internal const val BACKUP_TRACK = 0x8 internal const val BACKUP_TRACK = 0x8
internal const val BACKUP_TRACK_MASK = 0x8 internal const val BACKUP_TRACK_MASK = 0x8
internal const val BACKUP_ALL = 0xF
// SY -->
internal const val BACKUP_CUSTOM_INFO = 0x10
internal const val BACKUP_CUSTOM_INFO_MASK = 0x10
internal const val BACKUP_READ_MANGA = 0x20
internal const val BACKUP_READ_MANGA_MASK = 0x20
internal const val BACKUP_ALL = 0x3F
// SY <--
/** /**
* Returns the status of the service. * Returns the status of the service.
@@ -48,12 +54,11 @@ class BackupCreateService : Service() {
* @param uri path of Uri * @param uri path of Uri
* @param flags determines what to backup * @param flags determines what to backup
*/ */
fun start(context: Context, uri: Uri, flags: Int, type: Int) { fun start(context: Context, uri: Uri, flags: Int) {
if (!isRunning(context)) { if (!isRunning(context)) {
val intent = Intent(context, BackupCreateService::class.java).apply { val intent = Intent(context, BackupCreateService::class.java).apply {
putExtra(BackupConst.EXTRA_URI, uri) putExtra(BackupConst.EXTRA_URI, uri)
putExtra(BackupConst.EXTRA_FLAGS, flags) putExtra(BackupConst.EXTRA_FLAGS, flags)
putExtra(BackupConst.EXTRA_TYPE, type)
} }
ContextCompat.startForegroundService(context, intent) ContextCompat.startForegroundService(context, intent)
} }
@@ -101,15 +106,9 @@ class BackupCreateService : Service() {
if (intent == null) return START_NOT_STICKY if (intent == null) return START_NOT_STICKY
try { try {
val uri = intent.getParcelableExtra<Uri>(BackupConst.EXTRA_URI) val uri = intent.getParcelableExtra<Uri>(BackupConst.EXTRA_URI)!!
val backupFlags = intent.getIntExtra(BackupConst.EXTRA_FLAGS, 0) val backupFlags = intent.getIntExtra(BackupConst.EXTRA_FLAGS, 0)
val backupType = intent.getIntExtra(BackupConst.EXTRA_TYPE, BackupConst.BACKUP_TYPE_LEGACY) val backupFileUri = FullBackupManager(this).createBackup(uri, backupFlags, false)?.toUri()
val backupManager = when (backupType) {
BackupConst.BACKUP_TYPE_FULL -> FullBackupManager(this)
else -> LegacyBackupManager(this)
}
val backupFileUri = backupManager.createBackup(uri, backupFlags, false)?.toUri()
val unifile = UniFile.fromUri(this, backupFileUri) val unifile = UniFile.fromUri(this, backupFileUri)
notifier.showBackupComplete(unifile) notifier.showBackupComplete(unifile)
} catch (e: Exception) { } catch (e: Exception) {
@@ -8,7 +8,6 @@ import androidx.work.WorkManager
import androidx.work.Worker import androidx.work.Worker
import androidx.work.WorkerParameters import androidx.work.WorkerParameters
import eu.kanade.tachiyomi.data.backup.full.FullBackupManager import eu.kanade.tachiyomi.data.backup.full.FullBackupManager
import eu.kanade.tachiyomi.data.backup.legacy.LegacyBackupManager
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@@ -23,9 +22,6 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
val flags = BackupCreateService.BACKUP_ALL val flags = BackupCreateService.BACKUP_ALL
return try { return try {
FullBackupManager(context).createBackup(uri, flags, true) FullBackupManager(context).createBackup(uri, flags, true)
if (preferences.createLegacyBackup().get()) {
LegacyBackupManager(context).createBackup(uri, flags, true)
}
Result.success() Result.success()
} catch (e: Exception) { } catch (e: Exception) {
Result.failure() Result.failure()
@@ -24,6 +24,7 @@ class BackupNotifier(private val context: Context) {
setSmallIcon(R.drawable.ic_tachi) setSmallIcon(R.drawable.ic_tachi)
setAutoCancel(false) setAutoCancel(false)
setOngoing(true) setOngoing(true)
setOnlyAlertOnce(true)
} }
private val completeNotificationBuilder = context.notificationBuilder(Notifications.CHANNEL_BACKUP_RESTORE_COMPLETE) { private val completeNotificationBuilder = context.notificationBuilder(Notifications.CHANNEL_BACKUP_RESTORE_COMPLETE) {
@@ -41,7 +42,6 @@ class BackupNotifier(private val context: Context) {
setContentTitle(context.getString(R.string.creating_backup)) setContentTitle(context.getString(R.string.creating_backup))
setProgress(0, 0, true) setProgress(0, 0, true)
setOnlyAlertOnce(true)
} }
builder.show(Notifications.ID_BACKUP_PROGRESS) builder.show(Notifications.ID_BACKUP_PROGRESS)
@@ -68,9 +68,7 @@ class BackupNotifier(private val context: Context) {
setContentText(unifile.filePath ?: unifile.name) setContentText(unifile.filePath ?: unifile.name)
// Clear old actions if they exist // Clear old actions if they exist
if (mActions.isNotEmpty()) { clearActions()
mActions.clear()
}
addAction( addAction(
R.drawable.ic_share_24dp, R.drawable.ic_share_24dp,
@@ -94,9 +92,7 @@ class BackupNotifier(private val context: Context) {
setOnlyAlertOnce(true) setOnlyAlertOnce(true)
// Clear old actions if they exist // Clear old actions if they exist
if (mActions.isNotEmpty()) { clearActions()
mActions.clear()
}
addAction( addAction(
R.drawable.ic_close_24dp, R.drawable.ic_close_24dp,
@@ -137,17 +133,15 @@ class BackupNotifier(private val context: Context) {
setContentText(context.resources.getQuantityString(R.plurals.restore_completed_message, errorCount, timeString, errorCount)) setContentText(context.resources.getQuantityString(R.plurals.restore_completed_message, errorCount, timeString, errorCount))
// Clear old actions if they exist // Clear old actions if they exist
if (mActions.isNotEmpty()) { clearActions()
mActions.clear()
}
if (errorCount > 0 && !path.isNullOrEmpty() && !file.isNullOrEmpty()) { if (errorCount > 0 && !path.isNullOrEmpty() && !file.isNullOrEmpty()) {
val destFile = File(path, file) val destFile = File(path, file)
val uri = destFile.getUriCompat(context) val uri = destFile.getUriCompat(context)
addAction( addAction(
R.drawable.nnf_ic_file_folder, R.drawable.ic_folder_24dp,
context.getString(R.string.action_open_log), context.getString(R.string.action_show_errors),
NotificationReceiver.openErrorLogPendingActivity(context, uri) NotificationReceiver.openErrorLogPendingActivity(context, uri)
) )
} }
@@ -14,7 +14,10 @@ import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.acquireWakeLock
import eu.kanade.tachiyomi.util.system.isServiceRunning import eu.kanade.tachiyomi.util.system.isServiceRunning
import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import timber.log.Timber import timber.log.Timber
@@ -40,12 +43,11 @@ class BackupRestoreService : Service() {
* @param context context of application * @param context context of application
* @param uri path of Uri * @param uri path of Uri
*/ */
fun start(context: Context, uri: Uri, mode: Int, online: Boolean?) { fun start(context: Context, uri: Uri, mode: Int) {
if (!isRunning(context)) { if (!isRunning(context)) {
val intent = Intent(context, BackupRestoreService::class.java).apply { val intent = Intent(context, BackupRestoreService::class.java).apply {
putExtra(BackupConst.EXTRA_URI, uri) putExtra(BackupConst.EXTRA_URI, uri)
putExtra(BackupConst.EXTRA_MODE, mode) putExtra(BackupConst.EXTRA_MODE, mode)
online?.let { putExtra(BackupConst.EXTRA_TYPE, it) }
} }
ContextCompat.startForegroundService(context, intent) ContextCompat.startForegroundService(context, intent)
} }
@@ -68,12 +70,14 @@ class BackupRestoreService : Service() {
*/ */
private lateinit var wakeLock: PowerManager.WakeLock private lateinit var wakeLock: PowerManager.WakeLock
private lateinit var ioScope: CoroutineScope
private var backupRestore: AbstractBackupRestore<*>? = null private var backupRestore: AbstractBackupRestore<*>? = null
private lateinit var notifier: BackupNotifier private lateinit var notifier: BackupNotifier
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
ioScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
notifier = BackupNotifier(this) notifier = BackupNotifier(this)
wakeLock = acquireWakeLock(javaClass.name) wakeLock = acquireWakeLock(javaClass.name)
@@ -92,6 +96,7 @@ class BackupRestoreService : Service() {
private fun destroyJob() { private fun destroyJob() {
backupRestore?.job?.cancel() backupRestore?.job?.cancel()
ioScope?.cancel()
if (wakeLock.isHeld) { if (wakeLock.isHeld) {
wakeLock.release() wakeLock.release()
} }
@@ -113,15 +118,15 @@ class BackupRestoreService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val uri = intent?.getParcelableExtra<Uri>(BackupConst.EXTRA_URI) ?: return START_NOT_STICKY val uri = intent?.getParcelableExtra<Uri>(BackupConst.EXTRA_URI) ?: return START_NOT_STICKY
val mode = intent.getIntExtra(BackupConst.EXTRA_MODE, BackupConst.BACKUP_TYPE_FULL) val mode = intent.getIntExtra(BackupConst.EXTRA_MODE, BackupConst.BACKUP_TYPE_FULL)
val online = intent.getBooleanExtra(BackupConst.EXTRA_TYPE, true)
// Cancel any previous job if needed. // Cancel any previous job if needed.
backupRestore?.job?.cancel() backupRestore?.job?.cancel()
backupRestore = when (mode) { backupRestore = when (mode) {
BackupConst.BACKUP_TYPE_FULL -> FullBackupRestore(this, notifier, online) BackupConst.BACKUP_TYPE_FULL -> FullBackupRestore(this, notifier)
else -> LegacyBackupRestore(this, notifier) else -> LegacyBackupRestore(this, notifier)
} }
val handler = CoroutineExceptionHandler { _, exception -> val handler = CoroutineExceptionHandler { _, exception ->
Timber.e(exception) Timber.e(exception)
backupRestore?.writeErrorLog() backupRestore?.writeErrorLog()
@@ -129,14 +134,15 @@ class BackupRestoreService : Service() {
notifier.showRestoreError(exception.message) notifier.showRestoreError(exception.message)
stopSelf(startId) stopSelf(startId)
} }
backupRestore?.job = GlobalScope.launch(handler) { val job = ioScope.launch(handler) {
if (backupRestore?.restoreBackup(uri) == false) { if (backupRestore?.restoreBackup(uri) == false) {
notifier.showRestoreError(getString(R.string.restoring_backup_canceled)) notifier.showRestoreError(getString(R.string.restoring_backup_canceled))
} }
} }
backupRestore?.job?.invokeOnCompletion { job.invokeOnCompletion {
stopSelf(startId) stopSelf(startId)
} }
backupRestore?.job = job
return START_NOT_STICKY return START_NOT_STICKY
} }
@@ -8,8 +8,12 @@ import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CATE
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CATEGORY_MASK import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CATEGORY_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER_MASK import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CUSTOM_INFO
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CUSTOM_INFO_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY_MASK import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_READ_MANGA
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_READ_MANGA_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK_MASK import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK_MASK
import eu.kanade.tachiyomi.data.backup.full.models.Backup import eu.kanade.tachiyomi.data.backup.full.models.Backup
@@ -29,15 +33,14 @@ import eu.kanade.tachiyomi.data.database.models.History
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.MangaCategory import eu.kanade.tachiyomi.data.database.models.MangaCategory
import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.online.MetadataSource import eu.kanade.tachiyomi.source.online.MetadataSource
import eu.kanade.tachiyomi.source.online.all.MergedSource import eu.kanade.tachiyomi.util.lang.launchIO
import exh.MERGED_SOURCE_ID
import exh.metadata.metadata.base.getFlatMetadataForManga import exh.metadata.metadata.base.getFlatMetadataForManga
import exh.metadata.metadata.base.insertFlatMetadata import exh.metadata.metadata.base.insertFlatMetadataAsync
import exh.savedsearches.JsonSavedSearch import exh.savedsearches.JsonSavedSearch
import exh.source.MERGED_SOURCE_ID
import exh.source.getMainSource import exh.source.getMainSource
import kotlinx.serialization.ExperimentalSerializationApi import exh.util.executeOnIO
import kotlinx.serialization.decodeFromString import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
@@ -45,11 +48,9 @@ import kotlinx.serialization.protobuf.ProtoBuf
import okio.buffer import okio.buffer
import okio.gzip import okio.gzip
import okio.sink import okio.sink
import rx.Observable
import timber.log.Timber import timber.log.Timber
import kotlin.math.max import kotlin.math.max
@OptIn(ExperimentalSerializationApi::class)
class FullBackupManager(context: Context) : AbstractBackupManager(context) { class FullBackupManager(context: Context) : AbstractBackupManager(context) {
val parser = ProtoBuf val parser = ProtoBuf
@@ -65,7 +66,11 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
var backup: Backup? = null var backup: Backup? = null
databaseHelper.inTransaction { databaseHelper.inTransaction {
val databaseManga = getFavoriteManga() /* SY --> */ + getMergedManga().filterNot { it.source == MERGED_SOURCE_ID } /* SY <-- */ val databaseManga = getFavoriteManga() /* SY --> */ + if (flags and BACKUP_READ_MANGA_MASK == BACKUP_READ_MANGA) {
getReadManga()
} else {
emptyList()
} + getMergedManga() /* SY <-- */
backup = Backup( backup = Backup(
backupManga(databaseManga, flags), backupManga(databaseManga, flags),
@@ -164,7 +169,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
*/ */
private fun backupMangaObject(manga: Manga, options: Int): BackupManga { private fun backupMangaObject(manga: Manga, options: Int): BackupManga {
// Entry for this manga // Entry for this manga
val mangaObject = BackupManga.copyFrom(manga) val mangaObject = BackupManga.copyFrom(manga /* SY --> */, if (options and BACKUP_CUSTOM_INFO_MASK == BACKUP_CUSTOM_INFO) customMangaManager else null /* SY <-- */)
// SY --> // SY -->
if (manga.source == MERGED_SOURCE_ID) { if (manga.source == MERGED_SOURCE_ID) {
@@ -235,29 +240,15 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
} }
/** /**
* [Observable] that fetches manga information * Fetches manga information
* *
* @param source source of manga
* @param manga manga that needs updating * @param manga manga that needs updating
* @return [Observable] that contains manga * @return Updated manga info.
*/ */
fun restoreMangaFetchObservable(source: Source?, manga: Manga, online: Boolean): Observable<Manga> { fun restoreManga(manga: Manga): Manga {
return if (online && source != null /* SY --> */ && source !is MergedSource /* SY <-- */) { return manga.also {
source.fetchMangaDetails(manga) it.initialized = it.description != null
.map { networkManga -> it.id = insertManga(it)
manga.copyFrom(networkManga)
manga.favorite = manga.favorite
manga.initialized = true
manga.id = insertManga(manga)
manga
}
} else {
Observable.just(manga)
.map {
it.initialized = it.description != null
it.id = insertManga(it)
it
}
} }
} }
@@ -302,7 +293,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
*/ */
internal fun restoreCategoriesForManga(manga: Manga, categories: List<Int>, backupCategories: List<BackupCategory>) { internal fun restoreCategoriesForManga(manga: Manga, categories: List<Int>, backupCategories: List<BackupCategory>) {
val dbCategories = databaseHelper.getCategories().executeAsBlocking() val dbCategories = databaseHelper.getCategories().executeAsBlocking()
val mangaCategoriesToUpdate = mutableListOf<MangaCategory>() val mangaCategoriesToUpdate = ArrayList<MangaCategory>(categories.size)
categories.forEach { backupCategoryOrder -> categories.forEach { backupCategoryOrder ->
backupCategories.firstOrNull { backupCategories.firstOrNull {
it.order == backupCategoryOrder it.order == backupCategoryOrder
@@ -329,7 +320,7 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
*/ */
internal fun restoreHistoryForManga(history: List<BackupHistory>) { internal fun restoreHistoryForManga(history: List<BackupHistory>) {
// List containing history to be updated // List containing history to be updated
val historyToBeUpdated = mutableListOf<History>() val historyToBeUpdated = ArrayList<History>(history.size)
for ((url, lastRead) in history) { for ((url, lastRead) in history) {
val dbHistory = databaseHelper.getHistoryByChapterUrl(url).executeAsBlocking() val dbHistory = databaseHelper.getHistoryByChapterUrl(url).executeAsBlocking()
// Check if history already in database and update // Check if history already in database and update
@@ -366,29 +357,26 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
val trackToUpdate = mutableListOf<Track>() val trackToUpdate = mutableListOf<Track>()
tracks.forEach { track -> tracks.forEach { track ->
val service = trackManager.getService(track.sync_id) var isInDatabase = false
if (service != null && service.isLogged) { for (dbTrack in dbTracks) {
var isInDatabase = false if (track.sync_id == dbTrack.sync_id) {
for (dbTrack in dbTracks) { // The sync is already in the db, only update its fields
if (track.sync_id == dbTrack.sync_id) { if (track.media_id != dbTrack.media_id) {
// The sync is already in the db, only update its fields dbTrack.media_id = track.media_id
if (track.media_id != dbTrack.media_id) {
dbTrack.media_id = track.media_id
}
if (track.library_id != dbTrack.library_id) {
dbTrack.library_id = track.library_id
}
dbTrack.last_chapter_read = max(dbTrack.last_chapter_read, track.last_chapter_read)
isInDatabase = true
trackToUpdate.add(dbTrack)
break
} }
if (track.library_id != dbTrack.library_id) {
dbTrack.library_id = track.library_id
}
dbTrack.last_chapter_read = max(dbTrack.last_chapter_read, track.last_chapter_read)
isInDatabase = true
trackToUpdate.add(dbTrack)
break
} }
if (!isInDatabase) { }
// Insert new sync. Let the db assign the id if (!isInDatabase) {
track.id = null // Insert new sync. Let the db assign the id
trackToUpdate.add(track) track.id = null
} trackToUpdate.add(track)
} }
} }
// Update database // Update database
@@ -397,25 +385,12 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
} }
} }
/** internal fun restoreChaptersForManga(manga: Manga, chapters: List<Chapter>) {
* Restore the chapters for manga if chapters already in database
*
* @param manga manga of chapters
* @param chapters list containing chapters that get restored
* @return boolean answering if chapter fetch is not needed
*/
internal fun restoreChaptersForManga(manga: Manga, chapters: List<Chapter>): Boolean {
val dbChapters = databaseHelper.getChapters(manga).executeAsBlocking() val dbChapters = databaseHelper.getChapters(manga).executeAsBlocking()
// Return if fetch is needed
if (dbChapters.isEmpty() || dbChapters.size < chapters.size) {
return false
}
chapters.forEach { chapter -> chapters.forEach { chapter ->
val pos = dbChapters.indexOfFirst { it.url == chapter.url } val dbChapter = dbChapters.find { it.url == chapter.url }
if (pos != -1) { if (dbChapter != null) {
val dbChapter = dbChapters[pos]
chapter.id = dbChapter.id chapter.id = dbChapter.id
chapter.copyFrom(dbChapter) chapter.copyFrom(dbChapter)
if (dbChapter.read && !chapter.read) { if (dbChapter.read && !chapter.read) {
@@ -428,39 +403,13 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
chapter.bookmark = dbChapter.bookmark chapter.bookmark = dbChapter.bookmark
} }
} }
chapter.manga_id = manga.id
} }
// Filter the chapters that couldn't be found.
chapters.filter { it.id != null }
chapters.map { it.manga_id = manga.id }
updateChapters(chapters) val newChapters = chapters.groupBy { it.id != null }
return true newChapters[true]?.let { updateKnownChapters(it) }
} newChapters[false]?.let { insertChapters(it) }
internal fun restoreChaptersForMangaOffline(manga: Manga, chapters: List<Chapter>) {
val dbChapters = databaseHelper.getChapters(manga).executeAsBlocking()
chapters.forEach { chapter ->
val pos = dbChapters.indexOfFirst { it.url == chapter.url }
if (pos != -1) {
val dbChapter = dbChapters[pos]
chapter.id = dbChapter.id
chapter.copyFrom(dbChapter)
if (dbChapter.read && !chapter.read) {
chapter.read = dbChapter.read
chapter.last_page_read = dbChapter.last_page_read
} else if (chapter.last_page_read == 0 && dbChapter.last_page_read != 0) {
chapter.last_page_read = dbChapter.last_page_read
}
if (!chapter.bookmark && dbChapter.bookmark) {
chapter.bookmark = dbChapter.bookmark
}
}
}
chapters.map { it.manga_id = manga.id }
updateChapters(chapters.filter { it.id != null })
insertChapters(chapters.filter { it.id == null })
} }
// SY --> // SY -->
@@ -530,11 +479,12 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
} }
internal fun restoreFlatMetadata(manga: Manga, backupFlatMetadata: BackupFlatMetadata) { internal fun restoreFlatMetadata(manga: Manga, backupFlatMetadata: BackupFlatMetadata) {
manga.id?.let { mangaId -> val mangaId = manga.id ?: return
databaseHelper.getFlatMetadataForManga(mangaId).executeAsBlocking().let { launchIO {
databaseHelper.getFlatMetadataForManga(mangaId).executeOnIO().let {
if (it == null) { if (it == null) {
val flatMetadata = backupFlatMetadata.getFlatMetadata(mangaId) val flatMetadata = backupFlatMetadata.getFlatMetadata(mangaId)
databaseHelper.insertFlatMetadata(flatMetadata).await() databaseHelper.insertFlatMetadataAsync(flatMetadata).await()
} }
} }
} }
@@ -15,21 +15,17 @@ import eu.kanade.tachiyomi.data.backup.full.models.BackupSerializer
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.data.library.CustomMangaManager
import eu.kanade.tachiyomi.source.online.all.MergedSource
import exh.EXHMigrations import exh.EXHMigrations
import exh.MERGED_SOURCE_ID import exh.source.MERGED_SOURCE_ID
import kotlinx.serialization.ExperimentalSerializationApi
import okio.buffer import okio.buffer
import okio.gzip import okio.gzip
import okio.source import okio.source
import rx.Observable
import java.util.Date import java.util.Date
@OptIn(ExperimentalSerializationApi::class) class FullBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBackupRestore<FullBackupManager>(context, notifier) {
class FullBackupRestore(context: Context, notifier: BackupNotifier, private val online: Boolean) : AbstractBackupRestore<FullBackupManager>(context, notifier) {
override fun performRestore(uri: Uri): Boolean { override suspend fun performRestore(uri: Uri): Boolean {
// SY --> // SY -->
throttleManager.resetThrottle() throttleManager.resetThrottle()
// SY <-- // SY <--
@@ -60,9 +56,11 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
return false return false
} }
restoreManga(it, backup.backupCategories, online) restoreManga(it, backup.backupCategories)
} }
// TODO: optionally trigger online library + tracker update
return true return true
} }
@@ -84,8 +82,8 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
} }
// SY <-- // SY <--
private fun restoreManga(backupManga: BackupManga, backupCategories: List<BackupCategory>, online: Boolean) { private fun restoreManga(backupManga: BackupManga, backupCategories: List<BackupCategory>) {
var manga = backupManga.getMangaImpl() val manga = backupManga.getMangaImpl()
val chapters = backupManga.getChaptersImpl() val chapters = backupManga.getChaptersImpl()
val categories = backupManga.categories val categories = backupManga.categories
val history = backupManga.history val history = backupManga.history
@@ -93,22 +91,18 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
// SY --> // SY -->
val mergedMangaReferences = backupManga.mergedMangaReferences val mergedMangaReferences = backupManga.mergedMangaReferences
val flatMetadata = backupManga.flatMetadata val flatMetadata = backupManga.flatMetadata
val customManga = backupManga.getCustomMangaInfo()
// SY <-- // SY <--
// SY --> // SY -->
manga = EXHMigrations.migrateBackupEntry(manga) EXHMigrations.migrateBackupEntry(manga)
// SY <-- // SY <--
try { try {
val source = backupManager.sourceManager.get(manga.source) restoreMangaData(manga, chapters, categories, history, tracks, backupCategories/* SY --> */, mergedMangaReferences, flatMetadata, customManga/* SY <-- */)
if (source != null || !online) {
restoreMangaData(manga, source, chapters, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata, online)
} else {
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
errors.add(Date() to "${manga.title} - ${context.getString(R.string.source_not_found_name, sourceName)}")
}
} catch (e: Exception) { } catch (e: Exception) {
errors.add(Date() to "${manga.title} - ${e.message}") val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
errors.add(Date() to "${manga.title} [$sourceName]: ${e.message}")
} }
restoreProgress += 1 restoreProgress += 1
@@ -119,7 +113,6 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
* Returns a manga restore observable * Returns a manga restore observable
* *
* @param manga manga data from json * @param manga manga data from json
* @param source source to get manga data from
* @param chapters chapters data from json * @param chapters chapters data from json
* @param categories categories data from json * @param categories categories data from json
* @param history history data from json * @param history history data from json
@@ -127,116 +120,93 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
*/ */
private fun restoreMangaData( private fun restoreMangaData(
manga: Manga, manga: Manga,
source: Source?,
chapters: List<Chapter>, chapters: List<Chapter>,
categories: List<Int>, categories: List<Int>,
history: List<BackupHistory>, history: List<BackupHistory>,
tracks: List<Track>, tracks: List<Track>,
backupCategories: List<BackupCategory>, backupCategories: List<BackupCategory>,
// SY -->
mergedMangaReferences: List<BackupMergedMangaReference>, mergedMangaReferences: List<BackupMergedMangaReference>,
flatMetadata: BackupFlatMetadata?, flatMetadata: BackupFlatMetadata?,
online: Boolean customManga: CustomMangaManager.MangaJson?,
// SY -->
) { ) {
val dbManga = backupManager.getMangaFromDatabase(manga)
db.inTransaction { db.inTransaction {
val dbManga = backupManager.getMangaFromDatabase(manga)
if (dbManga == null) { if (dbManga == null) {
// Manga not in database // Manga not in database
restoreMangaFetch(source, manga, chapters, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata, online) restoreMangaFetch(manga, chapters, categories, history, tracks, backupCategories/* SY --> */, mergedMangaReferences, flatMetadata, customManga/* SY <-- */)
} else { // Manga in database } else {
// Manga in database
// Copy information from manga already in database // Copy information from manga already in database
backupManager.restoreMangaNoFetch(manga, dbManga) backupManager.restoreMangaNoFetch(manga, dbManga)
// Fetch rest of manga information // Fetch rest of manga information
restoreMangaNoFetch(source, manga, chapters, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata, online) restoreMangaNoFetch(manga, chapters, categories, history, tracks, backupCategories/* SY --> */, mergedMangaReferences, flatMetadata, customManga/* SY <-- */)
} }
} }
} }
/** /**
* [Observable] that fetches manga information * Fetches manga information
* *
* @param manga manga that needs updating * @param manga manga that needs updating
* @param chapters chapters of manga that needs updating * @param chapters chapters of manga that needs updating
* @param categories categories that need updating * @param categories categories that need updating
*/ */
private fun restoreMangaFetch( private fun restoreMangaFetch(
source: Source?,
manga: Manga, manga: Manga,
chapters: List<Chapter>, chapters: List<Chapter>,
categories: List<Int>, categories: List<Int>,
history: List<BackupHistory>, history: List<BackupHistory>,
tracks: List<Track>, tracks: List<Track>,
backupCategories: List<BackupCategory>, backupCategories: List<BackupCategory>,
// SY -->
mergedMangaReferences: List<BackupMergedMangaReference>, mergedMangaReferences: List<BackupMergedMangaReference>,
flatMetadata: BackupFlatMetadata?, flatMetadata: BackupFlatMetadata?,
online: Boolean customManga: CustomMangaManager.MangaJson?,
// SY <--
) { ) {
backupManager.restoreMangaFetchObservable(source, manga, online) try {
.doOnError { val fetchedManga = backupManager.restoreManga(manga)
errors.add(Date() to "${manga.title} - ${it.message}") fetchedManga.id ?: return
} backupManager.restoreChaptersForManga(fetchedManga, chapters)
.filter { it.id != null }
.flatMap { restoreExtraForManga(fetchedManga, categories, history, tracks, backupCategories /* SY --> */, mergedMangaReferences, flatMetadata, customManga/* SY <-- */)
if (online && source != null) { } catch (e: Exception) {
// SY --> errors.add(Date() to "${manga.title} - ${e.message}")
if (source !is MergedSource) { }
chapterFetchObservable(source, it, chapters)
// Convert to the manga that contains new chapters.
.map { manga }
} else {
Observable.just(manga)
}
// SY <--
} else {
backupManager.restoreChaptersForMangaOffline(it, chapters)
Observable.just(manga)
}
}
.doOnNext {
restoreExtraForManga(it, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata)
}
.flatMap {
trackingFetchObservable(it, tracks)
}
.subscribe()
} }
private fun restoreMangaNoFetch( private fun restoreMangaNoFetch(
source: Source?,
backupManga: Manga, backupManga: Manga,
chapters: List<Chapter>, chapters: List<Chapter>,
categories: List<Int>, categories: List<Int>,
history: List<BackupHistory>, history: List<BackupHistory>,
tracks: List<Track>, tracks: List<Track>,
backupCategories: List<BackupCategory>, backupCategories: List<BackupCategory>,
// SY -->
mergedMangaReferences: List<BackupMergedMangaReference>, mergedMangaReferences: List<BackupMergedMangaReference>,
flatMetadata: BackupFlatMetadata?, flatMetadata: BackupFlatMetadata?,
online: Boolean customManga: CustomMangaManager.MangaJson?,
// SY <--
) { ) {
Observable.just(backupManga) backupManager.restoreChaptersForManga(backupManga, chapters)
.flatMap { manga ->
if (online && source != null) { restoreExtraForManga(backupManga, categories, history, tracks, backupCategories/* SY --> */, mergedMangaReferences, flatMetadata, customManga/* SY <-- */)
if (/* SY --> */ source !is MergedSource && /* SY <-- */ !backupManager.restoreChaptersForManga(manga, chapters)) {
chapterFetchObservable(source, manga, chapters)
.map { manga }
} else {
Observable.just(manga)
}
} else {
backupManager.restoreChaptersForMangaOffline(manga, chapters)
Observable.just(manga)
}
}
.doOnNext {
restoreExtraForManga(it, categories, history, tracks, backupCategories, mergedMangaReferences, flatMetadata)
}
.flatMap { manga ->
trackingFetchObservable(manga, tracks)
}
.subscribe()
} }
private fun restoreExtraForManga(manga: Manga, categories: List<Int>, history: List<BackupHistory>, tracks: List<Track>, backupCategories: List<BackupCategory>, mergedMangaReferences: List<BackupMergedMangaReference>, flatMetadata: BackupFlatMetadata?) { private fun restoreExtraForManga(
manga: Manga,
categories: List<Int>,
history: List<BackupHistory>,
tracks: List<Track>,
backupCategories: List<BackupCategory>,
// SY -->
mergedMangaReferences: List<BackupMergedMangaReference>,
flatMetadata: BackupFlatMetadata?,
customManga: CustomMangaManager.MangaJson?,
// SY <--
) {
// Restore categories // Restore categories
backupManager.restoreCategoriesForManga(manga, categories, backupCategories) backupManager.restoreCategoriesForManga(manga, categories, backupCategories)
@@ -252,6 +222,10 @@ class FullBackupRestore(context: Context, notifier: BackupNotifier, private val
// Restore flat metadata for metadata sources // Restore flat metadata for metadata sources
flatMetadata?.let { backupManager.restoreFlatMetadata(manga, it) } flatMetadata?.let { backupManager.restoreFlatMetadata(manga, it) }
// Restore Custom Info
customManga?.id = manga.id!!
customManga?.let { customMangaManager.saveMangaInfo(it) }
// SY <-- // SY <--
} }
} }
@@ -5,12 +5,10 @@ import android.net.Uri
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.backup.AbstractBackupRestoreValidator import eu.kanade.tachiyomi.data.backup.AbstractBackupRestoreValidator
import eu.kanade.tachiyomi.data.backup.full.models.BackupSerializer import eu.kanade.tachiyomi.data.backup.full.models.BackupSerializer
import kotlinx.serialization.ExperimentalSerializationApi
import okio.buffer import okio.buffer
import okio.gzip import okio.gzip
import okio.source import okio.source
@OptIn(ExperimentalSerializationApi::class)
class FullBackupRestoreValidator : AbstractBackupRestoreValidator() { class FullBackupRestoreValidator : AbstractBackupRestoreValidator() {
/** /**
* Checks for critical backup file data. * Checks for critical backup file data.
@@ -41,7 +39,7 @@ class FullBackupRestoreValidator : AbstractBackupRestoreValidator() {
val missingTrackers = trackers val missingTrackers = trackers
.mapNotNull { trackManager.getService(it) } .mapNotNull { trackManager.getService(it) }
.filter { !it.isLogged } .filter { !it.isLogged }
.map { it.name } .map { context.getString(it.nameRes()) }
.sorted() .sorted()
return Results(missingSources, missingTrackers) return Results(missingSources, missingTrackers)
@@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.data.database.models.ChapterImpl
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.MangaImpl import eu.kanade.tachiyomi.data.database.models.MangaImpl
import eu.kanade.tachiyomi.data.database.models.TrackImpl import eu.kanade.tachiyomi.data.database.models.TrackImpl
import eu.kanade.tachiyomi.data.library.CustomMangaManager
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
@@ -25,7 +26,7 @@ data class BackupManga(
// @ProtoNumber(11) val lastUpdate: Long = 0, 1.x value, not used in 0.x // @ProtoNumber(11) val lastUpdate: Long = 0, 1.x value, not used in 0.x
// @ProtoNumber(12) val lastInit: Long = 0, 1.x value, not used in 0.x // @ProtoNumber(12) val lastInit: Long = 0, 1.x value, not used in 0.x
@ProtoNumber(13) var dateAdded: Long = 0, @ProtoNumber(13) var dateAdded: Long = 0,
@ProtoNumber(14) var viewer: Int = 0, @ProtoNumber(14) var viewer: Int = 0, // Replaced by viewer_flags
// @ProtoNumber(15) val flags: Int = 0, 1.x value, not used in 0.x // @ProtoNumber(15) val flags: Int = 0, 1.x value, not used in 0.x
@ProtoNumber(16) var chapters: List<BackupChapter> = emptyList(), @ProtoNumber(16) var chapters: List<BackupChapter> = emptyList(),
@ProtoNumber(17) var categories: List<Int> = emptyList(), @ProtoNumber(17) var categories: List<Int> = emptyList(),
@@ -34,9 +35,22 @@ data class BackupManga(
@ProtoNumber(100) var favorite: Boolean = true, @ProtoNumber(100) var favorite: Boolean = true,
@ProtoNumber(101) var chapterFlags: Int = 0, @ProtoNumber(101) var chapterFlags: Int = 0,
@ProtoNumber(102) var history: List<BackupHistory> = emptyList(), @ProtoNumber(102) var history: List<BackupHistory> = emptyList(),
@ProtoNumber(103) var viewer_flags: Int? = null,
// SY specific values // SY specific values
@ProtoNumber(600) var mergedMangaReferences: List<BackupMergedMangaReference> = emptyList(), @ProtoNumber(600) var mergedMangaReferences: List<BackupMergedMangaReference> = emptyList(),
@ProtoNumber(601) var flatMetadata: BackupFlatMetadata? = null @ProtoNumber(601) var flatMetadata: BackupFlatMetadata? = null,
@ProtoNumber(602) var customStatus: Int = 0,
// J2K specific values
@ProtoNumber(800) var customTitle: String? = null,
@ProtoNumber(801) var customArtist: String? = null,
@ProtoNumber(802) var customAuthor: String? = null,
@ProtoNumber(803) var customDescription: String? = null,
@ProtoNumber(803) var customGenre: List<String>? = null,
// Neko specific values
@ProtoNumber(901) var filtered_scanlators: String? = null,
) { ) {
fun getMangaImpl(): MangaImpl { fun getMangaImpl(): MangaImpl {
return MangaImpl().apply { return MangaImpl().apply {
@@ -51,8 +65,9 @@ data class BackupManga(
favorite = this@BackupManga.favorite favorite = this@BackupManga.favorite
source = this@BackupManga.source source = this@BackupManga.source
date_added = this@BackupManga.dateAdded date_added = this@BackupManga.dateAdded
viewer = this@BackupManga.viewer viewer_flags = this@BackupManga.viewer_flags ?: this@BackupManga.viewer
chapter_flags = this@BackupManga.chapterFlags chapter_flags = this@BackupManga.chapterFlags
filtered_scanlators = this@BackupManga.filtered_scanlators
} }
} }
@@ -62,6 +77,29 @@ data class BackupManga(
} }
} }
// SY -->
fun getCustomMangaInfo(): CustomMangaManager.MangaJson? {
if (customTitle != null ||
customArtist != null ||
customAuthor != null ||
customDescription != null ||
customGenre != null ||
customStatus != 0
) {
return CustomMangaManager.MangaJson(
id = 0L,
title = customTitle,
author = customAuthor,
artist = customArtist,
description = customDescription,
genre = customGenre,
status = customStatus.takeUnless { it == 0 }
)
}
return null
}
// SY <--
fun getTrackingImpl(): List<TrackImpl> { fun getTrackingImpl(): List<TrackImpl> {
return tracking.map { return tracking.map {
it.getTrackingImpl() it.getTrackingImpl()
@@ -69,22 +107,37 @@ data class BackupManga(
} }
companion object { companion object {
fun copyFrom(manga: Manga): BackupManga { fun copyFrom(manga: Manga /* SY --> */, customMangaManager: CustomMangaManager?/* SY <-- */): BackupManga {
return BackupManga( return BackupManga(
url = manga.url, url = manga.url,
title = manga.title, // SY -->
artist = manga.artist, title = manga.originalTitle,
author = manga.author, artist = manga.originalArtist,
description = manga.description, author = manga.originalAuthor,
genre = manga.getGenres() ?: emptyList(), description = manga.originalDescription,
status = manga.status, genre = manga.getOriginalGenres() ?: emptyList(),
status = manga.originalStatus,
// SY <--
thumbnailUrl = manga.thumbnail_url, thumbnailUrl = manga.thumbnail_url,
favorite = manga.favorite, favorite = manga.favorite,
source = manga.source, source = manga.source,
dateAdded = manga.date_added, dateAdded = manga.date_added,
viewer = manga.viewer, viewer = manga.readingModeType,
chapterFlags = manga.chapter_flags viewer_flags = manga.viewer_flags,
) chapterFlags = manga.chapter_flags,
filtered_scanlators = manga.filtered_scanlators
// SY -->
).also { backupManga ->
customMangaManager?.getManga(manga)?.let {
backupManga.customTitle = it.title
backupManga.customArtist = it.artist
backupManga.customAuthor = it.author
backupManga.customDescription = it.description
backupManga.customGenre = it.getGenres()
backupManga.customStatus = it.status
}
}
// SY <--
} }
} }
} }
@@ -25,7 +25,6 @@ data class BackupTracking(
@ProtoNumber(10) var startedReadingDate: Long = 0, @ProtoNumber(10) var startedReadingDate: Long = 0,
// finishedReadingDate is called endReadTime in 1.x // finishedReadingDate is called endReadTime in 1.x
@ProtoNumber(11) var finishedReadingDate: Long = 0, @ProtoNumber(11) var finishedReadingDate: Long = 0,
) { ) {
fun getTrackingImpl(): TrackImpl { fun getTrackingImpl(): TrackImpl {
return TrackImpl().apply { return TrackImpl().apply {
@@ -5,33 +5,13 @@ import android.net.Uri
import com.github.salomonbrys.kotson.fromJson import com.github.salomonbrys.kotson.fromJson
import com.github.salomonbrys.kotson.registerTypeAdapter import com.github.salomonbrys.kotson.registerTypeAdapter
import com.github.salomonbrys.kotson.registerTypeHierarchyAdapter import com.github.salomonbrys.kotson.registerTypeHierarchyAdapter
import com.github.salomonbrys.kotson.set
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.GsonBuilder import com.google.gson.GsonBuilder
import com.google.gson.JsonArray import com.google.gson.JsonArray
import com.google.gson.JsonElement import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.hippo.unifile.UniFile
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.backup.AbstractBackupManager import eu.kanade.tachiyomi.data.backup.AbstractBackupManager
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CATEGORY
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CATEGORY_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_CHAPTER_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_HISTORY_MASK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK
import eu.kanade.tachiyomi.data.backup.BackupCreateService.Companion.BACKUP_TRACK_MASK
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.CATEGORIES
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.CHAPTERS
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.CURRENT_VERSION import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.CURRENT_VERSION
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.EXTENSIONS
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.HISTORY
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.MANGA
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.MERGEDMANGAREFERENCES
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.SAVEDSEARCHES
import eu.kanade.tachiyomi.data.backup.legacy.models.Backup.TRACK
import eu.kanade.tachiyomi.data.backup.legacy.models.DHistory import eu.kanade.tachiyomi.data.backup.legacy.models.DHistory
import eu.kanade.tachiyomi.data.backup.legacy.serializer.CategoryTypeAdapter import eu.kanade.tachiyomi.data.backup.legacy.serializer.CategoryTypeAdapter
import eu.kanade.tachiyomi.data.backup.legacy.serializer.ChapterTypeAdapter import eu.kanade.tachiyomi.data.backup.legacy.serializer.ChapterTypeAdapter
@@ -48,56 +28,34 @@ import eu.kanade.tachiyomi.data.database.models.MangaCategory
import eu.kanade.tachiyomi.data.database.models.MangaImpl import eu.kanade.tachiyomi.data.database.models.MangaImpl
import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.data.database.models.TrackImpl import eu.kanade.tachiyomi.data.database.models.TrackImpl
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.database.models.toMangaInfo
import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.toSManga
import eu.kanade.tachiyomi.source.online.all.MergedSource import eu.kanade.tachiyomi.source.online.all.MergedSource
import eu.kanade.tachiyomi.util.lang.asObservable
import exh.MERGED_SOURCE_ID
import exh.eh.EHentaiThrottleManager import exh.eh.EHentaiThrottleManager
import exh.merged.sql.models.MergedMangaReference import exh.merged.sql.models.MergedMangaReference
import exh.savedsearches.JsonSavedSearch import exh.savedsearches.JsonSavedSearch
import kotlinx.coroutines.flow.onEach import exh.source.MERGED_SOURCE_ID
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.decodeFromString import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import rx.Observable
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.lang.RuntimeException import java.lang.RuntimeException
import kotlin.math.max import kotlin.math.max
class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : AbstractBackupManager(context) { class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : AbstractBackupManager(context) {
var parserVersion: Int = version val parser: Gson = when (version) {
private set 2 -> GsonBuilder()
.registerTypeAdapter<MangaImpl>(MangaTypeAdapter.build())
var parser: Gson = initParser() .registerTypeHierarchyAdapter<ChapterImpl>(ChapterTypeAdapter.build())
.registerTypeAdapter<CategoryImpl>(CategoryTypeAdapter.build())
/** .registerTypeAdapter<DHistory>(HistoryTypeAdapter.build())
* Set version of parser .registerTypeHierarchyAdapter<TrackImpl>(TrackTypeAdapter.build())
* // SY -->
* @param version version of parser .registerTypeAdapter<MergedMangaReference>(MergedMangaReferenceTypeAdapter.build())
*/ // SY <--
internal fun setVersion(version: Int) { .create()
this.parserVersion = version
parser = initParser()
}
private fun initParser(): Gson = when (parserVersion) {
2 ->
GsonBuilder()
.registerTypeAdapter<MangaImpl>(MangaTypeAdapter.build())
.registerTypeHierarchyAdapter<ChapterImpl>(ChapterTypeAdapter.build())
.registerTypeAdapter<CategoryImpl>(CategoryTypeAdapter.build())
.registerTypeAdapter<DHistory>(HistoryTypeAdapter.build())
.registerTypeHierarchyAdapter<TrackImpl>(TrackTypeAdapter.build())
// SY -->
.registerTypeAdapter<MergedMangaReference>(MergedMangaReferenceTypeAdapter.build())
// SY <--
.create()
else -> throw Exception("Unknown backup version") else -> throw Exception("Unknown backup version")
} }
@@ -107,180 +65,8 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
* @param uri path of Uri * @param uri path of Uri
* @param isJob backup called from job * @param isJob backup called from job
*/ */
override fun createBackup(uri: Uri, flags: Int, isJob: Boolean): String? { override fun createBackup(uri: Uri, flags: Int, isJob: Boolean) =
// Create root object throw IllegalStateException("Legacy backup creation is not supported")
val root = JsonObject()
// Create manga array
val mangaEntries = JsonArray()
// Create category array
val categoryEntries = JsonArray()
// Create extension ID/name mapping
val extensionEntries = JsonArray()
// Merged Manga References
val mergedMangaReferenceEntries = JsonArray()
// Add value's to root
root[Backup.VERSION] = CURRENT_VERSION
root[Backup.MANGAS] = mangaEntries
root[CATEGORIES] = categoryEntries
root[EXTENSIONS] = extensionEntries
// SY -->
root[MERGEDMANGAREFERENCES] = mergedMangaReferenceEntries
// SY <--
databaseHelper.inTransaction {
val mangas = getFavoriteManga()/* SY --> */.filterNot { it.source == MERGED_SOURCE_ID } + getMergedManga().filterNot { it.source == MERGED_SOURCE_ID } /* SY <-- */
val extensions: MutableSet<String> = mutableSetOf()
// Backup library manga and its dependencies
mangas.forEach { manga ->
mangaEntries.add(backupMangaObject(manga, flags))
// Maintain set of extensions/sources used (excludes local source)
if (manga.source != LocalSource.ID) {
sourceManager.get(manga.source)?.let {
extensions.add("${manga.source}:${it.name}")
}
}
}
// Backup categories
if ((flags and BACKUP_CATEGORY_MASK) == BACKUP_CATEGORY) {
backupCategories(categoryEntries)
}
// Backup extension ID/name mapping
backupExtensionInfo(extensionEntries, extensions)
// SY -->
root[SAVEDSEARCHES] =
Injekt.get<PreferencesHelper>().savedSearches().get().joinToString(separator = "***")
backupMergedMangaReferences(mergedMangaReferenceEntries)
// SY <--
}
try {
val file: UniFile = (
if (isJob) {
// Get dir of file and create
var dir = UniFile.fromUri(context, uri)
dir = dir.createDirectory("automatic")
// Delete older backups
val numberOfBackups = numberOfBackups()
val backupRegex = Regex("""tachiyomi_\d+-\d+-\d+_\d+-\d+.json""")
dir.listFiles { _, filename -> backupRegex.matches(filename) }
.orEmpty()
.sortedByDescending { it.name }
.drop(numberOfBackups - 1)
.forEach { it.delete() }
// Create new file to place backup
dir.createFile(Backup.getDefaultFilename())
} else {
UniFile.fromUri(context, uri)
}
)
?: throw Exception("Couldn't create backup file")
file.openOutputStream().bufferedWriter().use {
parser.toJson(root, it)
}
return file.uri.toString()
} catch (e: Exception) {
Timber.e(e)
throw e
}
}
private fun backupExtensionInfo(root: JsonArray, extensions: Set<String>) {
extensions.sorted().forEach {
root.add(it)
}
}
// SY -->
private fun backupMergedMangaReferences(root: JsonArray) {
val mergedMangaReferences = databaseHelper.getMergedMangaReferences().executeAsBlocking()
mergedMangaReferences.forEach { root.add(parser.toJsonTree(it)) }
}
// SY <--
/**
* Backup the categories of library
*
* @param root root of categories json
*/
internal fun backupCategories(root: JsonArray) {
val categories = databaseHelper.getCategories().executeAsBlocking()
categories.forEach { root.add(parser.toJsonTree(it)) }
}
/**
* Convert a manga to Json
*
* @param manga manga that gets converted
* @return [JsonElement] containing manga information
*/
internal fun backupMangaObject(manga: Manga, options: Int): JsonElement {
// Entry for this manga
val entry = JsonObject()
// Backup manga fields
entry[MANGA] = parser.toJsonTree(manga)
// Check if user wants chapter information in backup
if (options and BACKUP_CHAPTER_MASK == BACKUP_CHAPTER) {
// Backup all the chapters
val chapters = databaseHelper.getChapters(manga).executeAsBlocking()
if (chapters.isNotEmpty()) {
val chaptersJson = parser.toJsonTree(chapters)
if (chaptersJson.asJsonArray.size() > 0) {
entry[CHAPTERS] = chaptersJson
}
}
}
// Check if user wants category information in backup
if (options and BACKUP_CATEGORY_MASK == BACKUP_CATEGORY) {
// Backup categories for this manga
val categoriesForManga = databaseHelper.getCategoriesForManga(manga).executeAsBlocking()
if (categoriesForManga.isNotEmpty()) {
val categoriesNames = categoriesForManga.map { it.name }
entry[CATEGORIES] = parser.toJsonTree(categoriesNames)
}
}
// Check if user wants track information in backup
if (options and BACKUP_TRACK_MASK == BACKUP_TRACK) {
val tracks = databaseHelper.getTracks(manga).executeAsBlocking()
if (tracks.isNotEmpty()) {
entry[TRACK] = parser.toJsonTree(tracks)
}
}
// Check if user wants history information in backup
if (options and BACKUP_HISTORY_MASK == BACKUP_HISTORY) {
val historyForManga = databaseHelper.getHistoryByMangaId(manga.id!!).executeAsBlocking()
if (historyForManga.isNotEmpty()) {
val historyData = historyForManga.mapNotNull { history ->
val url = databaseHelper.getChapter(history.chapter_id).executeAsBlocking()?.url
url?.let { DHistory(url, history.last_read) }
}
val historyJson = parser.toJsonTree(historyData)
if (historyJson.asJsonArray.size() > 0) {
entry[HISTORY] = historyJson
}
}
}
return entry
}
fun restoreMangaNoFetch(manga: Manga, dbManga: Manga) { fun restoreMangaNoFetch(manga: Manga, dbManga: Manga) {
manga.id = dbManga.id manga.id = dbManga.id
@@ -290,21 +76,20 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
} }
/** /**
* [Observable] that fetches manga information * Fetches manga information
* *
* @param source source of manga * @param source source of manga
* @param manga manga that needs updating * @param manga manga that needs updating
* @return [Observable] that contains manga * @return Updated manga.
*/ */
fun restoreMangaFetchObservable(source: Source, manga: Manga): Observable<Manga> { suspend fun fetchManga(source: Source, manga: Manga): Manga {
return source.fetchMangaDetails(manga) val networkManga = source.getMangaDetails(manga.toMangaInfo())
.map { networkManga -> return manga.also {
manga.copyFrom(networkManga) it.copyFrom(networkManga.toSManga())
manga.favorite = true it.favorite = true
manga.initialized = true it.initialized = true
manga.id = insertManga(manga) it.id = insertManga(manga)
manga }
}
} }
/** /**
@@ -314,18 +99,17 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
* @param manga manga that needs updating * @param manga manga that needs updating
* @return [Observable] that contains manga * @return [Observable] that contains manga
*/ */
override fun restoreChapterFetchObservable(source: Source, manga: Manga, chapters: List<Chapter>, throttleManager: EHentaiThrottleManager): Observable<Pair<List<Chapter>, List<Chapter>>> { override suspend fun restoreChapters(source: Source, manga: Manga, chapters: List<Chapter>, throttleManager: EHentaiThrottleManager): Pair<List<Chapter>, List<Chapter>> {
// SY --> // SY -->
return if (source is MergedSource) { return if (source is MergedSource) {
val syncedChapters = runBlocking { source.fetchChaptersAndSync(manga, false) } val syncedChapters = source.fetchChaptersAndSync(manga, false)
syncedChapters.onEach { pair -> syncedChapters.first.onEach {
if (pair.first.isNotEmpty()) { it.manga_id = manga.id
chapters.forEach { it.manga_id = manga.id } }
updateChapters(chapters) updateChapters(syncedChapters.first)
} syncedChapters
}.asObservable()
} else { } else {
super.restoreChapterFetchObservable(source, manga, chapters, throttleManager) super.restoreChapters(source, manga, chapters, throttleManager)
} }
} }
@@ -371,7 +155,7 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
*/ */
internal fun restoreCategoriesForManga(manga: Manga, categories: List<String>) { internal fun restoreCategoriesForManga(manga: Manga, categories: List<String>) {
val dbCategories = databaseHelper.getCategories().executeAsBlocking() val dbCategories = databaseHelper.getCategories().executeAsBlocking()
val mangaCategoriesToUpdate = mutableListOf<MangaCategory>() val mangaCategoriesToUpdate = ArrayList<MangaCategory>(categories.size)
for (backupCategoryStr in categories) { for (backupCategoryStr in categories) {
for (dbCategory in dbCategories) { for (dbCategory in dbCategories) {
if (backupCategoryStr == dbCategory.name) { if (backupCategoryStr == dbCategory.name) {
@@ -395,7 +179,7 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
*/ */
internal fun restoreHistoryForManga(history: List<DHistory>) { internal fun restoreHistoryForManga(history: List<DHistory>) {
// List containing history to be updated // List containing history to be updated
val historyToBeUpdated = mutableListOf<History>() val historyToBeUpdated = ArrayList<History>(history.size)
for ((url, lastRead) in history) { for ((url, lastRead) in history) {
val dbHistory = databaseHelper.getHistoryByChapterUrl(url).executeAsBlocking() val dbHistory = databaseHelper.getHistoryByChapterUrl(url).executeAsBlocking()
// Check if history already in database and update // Check if history already in database and update
@@ -424,14 +208,14 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
* @param tracks the track list to restore. * @param tracks the track list to restore.
*/ */
internal fun restoreTrackForManga(manga: Manga, tracks: List<Track>) { internal fun restoreTrackForManga(manga: Manga, tracks: List<Track>) {
// Fix foreign keys with the current manga id
tracks.map { it.manga_id = manga.id!! }
// Get tracks from database // Get tracks from database
val dbTracks = databaseHelper.getTracks(manga).executeAsBlocking() val dbTracks = databaseHelper.getTracks(manga).executeAsBlocking()
val trackToUpdate = mutableListOf<Track>() val trackToUpdate = ArrayList<Track>(tracks.size)
tracks.forEach { track -> tracks.forEach { track ->
// Fix foreign keys with the current manga id
track.manga_id = manga.id!!
val service = trackManager.getService(track.sync_id) val service = trackManager.getService(track.sync_id)
if (service != null && service.isLogged) { if (service != null && service.isLogged) {
var isInDatabase = false var isInDatabase = false
@@ -486,12 +270,13 @@ class LegacyBackupManager(context: Context, version: Int = CURRENT_VERSION) : Ab
chapter.copyFrom(dbChapter) chapter.copyFrom(dbChapter)
break break
} }
}
// Filter the chapters that couldn't be found.
chapters.filter { it.id != null }
chapters.map { it.manga_id = manga.id }
updateChapters(chapters) chapter.manga_id = manga.id
}
// Filter the chapters that couldn't be found.
updateChapters(chapters.filter { it.id != null })
return true return true
} }
@@ -22,12 +22,11 @@ import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.data.database.models.TrackImpl import eu.kanade.tachiyomi.data.database.models.TrackImpl
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import exh.EXHMigrations import exh.EXHMigrations
import rx.Observable
import java.util.Date import java.util.Date
class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBackupRestore<LegacyBackupManager>(context, notifier) { class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : AbstractBackupRestore<LegacyBackupManager>(context, notifier) {
override fun performRestore(uri: Uri): Boolean { override suspend fun performRestore(uri: Uri): Boolean {
// SY --> // SY -->
throttleManager.resetThrottle() throttleManager.resetThrottle()
// SY <-- // SY <--
@@ -91,8 +90,8 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
} }
// SY <-- // SY <--
private fun restoreManga(mangaJson: JsonObject) { private suspend fun restoreManga(mangaJson: JsonObject) {
/* SY --> */ var /* SY <-- */ manga = backupManager.parser.fromJson<MangaImpl>( val manga = backupManager.parser.fromJson<MangaImpl>(
mangaJson.get( mangaJson.get(
Backup.MANGA Backup.MANGA
) )
@@ -115,19 +114,20 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
) )
// EXH --> // EXH -->
manga = EXHMigrations.migrateBackupEntry(manga) EXHMigrations.migrateBackupEntry(manga)
// <-- EXH // <-- EXH
val source = backupManager.sourceManager.get(manga.source)
val sourceName = sourceMapping[manga.source] ?: manga.source.toString()
try { try {
val source = backupManager.sourceManager.get(manga.source)
if (source != null) { if (source != null) {
restoreMangaData(manga, source, chapters, categories, history, tracks) restoreMangaData(manga, source, chapters, categories, history, tracks)
} else { } else {
val sourceName = sourceMapping[manga.source] ?: manga.source.toString() errors.add(Date() to "${manga.title} [$sourceName]: ${context.getString(R.string.source_not_found_name, sourceName)}")
errors.add(Date() to "${manga.title} - ${context.getString(R.string.source_not_found_name, sourceName)}")
} }
} catch (e: Exception) { } catch (e: Exception) {
errors.add(Date() to "${manga.title} - ${e.message}") errors.add(Date() to "${manga.title} [$sourceName]: ${e.message}")
} }
restoreProgress += 1 restoreProgress += 1
@@ -144,7 +144,7 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
* @param history history data from json * @param history history data from json
* @param tracks tracking data from json * @param tracks tracking data from json
*/ */
private fun restoreMangaData( private suspend fun restoreMangaData(
manga: Manga, manga: Manga,
source: Source, source: Source,
chapters: List<Chapter>, chapters: List<Chapter>,
@@ -168,13 +168,13 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
} }
/** /**
* [Observable] that fetches manga information * Fetches manga information.
* *
* @param manga manga that needs updating * @param manga manga that needs updating
* @param chapters chapters of manga that needs updating * @param chapters chapters of manga that needs updating
* @param categories categories that need updating * @param categories categories that need updating
*/ */
private fun restoreMangaFetch( private suspend fun restoreMangaFetch(
source: Source, source: Source,
manga: Manga, manga: Manga,
chapters: List<Chapter>, chapters: List<Chapter>,
@@ -182,27 +182,21 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
history: List<DHistory>, history: List<DHistory>,
tracks: List<Track> tracks: List<Track>
) { ) {
backupManager.restoreMangaFetchObservable(source, manga) try {
.onErrorReturn { val fetchedManga = backupManager.fetchManga(source, manga)
errors.add(Date() to "${manga.title} - ${it.message}") fetchedManga.id ?: return
manga
} updateChapters(source, fetchedManga, chapters)
.filter { it.id != null }
.flatMap { restoreExtraForManga(fetchedManga, categories, history, tracks)
chapterFetchObservable(source, it, chapters)
// Convert to the manga that contains new chapters. updateTracking(fetchedManga, tracks)
.map { manga } } catch (e: Exception) {
} errors.add(Date() to "${manga.title} - ${e.message}")
.doOnNext { }
restoreExtraForManga(it, categories, history, tracks)
}
.flatMap {
trackingFetchObservable(it, tracks)
}
.subscribe()
} }
private fun restoreMangaNoFetch( private suspend fun restoreMangaNoFetch(
source: Source, source: Source,
backupManga: Manga, backupManga: Manga,
chapters: List<Chapter>, chapters: List<Chapter>,
@@ -210,22 +204,13 @@ class LegacyBackupRestore(context: Context, notifier: BackupNotifier) : Abstract
history: List<DHistory>, history: List<DHistory>,
tracks: List<Track> tracks: List<Track>
) { ) {
Observable.just(backupManga) if (!backupManager.restoreChaptersForManga(backupManga, chapters)) {
.flatMap { manga -> updateChapters(source, backupManga, chapters)
if (!backupManager.restoreChaptersForManga(manga, chapters)) { }
chapterFetchObservable(source, manga, chapters)
.map { manga } restoreExtraForManga(backupManga, categories, history, tracks)
} else {
Observable.just(manga) updateTracking(backupManga, tracks)
}
}
.doOnNext {
restoreExtraForManga(it, categories, history, tracks)
}
.flatMap { manga ->
trackingFetchObservable(manga, tracks)
}
.subscribe()
} }
private fun restoreExtraForManga(manga: Manga, categories: List<String>, history: List<DHistory>, tracks: List<Track>) { private fun restoreExtraForManga(manga: Manga, categories: List<String>, history: List<DHistory>, tracks: List<Track>) {
@@ -45,7 +45,7 @@ class LegacyBackupRestoreValidator : AbstractBackupRestoreValidator() {
val missingTrackers = trackers val missingTrackers = trackers
.mapNotNull { trackManager.getService(it) } .mapNotNull { trackManager.getService(it) }
.filter { !it.isLogged } .filter { !it.isLogged }
.map { it.name } .map { context.getString(it.nameRes()) }
.sorted() .sorted()
return Results(missingSources, missingTrackers) return Results(missingSources, missingTrackers)
@@ -18,7 +18,7 @@ object MangaTypeAdapter {
value(it.originalTitle) value(it.originalTitle)
// SY <-- // SY <--
value(it.source) value(it.source)
value(it.viewer) value(it.viewer_flags)
value(it.chapter_flags) value(it.chapter_flags)
endArray() endArray()
} }
@@ -29,7 +29,7 @@ object MangaTypeAdapter {
manga.url = nextString() manga.url = nextString()
manga.title = nextString() manga.title = nextString()
manga.source = nextLong() manga.source = nextLong()
manga.viewer = nextInt() manga.viewer_flags = nextInt()
manga.chapter_flags = nextInt() manga.chapter_flags = nextInt()
endArray() endArray()
manga manga
@@ -2,8 +2,6 @@ package eu.kanade.tachiyomi.data.cache
import android.content.Context import android.content.Context
import android.text.format.Formatter import android.text.format.Formatter
import com.github.salomonbrys.kotson.fromJson
import com.google.gson.Gson
import com.jakewharton.disklrucache.DiskLruCache import com.jakewharton.disklrucache.DiskLruCache
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
@@ -15,10 +13,12 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onEach
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import okhttp3.Response import okhttp3.Response
import okio.buffer import okio.buffer
import okio.sink import okio.sink
import rx.Observable
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
@@ -48,14 +48,12 @@ class ChapterCache(private val context: Context) {
private val scope = CoroutineScope(Job() + Dispatchers.Main) private val scope = CoroutineScope(Job() + Dispatchers.Main)
/** Google Json class used for parsing JSON files. */ /** Google Json class used for parsing JSON files. */
private val gson: Gson by injectLazy() private val json: Json by injectLazy()
// --> EH // --> EH
private val prefs: PreferencesHelper by injectLazy() private val prefs: PreferencesHelper by injectLazy()
// <-- EH
/** Cache class used for cache management. */ /** Cache class used for cache management. */
// --> EH
private var diskCache = setupDiskCache(prefs.cacheSize().get().toLong()) private var diskCache = setupDiskCache(prefs.cacheSize().get().toLong())
init { init {
@@ -73,7 +71,7 @@ class ChapterCache(private val context: Context) {
/** /**
* Returns directory of cache. * Returns directory of cache.
*/ */
val cacheDir: File private val cacheDir: File
get() = diskCache.directory get() = diskCache.directory
/** /**
@@ -100,43 +98,19 @@ class ChapterCache(private val context: Context) {
} }
// <-- EH // <-- EH
/**
* Remove file from cache.
*
* @param file name of file "md5.0".
* @return status of deletion for the file.
*/
fun removeFileFromCache(file: String): Boolean {
// Make sure we don't delete the journal file (keeps track of cache).
if (file == "journal" || file.startsWith("journal.")) {
return false
}
return try {
// Remove the extension from the file to get the key of the cache
val key = file.substringBeforeLast(".")
// Remove file from cache.
diskCache.remove(key)
} catch (e: Exception) {
false
}
}
/** /**
* Get page list from cache. * Get page list from cache.
* *
* @param chapter the chapter. * @param chapter the chapter.
* @return an observable of the list of pages. * @return the list of pages.
*/ */
fun getPageListFromCache(chapter: Chapter): Observable<List<Page>> { fun getPageListFromCache(chapter: Chapter): List<Page> {
return Observable.fromCallable { // Get the key for the chapter.
// Get the key for the chapter. val key = DiskUtil.hashKeyForDisk(getKey(chapter))
val key = DiskUtil.hashKeyForDisk(getKey(chapter))
// Convert JSON string to list of objects. Throws an exception if snapshot is null // Convert JSON string to list of objects. Throws an exception if snapshot is null
diskCache.get(key).use { return diskCache.get(key).use {
gson.fromJson<List<Page>>(it.getString(0)) json.decodeFromString(it.getString(0))
}
} }
} }
@@ -148,7 +122,7 @@ class ChapterCache(private val context: Context) {
*/ */
fun putPageListToCache(chapter: Chapter, pages: List<Page>) { fun putPageListToCache(chapter: Chapter, pages: List<Page>) {
// Convert list of pages to json string. // Convert list of pages to json string.
val cachedValue = gson.toJson(pages) val cachedValue = json.encodeToString(pages)
// Initialize the editor (edits the values for an entry). // Initialize the editor (edits the values for an entry).
var editor: DiskLruCache.Editor? = null var editor: DiskLruCache.Editor? = null
@@ -228,6 +202,38 @@ class ChapterCache(private val context: Context) {
} }
} }
fun clear(): Int {
var deletedFiles = 0
cacheDir.listFiles()?.forEach {
if (removeFileFromCache(it.name)) {
deletedFiles++
}
}
return deletedFiles
}
/**
* Remove file from cache.
*
* @param file name of file "md5.0".
* @return status of deletion for the file.
*/
private fun removeFileFromCache(file: String): Boolean {
// Make sure we don't delete the journal file (keeps track of cache).
if (file == "journal" || file.startsWith("journal.")) {
return false
}
return try {
// Remove the extension from the file to get the key of the cache
val key = file.substringBeforeLast(".")
// Remove file from cache.
diskCache.remove(key)
} catch (e: Exception) {
false
}
}
private fun getKey(chapter: Chapter): String { private fun getKey(chapter: Chapter): String {
return "${chapter.manga_id}${chapter.url}" return "${chapter.manga_id}${chapter.url}"
} }
@@ -1,6 +1,7 @@
package eu.kanade.tachiyomi.data.cache package eu.kanade.tachiyomi.data.cache
import android.content.Context import android.content.Context
import coil.imageLoader
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil
import java.io.File import java.io.File
@@ -99,6 +100,13 @@ class CoverCache(private val context: Context) {
} }
} }
/**
* Clear coil's memory cache.
*/
fun clearMemoryCache() {
context.imageLoader.memoryCache.clear()
}
private fun getCacheDir(dir: String): File { private fun getCacheDir(dir: String): File {
return context.getExternalFilesDir(dir) return context.getExternalFilesDir(dir)
?: File(context.filesDir, dir).also { it.mkdirs() } ?: File(context.filesDir, dir).also { it.mkdirs() }
@@ -0,0 +1,25 @@
package eu.kanade.tachiyomi.data.coil
import coil.bitmap.BitmapPool
import coil.decode.DataSource
import coil.decode.Options
import coil.fetch.FetchResult
import coil.fetch.Fetcher
import coil.fetch.SourceResult
import coil.size.Size
import okio.buffer
import okio.source
import java.io.ByteArrayInputStream
import java.nio.ByteBuffer
class ByteBufferFetcher : Fetcher<ByteBuffer> {
override suspend fun fetch(pool: BitmapPool, data: ByteBuffer, size: Size, options: Options): FetchResult {
return SourceResult(
source = ByteArrayInputStream(data.array()).source().buffer(),
mimeType = null,
dataSource = DataSource.MEMORY
)
}
override fun key(data: ByteBuffer): String? = null
}
@@ -0,0 +1,172 @@
package eu.kanade.tachiyomi.data.coil
import coil.bitmap.BitmapPool
import coil.decode.DataSource
import coil.decode.Options
import coil.fetch.FetchResult
import coil.fetch.Fetcher
import coil.fetch.SourceResult
import coil.network.HttpException
import coil.request.get
import coil.size.Size
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.network.await
import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.CacheControl
import okhttp3.Call
import okhttp3.Request
import okhttp3.Response
import okhttp3.ResponseBody
import okio.buffer
import okio.sink
import okio.source
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy
import java.io.File
import java.util.Date
/**
* Coil component that fetches [Manga] cover while using the cached file in disk when available.
*
* Available request parameter:
* - [USE_CUSTOM_COVER]: Use custom cover if set by user, default is true
*/
class MangaCoverFetcher : Fetcher<Manga> {
private val coverCache: CoverCache by injectLazy()
private val sourceManager: SourceManager by injectLazy()
private val defaultClient = Injekt.get<NetworkHelper>().coilClient
override fun key(data: Manga): String? {
if (data.thumbnail_url.isNullOrBlank()) return null
return data.thumbnail_url!!
}
override suspend fun fetch(pool: BitmapPool, data: Manga, size: Size, options: Options): FetchResult {
// Use custom cover if exists
val useCustomCover = options.parameters[USE_CUSTOM_COVER] as? Boolean ?: true
val customCoverFile = coverCache.getCustomCoverFile(data)
if (useCustomCover && customCoverFile.exists()) {
return fileLoader(customCoverFile)
}
val cover = data.thumbnail_url
return when (getResourceType(cover)) {
Type.URL -> httpLoader(data, options)
Type.File -> fileLoader(data)
null -> error("Invalid image")
}
}
private suspend fun httpLoader(manga: Manga, options: Options): FetchResult {
val coverFile = coverCache.getCoverFile(manga) ?: error("No cover specified")
// Use previously cached cover if exist
if (coverFile.exists() && options.diskCachePolicy.readEnabled) {
if (!manga.favorite) {
coverFile.setLastModified(Date().time)
}
return fileLoader(coverFile)
}
val (response, body) = awaitGetCall(manga, options)
if (!response.isSuccessful) {
body.close()
throw HttpException(response)
}
// Write to disk for future use
if (options.diskCachePolicy.writeEnabled) {
response.peekBody(Long.MAX_VALUE).source().use { input ->
val tmpFile = File(coverFile.absolutePath + "_tmp")
tmpFile.parentFile?.mkdirs()
tmpFile.sink().buffer().use { output ->
output.writeAll(input)
}
if (coverFile.exists()) {
coverFile.delete()
}
tmpFile.renameTo(coverFile)
}
}
return SourceResult(
source = body.source(),
mimeType = "image/*",
dataSource = if (response.cacheResponse != null) DataSource.DISK else DataSource.NETWORK
)
}
private suspend fun awaitGetCall(manga: Manga, options: Options): Pair<Response, ResponseBody> {
val call = getCall(manga, options)
val response = call.await()
return response to checkNotNull(response.body) { "Null response source" }
}
private fun getCall(manga: Manga, options: Options): Call {
val source = sourceManager.get(manga.source) as? HttpSource
val client = source?.client ?: defaultClient
val newClient = client.newBuilder().build()
val request = Request.Builder().url(manga.thumbnail_url!!).also {
if (source != null) {
it.headers(source.headers)
}
val networkRead = options.networkCachePolicy.readEnabled
val diskRead = options.diskCachePolicy.readEnabled
when {
!networkRead && diskRead -> {
it.cacheControl(CacheControl.FORCE_CACHE)
}
networkRead && !diskRead -> if (options.diskCachePolicy.writeEnabled) {
it.cacheControl(CacheControl.FORCE_NETWORK)
} else {
it.cacheControl(CACHE_CONTROL_FORCE_NETWORK_NO_CACHE)
}
!networkRead && !diskRead -> {
// This causes the request to fail with a 504 Unsatisfiable Request.
it.cacheControl(CACHE_CONTROL_NO_NETWORK_NO_CACHE)
}
}
}.build()
return newClient.newCall(request)
}
private fun fileLoader(manga: Manga): FetchResult {
return fileLoader(File(manga.thumbnail_url!!.substringAfter("file://")))
}
private fun fileLoader(file: File): FetchResult {
return SourceResult(
source = file.source().buffer(),
mimeType = "image/*",
dataSource = DataSource.DISK
)
}
private fun getResourceType(cover: String?): Type? {
return when {
cover.isNullOrEmpty() -> null
cover.startsWith("http") || cover.startsWith("Custom-", true) -> Type.URL
cover.startsWith("/") || cover.startsWith("file://") -> Type.File
else -> null
}
}
private enum class Type {
File, URL
}
companion object {
const val USE_CUSTOM_COVER = "use_custom_cover"
private val CACHE_CONTROL_FORCE_NETWORK_NO_CACHE = CacheControl.Builder().noCache().noStore().build()
private val CACHE_CONTROL_NO_NETWORK_NO_CACHE = CacheControl.Builder().noCache().onlyIfCached().build()
}
}
@@ -21,9 +21,6 @@ import eu.kanade.tachiyomi.data.database.queries.HistoryQueries
import eu.kanade.tachiyomi.data.database.queries.MangaCategoryQueries import eu.kanade.tachiyomi.data.database.queries.MangaCategoryQueries
import eu.kanade.tachiyomi.data.database.queries.MangaQueries import eu.kanade.tachiyomi.data.database.queries.MangaQueries
import eu.kanade.tachiyomi.data.database.queries.TrackQueries import eu.kanade.tachiyomi.data.database.queries.TrackQueries
import exh.md.similar.sql.mappers.SimilarTypeMapping
import exh.md.similar.sql.models.MangaSimilar
import exh.md.similar.sql.queries.SimilarQueries
import exh.merged.sql.mappers.MergedMangaTypeMapping import exh.merged.sql.mappers.MergedMangaTypeMapping
import exh.merged.sql.models.MergedMangaReference import exh.merged.sql.models.MergedMangaReference
import exh.merged.sql.queries.MergedQueries import exh.merged.sql.queries.MergedQueries
@@ -42,7 +39,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory
* This class provides operations to manage the database through its interfaces. * This class provides operations to manage the database through its interfaces.
*/ */
open class DatabaseHelper(context: Context) : open class DatabaseHelper(context: Context) :
MangaQueries, ChapterQueries, TrackQueries, CategoryQueries, MangaCategoryQueries, HistoryQueries /* SY --> */, SearchMetadataQueries, SearchTagQueries, SearchTitleQueries, MergedQueries, SimilarQueries /* SY <-- */ { MangaQueries, ChapterQueries, TrackQueries, CategoryQueries, MangaCategoryQueries, HistoryQueries /* SY --> */, SearchMetadataQueries, SearchTagQueries, SearchTitleQueries, MergedQueries /* SY <-- */ {
private val configuration = SupportSQLiteOpenHelper.Configuration.builder(context) private val configuration = SupportSQLiteOpenHelper.Configuration.builder(context)
.name(DbOpenCallback.DATABASE_NAME) .name(DbOpenCallback.DATABASE_NAME)
@@ -62,7 +59,6 @@ open class DatabaseHelper(context: Context) :
.addTypeMapping(SearchTag::class.java, SearchTagTypeMapping()) .addTypeMapping(SearchTag::class.java, SearchTagTypeMapping())
.addTypeMapping(SearchTitle::class.java, SearchTitleTypeMapping()) .addTypeMapping(SearchTitle::class.java, SearchTitleTypeMapping())
.addTypeMapping(MergedMangaReference::class.java, MergedMangaTypeMapping()) .addTypeMapping(MergedMangaReference::class.java, MergedMangaTypeMapping())
.addTypeMapping(MangaSimilar::class.java, SimilarTypeMapping())
// SY <-- // SY <--
.build() .build()
@@ -8,7 +8,6 @@ import eu.kanade.tachiyomi.data.database.tables.HistoryTable
import eu.kanade.tachiyomi.data.database.tables.MangaCategoryTable import eu.kanade.tachiyomi.data.database.tables.MangaCategoryTable
import eu.kanade.tachiyomi.data.database.tables.MangaTable import eu.kanade.tachiyomi.data.database.tables.MangaTable
import eu.kanade.tachiyomi.data.database.tables.TrackTable import eu.kanade.tachiyomi.data.database.tables.TrackTable
import exh.md.similar.sql.tables.SimilarTable
import exh.merged.sql.tables.MergedTable import exh.merged.sql.tables.MergedTable
import exh.metadata.sql.tables.SearchMetadataTable import exh.metadata.sql.tables.SearchMetadataTable
import exh.metadata.sql.tables.SearchTagTable import exh.metadata.sql.tables.SearchTagTable
@@ -25,7 +24,7 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(DATABASE_VERSION) {
/** /**
* Version of the database. * Version of the database.
*/ */
const val DATABASE_VERSION = /* SY --> */ 5 /* SY <-- */ const val DATABASE_VERSION = /* SY --> */ 7 /* SY <-- */
} }
override fun onCreate(db: SupportSQLiteDatabase) = with(db) { override fun onCreate(db: SupportSQLiteDatabase) = with(db) {
@@ -40,7 +39,6 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(DATABASE_VERSION) {
execSQL(SearchTagTable.createTableQuery) execSQL(SearchTagTable.createTableQuery)
execSQL(SearchTitleTable.createTableQuery) execSQL(SearchTitleTable.createTableQuery)
execSQL(MergedTable.createTableQuery) execSQL(MergedTable.createTableQuery)
execSQL(SimilarTable.createTableQuery)
// SY <-- // SY <--
// DB indexes // DB indexes
@@ -57,7 +55,6 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(DATABASE_VERSION) {
execSQL(SearchTitleTable.createMangaIdIndexQuery) execSQL(SearchTitleTable.createMangaIdIndexQuery)
execSQL(SearchTitleTable.createTitleIndexQuery) execSQL(SearchTitleTable.createTitleIndexQuery)
execSQL(MergedTable.createIndexQuery) execSQL(MergedTable.createIndexQuery)
execSQL(SimilarTable.createMangaIdIndexQuery)
// SY <-- // SY <--
} }
@@ -74,9 +71,15 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(DATABASE_VERSION) {
db.execSQL(MergedTable.createTableQuery) db.execSQL(MergedTable.createTableQuery)
db.execSQL(MergedTable.createIndexQuery) db.execSQL(MergedTable.createIndexQuery)
} }
if (oldVersion < 5) { /*if (oldVersion < 5) {
db.execSQL(SimilarTable.createTableQuery) db.execSQL(SimilarTable.createTableQuery)
db.execSQL(SimilarTable.createMangaIdIndexQuery) db.execSQL(SimilarTable.createMangaIdIndexQuery)
}*/
if (oldVersion < 6) {
db.execSQL(MangaTable.addFilteredScanlators)
}
if (oldVersion < 7) {
db.execSQL("DROP TABLE IF EXISTS manga_related")
} }
} }
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -36,16 +36,14 @@ class CategoryPutResolver : DefaultPutResolver<Category>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: Category) = ContentValues(4).apply { override fun mapToContentValues(obj: Category) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_NAME, obj.name) COL_ID to obj.id,
put(COL_ORDER, obj.order) COL_NAME to obj.name,
put(COL_FLAGS, obj.flags) COL_ORDER to obj.order,
// SY --> COL_FLAGS to obj.flags,
val orderString = obj.mangaOrder.joinToString("/") COL_MANGA_ORDER to obj.mangaOrder.joinToString("/")
put(COL_MANGA_ORDER, orderString) )
// SY <--
}
} }
class CategoryGetResolver : DefaultGetResolver<Category>() { class CategoryGetResolver : DefaultGetResolver<Category>() {
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -43,20 +43,21 @@ class ChapterPutResolver : DefaultPutResolver<Chapter>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: Chapter) = ContentValues(11).apply { override fun mapToContentValues(obj: Chapter) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_MANGA_ID, obj.manga_id) COL_ID to obj.id,
put(COL_URL, obj.url) COL_MANGA_ID to obj.manga_id,
put(COL_NAME, obj.name) COL_URL to obj.url,
put(COL_READ, obj.read) COL_NAME to obj.name,
put(COL_SCANLATOR, obj.scanlator) COL_READ to obj.read,
put(COL_BOOKMARK, obj.bookmark) COL_SCANLATOR to obj.scanlator,
put(COL_DATE_FETCH, obj.date_fetch) COL_BOOKMARK to obj.bookmark,
put(COL_DATE_UPLOAD, obj.date_upload) COL_DATE_FETCH to obj.date_fetch,
put(COL_LAST_PAGE_READ, obj.last_page_read) COL_DATE_UPLOAD to obj.date_upload,
put(COL_CHAPTER_NUMBER, obj.chapter_number) COL_LAST_PAGE_READ to obj.last_page_read,
put(COL_SOURCE_ORDER, obj.source_order) COL_CHAPTER_NUMBER to obj.chapter_number,
} COL_SOURCE_ORDER to obj.source_order
)
} }
class ChapterGetResolver : DefaultGetResolver<Chapter>() { class ChapterGetResolver : DefaultGetResolver<Chapter>() {
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -35,12 +35,13 @@ open class HistoryPutResolver : DefaultPutResolver<History>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: History) = ContentValues(4).apply { override fun mapToContentValues(obj: History) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_CHAPTER_ID, obj.chapter_id) COL_ID to obj.id,
put(COL_LAST_READ, obj.last_read) COL_CHAPTER_ID to obj.chapter_id,
put(COL_TIME_READ, obj.time_read) COL_LAST_READ to obj.last_read,
} COL_TIME_READ to obj.time_read
)
} }
class HistoryGetResolver : DefaultGetResolver<History>() { class HistoryGetResolver : DefaultGetResolver<History>() {
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -33,11 +33,12 @@ class MangaCategoryPutResolver : DefaultPutResolver<MangaCategory>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: MangaCategory) = ContentValues(3).apply { override fun mapToContentValues(obj: MangaCategory) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_MANGA_ID, obj.manga_id) COL_ID to obj.id,
put(COL_CATEGORY_ID, obj.category_id) COL_MANGA_ID to obj.manga_id,
} COL_CATEGORY_ID to obj.category_id
)
} }
class MangaCategoryGetResolver : DefaultGetResolver<MangaCategory>() { class MangaCategoryGetResolver : DefaultGetResolver<MangaCategory>() {
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_COVER_LAST_MODIFI
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DATE_ADDED import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DATE_ADDED
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DESCRIPTION import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DESCRIPTION
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_FAVORITE import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_FAVORITE
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_FILTERED_SCANLATORS
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_GENRE import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_GENRE
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_ID import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_ID
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_INITIALIZED import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_INITIALIZED
@@ -48,27 +49,29 @@ class MangaPutResolver : DefaultPutResolver<Manga>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: Manga) = ContentValues(17).apply { override fun mapToContentValues(obj: Manga) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_SOURCE, obj.source) COL_ID to obj.id,
put(COL_URL, obj.url) COL_SOURCE to obj.source,
// SY --> COL_URL to obj.url,
put(COL_ARTIST, obj.originalArtist) // SY -->
put(COL_AUTHOR, obj.originalAuthor) COL_ARTIST to obj.originalArtist,
put(COL_DESCRIPTION, obj.originalDescription) COL_AUTHOR to obj.originalAuthor,
put(COL_GENRE, obj.originalGenre) COL_DESCRIPTION to obj.originalDescription,
put(COL_TITLE, obj.originalTitle) COL_GENRE to obj.originalGenre,
// SY <-- COL_TITLE to obj.originalTitle,
put(COL_STATUS, obj.status) COL_STATUS to obj.originalStatus,
put(COL_THUMBNAIL_URL, obj.thumbnail_url) // SY <--
put(COL_FAVORITE, obj.favorite) COL_THUMBNAIL_URL to obj.thumbnail_url,
put(COL_LAST_UPDATE, obj.last_update) COL_FAVORITE to obj.favorite,
put(COL_INITIALIZED, obj.initialized) COL_LAST_UPDATE to obj.last_update,
put(COL_VIEWER, obj.viewer) COL_INITIALIZED to obj.initialized,
put(COL_CHAPTER_FLAGS, obj.chapter_flags) COL_VIEWER to obj.viewer_flags,
put(COL_COVER_LAST_MODIFIED, obj.cover_last_modified) COL_CHAPTER_FLAGS to obj.chapter_flags,
put(COL_DATE_ADDED, obj.date_added) COL_COVER_LAST_MODIFIED to obj.cover_last_modified,
} COL_DATE_ADDED to obj.date_added,
COL_FILTERED_SCANLATORS to obj.filtered_scanlators
)
} }
interface BaseMangaGetResolver { interface BaseMangaGetResolver {
@@ -86,10 +89,11 @@ interface BaseMangaGetResolver {
favorite = cursor.getInt(cursor.getColumnIndex(COL_FAVORITE)) == 1 favorite = cursor.getInt(cursor.getColumnIndex(COL_FAVORITE)) == 1
last_update = cursor.getLong(cursor.getColumnIndex(COL_LAST_UPDATE)) last_update = cursor.getLong(cursor.getColumnIndex(COL_LAST_UPDATE))
initialized = cursor.getInt(cursor.getColumnIndex(COL_INITIALIZED)) == 1 initialized = cursor.getInt(cursor.getColumnIndex(COL_INITIALIZED)) == 1
viewer = cursor.getInt(cursor.getColumnIndex(COL_VIEWER)) viewer_flags = cursor.getInt(cursor.getColumnIndex(COL_VIEWER))
chapter_flags = cursor.getInt(cursor.getColumnIndex(COL_CHAPTER_FLAGS)) chapter_flags = cursor.getInt(cursor.getColumnIndex(COL_CHAPTER_FLAGS))
cover_last_modified = cursor.getLong(cursor.getColumnIndex(COL_COVER_LAST_MODIFIED)) cover_last_modified = cursor.getLong(cursor.getColumnIndex(COL_COVER_LAST_MODIFIED))
date_added = cursor.getLong(cursor.getColumnIndex(COL_DATE_ADDED)) date_added = cursor.getLong(cursor.getColumnIndex(COL_DATE_ADDED))
filtered_scanlators = cursor.getString(cursor.getColumnIndex(COL_FILTERED_SCANLATORS))
} }
} }
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.mappers package eu.kanade.tachiyomi.data.database.mappers
import android.content.ContentValues
import android.database.Cursor import android.database.Cursor
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping import com.pushtorefresh.storio.sqlite.SQLiteTypeMapping
import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver import com.pushtorefresh.storio.sqlite.operations.delete.DefaultDeleteResolver
import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver import com.pushtorefresh.storio.sqlite.operations.get.DefaultGetResolver
@@ -44,21 +44,22 @@ class TrackPutResolver : DefaultPutResolver<Track>() {
.whereArgs(obj.id) .whereArgs(obj.id)
.build() .build()
override fun mapToContentValues(obj: Track) = ContentValues(10).apply { override fun mapToContentValues(obj: Track) =
put(COL_ID, obj.id) contentValuesOf(
put(COL_MANGA_ID, obj.manga_id) COL_ID to obj.id,
put(COL_SYNC_ID, obj.sync_id) COL_MANGA_ID to obj.manga_id,
put(COL_MEDIA_ID, obj.media_id) COL_SYNC_ID to obj.sync_id,
put(COL_LIBRARY_ID, obj.library_id) COL_MEDIA_ID to obj.media_id,
put(COL_TITLE, obj.title) COL_LIBRARY_ID to obj.library_id,
put(COL_LAST_CHAPTER_READ, obj.last_chapter_read) COL_TITLE to obj.title,
put(COL_TOTAL_CHAPTERS, obj.total_chapters) COL_LAST_CHAPTER_READ to obj.last_chapter_read,
put(COL_STATUS, obj.status) COL_TOTAL_CHAPTERS to obj.total_chapters,
put(COL_TRACKING_URL, obj.tracking_url) COL_STATUS to obj.status,
put(COL_SCORE, obj.score) COL_TRACKING_URL to obj.tracking_url,
put(COL_START_DATE, obj.started_reading_date) COL_SCORE to obj.score,
put(COL_FINISH_DATE, obj.finished_reading_date) COL_START_DATE to obj.started_reading_date,
} COL_FINISH_DATE to obj.finished_reading_date
)
} }
class TrackGetResolver : DefaultGetResolver<Track>() { class TrackGetResolver : DefaultGetResolver<Track>() {
@@ -1,6 +1,8 @@
package eu.kanade.tachiyomi.data.database.models package eu.kanade.tachiyomi.data.database.models
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
import tachiyomi.source.model.MangaInfo import tachiyomi.source.model.MangaInfo
interface Manga : SManga { interface Manga : SManga {
@@ -15,18 +17,20 @@ interface Manga : SManga {
var date_added: Long var date_added: Long
var viewer: Int var viewer_flags: Int
var chapter_flags: Int var chapter_flags: Int
var cover_last_modified: Long var cover_last_modified: Long
var filtered_scanlators: String?
fun setChapterOrder(order: Int) { fun setChapterOrder(order: Int) {
setFlags(order, SORT_MASK) setChapterFlags(order, CHAPTER_SORT_MASK)
} }
fun sortDescending(): Boolean { fun sortDescending(): Boolean {
return chapter_flags and SORT_MASK == SORT_DESC return chapter_flags and CHAPTER_SORT_MASK == CHAPTER_SORT_DESC
} }
fun getGenres(): List<String>? { fun getGenres(): List<String>? {
@@ -39,60 +43,72 @@ interface Manga : SManga {
} }
// SY <-- // SY <--
private fun setFlags(flag: Int, mask: Int) { private fun setChapterFlags(flag: Int, mask: Int) {
chapter_flags = chapter_flags and mask.inv() or (flag and mask) chapter_flags = chapter_flags and mask.inv() or (flag and mask)
} }
private fun setViewerFlags(flag: Int, mask: Int) {
viewer_flags = viewer_flags and mask.inv() or (flag and mask)
}
// Used to display the chapter's title one way or another // Used to display the chapter's title one way or another
var displayMode: Int var displayMode: Int
get() = chapter_flags and DISPLAY_MASK get() = chapter_flags and CHAPTER_DISPLAY_MASK
set(mode) = setFlags(mode, DISPLAY_MASK) set(mode) = setChapterFlags(mode, CHAPTER_DISPLAY_MASK)
var readFilter: Int var readFilter: Int
get() = chapter_flags and READ_MASK get() = chapter_flags and CHAPTER_READ_MASK
set(filter) = setFlags(filter, READ_MASK) set(filter) = setChapterFlags(filter, CHAPTER_READ_MASK)
var downloadedFilter: Int var downloadedFilter: Int
get() = chapter_flags and DOWNLOADED_MASK get() = chapter_flags and CHAPTER_DOWNLOADED_MASK
set(filter) = setFlags(filter, DOWNLOADED_MASK) set(filter) = setChapterFlags(filter, CHAPTER_DOWNLOADED_MASK)
var bookmarkedFilter: Int var bookmarkedFilter: Int
get() = chapter_flags and BOOKMARKED_MASK get() = chapter_flags and CHAPTER_BOOKMARKED_MASK
set(filter) = setFlags(filter, BOOKMARKED_MASK) set(filter) = setChapterFlags(filter, CHAPTER_BOOKMARKED_MASK)
var sorting: Int var sorting: Int
get() = chapter_flags and SORTING_MASK get() = chapter_flags and CHAPTER_SORTING_MASK
set(sort) = setFlags(sort, SORTING_MASK) set(sort) = setChapterFlags(sort, CHAPTER_SORTING_MASK)
var readingModeType: Int
get() = viewer_flags and ReadingModeType.MASK
set(readingMode) = setViewerFlags(readingMode, ReadingModeType.MASK)
var orientationType: Int
get() = viewer_flags and OrientationType.MASK
set(rotationType) = setViewerFlags(rotationType, OrientationType.MASK)
companion object { companion object {
const val SORT_DESC = 0x00000000
const val SORT_ASC = 0x00000001
const val SORT_MASK = 0x00000001
// Generic filter that does not filter anything // Generic filter that does not filter anything
const val SHOW_ALL = 0x00000000 const val SHOW_ALL = 0x00000000
const val SHOW_UNREAD = 0x00000002 const val CHAPTER_SORT_DESC = 0x00000000
const val SHOW_READ = 0x00000004 const val CHAPTER_SORT_ASC = 0x00000001
const val READ_MASK = 0x00000006 const val CHAPTER_SORT_MASK = 0x00000001
const val SHOW_DOWNLOADED = 0x00000008 const val CHAPTER_SHOW_UNREAD = 0x00000002
const val SHOW_NOT_DOWNLOADED = 0x00000010 const val CHAPTER_SHOW_READ = 0x00000004
const val DOWNLOADED_MASK = 0x00000018 const val CHAPTER_READ_MASK = 0x00000006
const val SHOW_BOOKMARKED = 0x00000020 const val CHAPTER_SHOW_DOWNLOADED = 0x00000008
const val SHOW_NOT_BOOKMARKED = 0x00000040 const val CHAPTER_SHOW_NOT_DOWNLOADED = 0x00000010
const val BOOKMARKED_MASK = 0x00000060 const val CHAPTER_DOWNLOADED_MASK = 0x00000018
const val SORTING_SOURCE = 0x00000000 const val CHAPTER_SHOW_BOOKMARKED = 0x00000020
const val SORTING_NUMBER = 0x00000100 const val CHAPTER_SHOW_NOT_BOOKMARKED = 0x00000040
const val SORTING_UPLOAD_DATE = 0x00000200 const val CHAPTER_BOOKMARKED_MASK = 0x00000060
const val SORTING_MASK = 0x00000300
const val DISPLAY_NAME = 0x00000000 const val CHAPTER_SORTING_SOURCE = 0x00000000
const val DISPLAY_NUMBER = 0x00100000 const val CHAPTER_SORTING_NUMBER = 0x00000100
const val DISPLAY_MASK = 0x00100000 const val CHAPTER_SORTING_UPLOAD_DATE = 0x00000200
const val CHAPTER_SORTING_MASK = 0x00000300
const val CHAPTER_DISPLAY_NAME = 0x00000000
const val CHAPTER_DISPLAY_NUMBER = 0x00100000
const val CHAPTER_DISPLAY_MASK = 0x00100000
fun create(source: Long): Manga = MangaImpl().apply { fun create(source: Long): Manga = MangaImpl().apply {
this.source = source this.source = source
@@ -40,9 +40,11 @@ open class MangaImpl : Manga {
override var genre: String? override var genre: String?
get() = if (favorite) customMangaManager.getManga(this)?.genre ?: ogGenre else ogGenre get() = if (favorite) customMangaManager.getManga(this)?.genre ?: ogGenre else ogGenre
set(value) { ogGenre = value } set(value) { ogGenre = value }
// SY <--
override var status: Int = 0 override var status: Int
get() = if (favorite) customMangaManager.getManga(this)?.status?.takeUnless { it == 0 } ?: ogStatus else ogStatus
set(value) { ogStatus = value }
// SY <--
override var thumbnail_url: String? = null override var thumbnail_url: String? = null
@@ -54,12 +56,14 @@ open class MangaImpl : Manga {
override var initialized: Boolean = false override var initialized: Boolean = false
override var viewer: Int = 0 override var viewer_flags: Int = 0
override var chapter_flags: Int = 0 override var chapter_flags: Int = 0
override var cover_last_modified: Long = 0 override var cover_last_modified: Long = 0
override var filtered_scanlators: String? = null
// SY --> // SY -->
lateinit var ogTitle: String lateinit var ogTitle: String
private set private set
@@ -71,6 +75,8 @@ open class MangaImpl : Manga {
private set private set
var ogGenre: String? = null var ogGenre: String? = null
private set private set
var ogStatus: Int = 0
private set
// SY <-- // SY <--
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
@@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.MangaChapter import eu.kanade.tachiyomi.data.database.models.MangaChapter
import eu.kanade.tachiyomi.data.database.resolvers.ChapterBackupPutResolver import eu.kanade.tachiyomi.data.database.resolvers.ChapterBackupPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.ChapterKnownBackupPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.ChapterProgressPutResolver import eu.kanade.tachiyomi.data.database.resolvers.ChapterProgressPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.ChapterSourceOrderPutResolver import eu.kanade.tachiyomi.data.database.resolvers.ChapterSourceOrderPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaChapterGetResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaChapterGetResolver
@@ -111,6 +112,11 @@ interface ChapterQueries : DbProvider {
.withPutResolver(ChapterBackupPutResolver()) .withPutResolver(ChapterBackupPutResolver())
.prepare() .prepare()
fun updateKnownChaptersBackup(chapters: List<Chapter>) = db.put()
.objects(chapters)
.withPutResolver(ChapterKnownBackupPutResolver())
.prepare()
fun updateChapterProgress(chapter: Chapter) = db.put() fun updateChapterProgress(chapter: Chapter) = db.put()
.`object`(chapter) .`object`(chapter)
.withPutResolver(ChapterProgressPutResolver()) .withPutResolver(ChapterProgressPutResolver())
@@ -9,12 +9,13 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.resolvers.LibraryMangaGetResolver import eu.kanade.tachiyomi.data.database.resolvers.LibraryMangaGetResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaCoverLastModifiedPutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaCoverLastModifiedPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaFavoritePutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaFavoritePutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaFilteredScanlatorsPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaFlagsPutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaFlagsPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaInfoPutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaInfoPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaLastUpdatedPutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaLastUpdatedPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaMigrationPutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaMigrationPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaThumbnailPutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaTitlePutResolver import eu.kanade.tachiyomi.data.database.resolvers.MangaTitlePutResolver
import eu.kanade.tachiyomi.data.database.resolvers.MangaViewerPutResolver
import eu.kanade.tachiyomi.data.database.tables.CategoryTable import eu.kanade.tachiyomi.data.database.tables.CategoryTable
import eu.kanade.tachiyomi.data.database.tables.ChapterTable import eu.kanade.tachiyomi.data.database.tables.ChapterTable
import eu.kanade.tachiyomi.data.database.tables.MangaCategoryTable import eu.kanade.tachiyomi.data.database.tables.MangaCategoryTable
@@ -79,6 +80,15 @@ interface MangaQueries : DbProvider {
.prepare() .prepare()
// SY --> // SY -->
fun getReadNotInLibraryMangas() = db.get()
.listOfObjects(Manga::class.java)
.withQuery(
RawQuery.builder()
.query(getReadMangaNotInLibraryQuery())
.build()
)
.prepare()
fun updateMangaInfo(manga: Manga) = db.put() fun updateMangaInfo(manga: Manga) = db.put()
.`object`(manga) .`object`(manga)
.withPutResolver(MangaInfoPutResolver()) .withPutResolver(MangaInfoPutResolver())
@@ -93,20 +103,35 @@ interface MangaQueries : DbProvider {
.`object`(manga) .`object`(manga)
.withPutResolver(MangaMigrationPutResolver()) .withPutResolver(MangaMigrationPutResolver())
.prepare() .prepare()
fun updateMangaThumbnail(manga: Manga) = db.put()
.`object`(manga)
.withPutResolver(MangaThumbnailPutResolver())
.prepare()
// SY <-- // SY <--
fun insertManga(manga: Manga) = db.put().`object`(manga).prepare() fun insertManga(manga: Manga) = db.put().`object`(manga).prepare()
fun insertMangas(mangas: List<Manga>) = db.put().objects(mangas).prepare() fun insertMangas(mangas: List<Manga>) = db.put().objects(mangas).prepare()
fun updateFlags(manga: Manga) = db.put() fun updateChapterFlags(manga: Manga) = db.put()
.`object`(manga) .`object`(manga)
.withPutResolver(MangaFlagsPutResolver()) .withPutResolver(MangaFlagsPutResolver(MangaTable.COL_CHAPTER_FLAGS, Manga::chapter_flags))
.prepare() .prepare()
fun updateFlags(mangas: List<Manga>) = db.put() fun updateChapterFlags(manga: List<Manga>) = db.put()
.objects(mangas) .objects(manga)
.withPutResolver(MangaFlagsPutResolver(true)) .withPutResolver(MangaFlagsPutResolver(MangaTable.COL_CHAPTER_FLAGS, Manga::chapter_flags, true))
.prepare()
fun updateViewerFlags(manga: Manga) = db.put()
.`object`(manga)
.withPutResolver(MangaFlagsPutResolver(MangaTable.COL_VIEWER, Manga::viewer_flags))
.prepare()
fun updateViewerFlags(manga: List<Manga>) = db.put()
.objects(manga)
.withPutResolver(MangaFlagsPutResolver(MangaTable.COL_VIEWER, Manga::viewer_flags, true))
.prepare() .prepare()
fun updateLastUpdated(manga: Manga) = db.put() fun updateLastUpdated(manga: Manga) = db.put()
@@ -119,11 +144,6 @@ interface MangaQueries : DbProvider {
.withPutResolver(MangaFavoritePutResolver()) .withPutResolver(MangaFavoritePutResolver())
.prepare() .prepare()
fun updateMangaViewer(manga: Manga) = db.put()
.`object`(manga)
.withPutResolver(MangaViewerPutResolver())
.prepare()
fun updateMangaTitle(manga: Manga) = db.put() fun updateMangaTitle(manga: Manga) = db.put()
.`object`(manga) .`object`(manga)
.withPutResolver(MangaTitlePutResolver()) .withPutResolver(MangaTitlePutResolver())
@@ -134,6 +154,13 @@ interface MangaQueries : DbProvider {
.withPutResolver(MangaCoverLastModifiedPutResolver()) .withPutResolver(MangaCoverLastModifiedPutResolver())
.prepare() .prepare()
// SY -->
fun updateMangaFilteredScanlators(manga: Manga) = db.put()
.`object`(manga)
.withPutResolver(MangaFilteredScanlatorsPutResolver())
.prepare()
// SY <--
fun deleteManga(manga: Manga) = db.delete().`object`(manga).prepare() fun deleteManga(manga: Manga) = db.delete().`object`(manga).prepare()
fun deleteMangas(mangas: List<Manga>) = db.delete().objects(mangas).prepare() fun deleteMangas(mangas: List<Manga>) = db.delete().objects(mangas).prepare()
@@ -142,12 +169,38 @@ interface MangaQueries : DbProvider {
.byQuery( .byQuery(
DeleteQuery.builder() DeleteQuery.builder()
.table(MangaTable.TABLE) .table(MangaTable.TABLE)
.where("${MangaTable.COL_FAVORITE} = ? AND ${MangaTable.COL_ID} NOT IN (SELECT ${MergedTable.COL_MANGA_ID} FROM ${MergedTable.TABLE})") .where(
"""
${MangaTable.COL_FAVORITE} = ? AND ${MangaTable.COL_ID} NOT IN (
SELECT ${MergedTable.COL_MANGA_ID} FROM ${MergedTable.TABLE} WHERE ${MergedTable.COL_MANGA_ID} != ${MergedTable.COL_MERGE_ID}
)
""".trimIndent()
)
.whereArgs(0) .whereArgs(0)
.build() .build()
) )
.prepare() .prepare()
// SY -->
fun deleteMangasNotInLibraryAndNotRead() = db.delete()
.byQuery(
DeleteQuery.builder()
.table(MangaTable.TABLE)
.where(
"""
${MangaTable.COL_FAVORITE} = ? AND ${MangaTable.COL_ID} NOT IN (
SELECT ${MergedTable.COL_MANGA_ID} FROM ${MergedTable.TABLE} WHERE ${MergedTable.COL_MANGA_ID} != ${MergedTable.COL_MERGE_ID}
) AND ${MangaTable.COL_ID} NOT IN (
SELECT ${ChapterTable.COL_MANGA_ID} FROM ${ChapterTable.TABLE} WHERE ${ChapterTable.COL_READ} = 1 OR ${ChapterTable.COL_LAST_PAGE_READ} != 0
)
""".trimIndent()
)
.whereArgs(0)
.build()
)
.prepare()
// SY <--
fun deleteMangas() = db.delete() fun deleteMangas() = db.delete()
.byQuery( .byQuery(
DeleteQuery.builder() DeleteQuery.builder()
@@ -186,6 +239,16 @@ interface MangaQueries : DbProvider {
) )
.prepare() .prepare()
fun getChapterFetchDateManga() = db.get()
.listOfObjects(Manga::class.java)
.withQuery(
RawQuery.builder()
.query(getChapterFetchDateMangaQuery())
.observesTables(MangaTable.TABLE)
.build()
)
.prepare()
// SY --> // SY -->
fun getMangaWithMetadata() = db.get() fun getMangaWithMetadata() = db.get()
.listOfObjects(Manga::class.java) .listOfObjects(Manga::class.java)
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.queries package eu.kanade.tachiyomi.data.database.queries
import exh.MERGED_SOURCE_ID import exh.source.MERGED_SOURCE_ID
import eu.kanade.tachiyomi.data.database.tables.CategoryTable as Category import eu.kanade.tachiyomi.data.database.tables.CategoryTable as Category
import eu.kanade.tachiyomi.data.database.tables.ChapterTable as Chapter import eu.kanade.tachiyomi.data.database.tables.ChapterTable as Chapter
import eu.kanade.tachiyomi.data.database.tables.HistoryTable as History import eu.kanade.tachiyomi.data.database.tables.HistoryTable as History
@@ -61,6 +61,18 @@ fun getMergedChaptersQuery() =
ON ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} = M.${Merged.COL_MANGA_ID} ON ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} = M.${Merged.COL_MANGA_ID}
""" """
/**
* Query to get manga that are not in library, but have read chapters
*/
fun getReadMangaNotInLibraryQuery() =
"""
SELECT ${Manga.TABLE}.*
FROM ${Manga.TABLE}
WHERE ${Manga.COL_FAVORITE} = 0 AND ${Manga.COL_ID} IN(
SELECT ${Chapter.TABLE}.${Chapter.COL_MANGA_ID} FROM ${Chapter.TABLE} WHERE ${Chapter.COL_READ} = 1 OR ${Chapter.COL_LAST_PAGE_READ} != 0
)
"""
/** /**
* Query to get the manga from the library, with their categories and unread count. * Query to get the manga from the library, with their categories and unread count.
*/ */
@@ -209,6 +221,16 @@ fun getLatestChapterMangaQuery() =
ORDER by max DESC ORDER by max DESC
""" """
fun getChapterFetchDateMangaQuery() =
"""
SELECT ${Manga.TABLE}.*, MAX(${Chapter.TABLE}.${Chapter.COL_DATE_FETCH}) AS max
FROM ${Manga.TABLE}
JOIN ${Chapter.TABLE}
ON ${Manga.TABLE}.${Manga.COL_ID} = ${Chapter.TABLE}.${Chapter.COL_MANGA_ID}
GROUP BY ${Manga.TABLE}.${Manga.COL_ID}
ORDER by max DESC
"""
/** /**
* Query to get the categories for a manga. * Query to get the categories for a manga.
*/ */
@@ -10,6 +10,15 @@ import eu.kanade.tachiyomi.data.track.TrackService
interface TrackQueries : DbProvider { interface TrackQueries : DbProvider {
fun getTracks() = db.get()
.listOfObjects(Track::class.java)
.withQuery(
Query.builder()
.table(TrackTable.TABLE)
.build()
)
.prepare()
fun getTracks(manga: Manga) = db.get() fun getTracks(manga: Manga) = db.get()
.listOfObjects(Track::class.java) .listOfObjects(Track::class.java)
.withQuery( .withQuery(
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,9 +25,10 @@ class ChapterBackupPutResolver : PutResolver<Chapter>() {
.whereArgs(chapter.url) .whereArgs(chapter.url)
.build() .build()
fun mapToContentValues(chapter: Chapter) = ContentValues(3).apply { fun mapToContentValues(chapter: Chapter) =
put(ChapterTable.COL_READ, chapter.read) contentValuesOf(
put(ChapterTable.COL_BOOKMARK, chapter.bookmark) ChapterTable.COL_READ to chapter.read,
put(ChapterTable.COL_LAST_PAGE_READ, chapter.last_page_read) ChapterTable.COL_BOOKMARK to chapter.bookmark,
} ChapterTable.COL_LAST_PAGE_READ to chapter.last_page_read
)
} }
@@ -0,0 +1,34 @@
package eu.kanade.tachiyomi.data.database.resolvers
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult
import com.pushtorefresh.storio.sqlite.queries.UpdateQuery
import eu.kanade.tachiyomi.data.database.inTransactionReturn
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.tables.ChapterTable
class ChapterKnownBackupPutResolver : PutResolver<Chapter>() {
override fun performPut(db: StorIOSQLite, chapter: Chapter) = db.inTransactionReturn {
val updateQuery = mapToUpdateQuery(chapter)
val contentValues = mapToContentValues(chapter)
val numberOfRowsUpdated = db.lowLevel().update(updateQuery, contentValues)
PutResult.newUpdateResult(numberOfRowsUpdated, updateQuery.table())
}
fun mapToUpdateQuery(chapter: Chapter) = UpdateQuery.builder()
.table(ChapterTable.TABLE)
.where("${ChapterTable.COL_ID} = ?")
.whereArgs(chapter.id)
.build()
fun mapToContentValues(chapter: Chapter) =
contentValuesOf(
ChapterTable.COL_READ to chapter.read,
ChapterTable.COL_BOOKMARK to chapter.bookmark,
ChapterTable.COL_LAST_PAGE_READ to chapter.last_page_read
)
}
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,9 +25,10 @@ class ChapterProgressPutResolver : PutResolver<Chapter>() {
.whereArgs(chapter.id) .whereArgs(chapter.id)
.build() .build()
fun mapToContentValues(chapter: Chapter) = ContentValues(3).apply { fun mapToContentValues(chapter: Chapter) =
put(ChapterTable.COL_READ, chapter.read) contentValuesOf(
put(ChapterTable.COL_BOOKMARK, chapter.bookmark) ChapterTable.COL_READ to chapter.read,
put(ChapterTable.COL_LAST_PAGE_READ, chapter.last_page_read) ChapterTable.COL_BOOKMARK to chapter.bookmark,
} ChapterTable.COL_LAST_PAGE_READ to chapter.last_page_read
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,7 +25,8 @@ class ChapterSourceOrderPutResolver : PutResolver<Chapter>() {
.whereArgs(chapter.url, chapter.manga_id) .whereArgs(chapter.url, chapter.manga_id)
.build() .build()
fun mapToContentValues(chapter: Chapter) = ContentValues(1).apply { fun mapToContentValues(chapter: Chapter) =
put(ChapterTable.COL_SOURCE_ORDER, chapter.source_order) contentValuesOf(
} ChapterTable.COL_SOURCE_ORDER to chapter.source_order
)
} }
@@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues
import androidx.annotation.NonNull import androidx.annotation.NonNull
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
import com.pushtorefresh.storio.sqlite.queries.Query import com.pushtorefresh.storio.sqlite.queries.Query
@@ -57,7 +57,8 @@ class HistoryLastReadPutResolver : HistoryPutResolver() {
* Create content query * Create content query
* @param history object * @param history object
*/ */
fun mapToUpdateContentValues(history: History) = ContentValues(1).apply { fun mapToUpdateContentValues(history: History) =
put(HistoryTable.COL_LAST_READ, history.last_read) contentValuesOf(
} HistoryTable.COL_LAST_READ to history.last_read
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,7 +25,8 @@ class MangaCoverLastModifiedPutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) =
put(MangaTable.COL_COVER_LAST_MODIFIED, manga.cover_last_modified) contentValuesOf(
} MangaTable.COL_COVER_LAST_MODIFIED to manga.cover_last_modified
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,8 +25,9 @@ class MangaFavoritePutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(2).apply { fun mapToContentValues(manga: Manga) =
put(MangaTable.COL_FAVORITE, manga.favorite) contentValuesOf(
put(MangaTable.COL_DATE_ADDED, manga.date_added) MangaTable.COL_FAVORITE to manga.favorite,
} MangaTable.COL_DATE_ADDED to manga.date_added
)
} }
@@ -0,0 +1,32 @@
package eu.kanade.tachiyomi.data.database.resolvers
import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult
import com.pushtorefresh.storio.sqlite.queries.UpdateQuery
import eu.kanade.tachiyomi.data.database.inTransactionReturn
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.tables.MangaTable
// [EXH]
class MangaFilteredScanlatorsPutResolver : PutResolver<Manga>() {
override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn {
val updateQuery = mapToUpdateQuery(manga)
val contentValues = mapToContentValues(manga)
val numberOfRowsUpdated = db.lowLevel().update(updateQuery, contentValues)
PutResult.newUpdateResult(numberOfRowsUpdated, updateQuery.table())
}
fun mapToUpdateQuery(manga: Manga) = UpdateQuery.builder()
.table(MangaTable.TABLE)
.where("${MangaTable.COL_FILTERED_SCANLATORS} = ?")
.whereArgs(manga.filtered_scanlators)
.build()
fun mapToContentValues(manga: Manga) = contentValuesOf(
MangaTable.COL_FILTERED_SCANLATORS to manga.filtered_scanlators
)
}
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -8,8 +8,9 @@ import com.pushtorefresh.storio.sqlite.queries.UpdateQuery
import eu.kanade.tachiyomi.data.database.inTransactionReturn import eu.kanade.tachiyomi.data.database.inTransactionReturn
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.tables.MangaTable import eu.kanade.tachiyomi.data.database.tables.MangaTable
import kotlin.reflect.KProperty1
class MangaFlagsPutResolver(private val updateAll: Boolean = false) : PutResolver<Manga>() { class MangaFlagsPutResolver(private val colName: String, private val fieldGetter: KProperty1<Manga, Int>, private val updateAll: Boolean = false) : PutResolver<Manga>() {
override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn { override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn {
val updateQuery = mapToUpdateQuery(manga) val updateQuery = mapToUpdateQuery(manga)
@@ -35,7 +36,8 @@ class MangaFlagsPutResolver(private val updateAll: Boolean = false) : PutResolve
} }
} }
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) =
put(MangaTable.COL_CHAPTER_FLAGS, manga.chapter_flags) contentValuesOf(
} colName to fieldGetter.get(manga)
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -8,6 +8,7 @@ import com.pushtorefresh.storio.sqlite.queries.UpdateQuery
import eu.kanade.tachiyomi.data.database.inTransactionReturn import eu.kanade.tachiyomi.data.database.inTransactionReturn
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.tables.MangaTable import eu.kanade.tachiyomi.data.database.tables.MangaTable
import exh.util.nullIfZero
class MangaInfoPutResolver(val reset: Boolean = false) : PutResolver<Manga>() { class MangaInfoPutResolver(val reset: Boolean = false) : PutResolver<Manga>() {
@@ -25,20 +26,25 @@ class MangaInfoPutResolver(val reset: Boolean = false) : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) = contentValuesOf(
put(MangaTable.COL_TITLE, manga.originalTitle) MangaTable.COL_TITLE to manga.originalTitle,
put(MangaTable.COL_GENRE, manga.originalGenre) MangaTable.COL_GENRE to manga.originalGenre,
put(MangaTable.COL_AUTHOR, manga.originalAuthor) MangaTable.COL_AUTHOR to manga.originalAuthor,
put(MangaTable.COL_ARTIST, manga.originalArtist) MangaTable.COL_ARTIST to manga.originalArtist,
put(MangaTable.COL_DESCRIPTION, manga.originalDescription) MangaTable.COL_DESCRIPTION to manga.originalDescription,
} MangaTable.COL_STATUS to manga.originalStatus
)
fun resetToContentValues(manga: Manga) = ContentValues(1).apply { private fun resetToContentValues(manga: Manga) = contentValuesOf(
val splitter = "▒ ▒∩▒" MangaTable.COL_TITLE to manga.title.split(splitter).last(),
put(MangaTable.COL_TITLE, manga.title.split(splitter).last()) MangaTable.COL_GENRE to manga.genre?.split(splitter)?.lastOrNull(),
put(MangaTable.COL_GENRE, manga.genre?.split(splitter)?.lastOrNull()) MangaTable.COL_AUTHOR to manga.author?.split(splitter)?.lastOrNull(),
put(MangaTable.COL_AUTHOR, manga.author?.split(splitter)?.lastOrNull()) MangaTable.COL_ARTIST to manga.artist?.split(splitter)?.lastOrNull(),
put(MangaTable.COL_ARTIST, manga.artist?.split(splitter)?.lastOrNull()) MangaTable.COL_DESCRIPTION to manga.description?.split(splitter)?.lastOrNull(),
put(MangaTable.COL_DESCRIPTION, manga.description?.split(splitter)?.lastOrNull()) MangaTable.COL_STATUS to manga.status.nullIfZero()?.toString()?.split(splitter)?.lastOrNull()
)
companion object {
const val splitter = "▒ ▒∩▒"
} }
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,7 +25,8 @@ class MangaLastUpdatedPutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) =
put(MangaTable.COL_LAST_UPDATE, manga.last_update) contentValuesOf(
} MangaTable.COL_LAST_UPDATE to manga.last_update
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,11 +25,11 @@ class MangaMigrationPutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(5).apply { fun mapToContentValues(manga: Manga) = contentValuesOf(
put(MangaTable.COL_FAVORITE, manga.favorite) MangaTable.COL_FAVORITE to manga.favorite,
put(MangaTable.COL_DATE_ADDED, manga.date_added) MangaTable.COL_DATE_ADDED to manga.date_added,
put(MangaTable.COL_TITLE, manga.title) MangaTable.COL_TITLE to manga.title,
put(MangaTable.COL_CHAPTER_FLAGS, manga.chapter_flags) MangaTable.COL_CHAPTER_FLAGS to manga.chapter_flags,
put(MangaTable.COL_VIEWER, manga.viewer) MangaTable.COL_VIEWER to manga.viewer_flags
} )
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -9,7 +9,8 @@ import eu.kanade.tachiyomi.data.database.inTransactionReturn
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.tables.MangaTable import eu.kanade.tachiyomi.data.database.tables.MangaTable
class MangaViewerPutResolver : PutResolver<Manga>() { // SY
class MangaThumbnailPutResolver : PutResolver<Manga>() {
override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn { override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn {
val updateQuery = mapToUpdateQuery(manga) val updateQuery = mapToUpdateQuery(manga)
@@ -25,7 +26,7 @@ class MangaViewerPutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) = contentValuesOf(
put(MangaTable.COL_VIEWER, manga.viewer) MangaTable.COL_THUMBNAIL_URL to manga.thumbnail_url
} )
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -25,7 +25,8 @@ class MangaTitlePutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) =
put(MangaTable.COL_TITLE, manga.title) contentValuesOf(
} MangaTable.COL_TITLE to manga.title
)
} }
@@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.data.database.resolvers package eu.kanade.tachiyomi.data.database.resolvers
import android.content.ContentValues import androidx.core.content.contentValuesOf
import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.StorIOSQLite
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.operations.put.PutResult
@@ -26,7 +26,7 @@ class MangaUrlPutResolver : PutResolver<Manga>() {
.whereArgs(manga.id) .whereArgs(manga.id)
.build() .build()
fun mapToContentValues(manga: Manga) = ContentValues(1).apply { fun mapToContentValues(manga: Manga) = contentValuesOf(
put(MangaTable.COL_URL, manga.url) MangaTable.COL_URL to manga.url
} )
} }
@@ -40,6 +40,8 @@ object MangaTable {
// SY ->> // SY ->>
const val COL_READ = "read" const val COL_READ = "read"
const val COL_FILTERED_SCANLATORS = "filtered_scanlators"
// SY <-- // SY <--
const val COL_CATEGORY = "category" const val COL_CATEGORY = "category"
@@ -65,7 +67,8 @@ object MangaTable {
$COL_VIEWER INTEGER NOT NULL, $COL_VIEWER INTEGER NOT NULL,
$COL_CHAPTER_FLAGS INTEGER NOT NULL, $COL_CHAPTER_FLAGS INTEGER NOT NULL,
$COL_COVER_LAST_MODIFIED LONG NOT NULL, $COL_COVER_LAST_MODIFIED LONG NOT NULL,
$COL_DATE_ADDED LONG NOT NULL $COL_DATE_ADDED LONG NOT NULL,
$COL_FILTERED_SCANLATORS TEXT
)""" )"""
val createUrlIndexQuery: String val createUrlIndexQuery: String
@@ -90,4 +93,7 @@ object MangaTable {
"FROM $TABLE INNER JOIN ${ChapterTable.TABLE} " + "FROM $TABLE INNER JOIN ${ChapterTable.TABLE} " +
"ON $TABLE.$COL_ID = ${ChapterTable.TABLE}.${ChapterTable.COL_MANGA_ID} " + "ON $TABLE.$COL_ID = ${ChapterTable.TABLE}.${ChapterTable.COL_MANGA_ID} " +
"GROUP BY $TABLE.$COL_ID)" "GROUP BY $TABLE.$COL_ID)"
val addFilteredScanlators: String
get() = "ALTER TABLE $TABLE ADD COLUMN $COL_FILTERED_SCANLATORS TEXT"
} }
@@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.util.lang.launchIO
import rx.Observable import rx.Observable
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@@ -23,7 +24,7 @@ import uy.kohesive.injekt.injectLazy
* *
* @param context the application context. * @param context the application context.
*/ */
class DownloadManager(/* SY private */ val context: Context) { class DownloadManager(private val context: Context) {
private val sourceManager: SourceManager by injectLazy() private val sourceManager: SourceManager by injectLazy()
private val preferences: PreferencesHelper by injectLazy() private val preferences: PreferencesHelper by injectLazy()
@@ -202,6 +203,15 @@ class DownloadManager(/* SY private */ val context: Context) {
deleteChapters(listOf(download.chapter), download.manga, download.source) deleteChapters(listOf(download.chapter), download.manga, download.source)
} }
fun deletePendingDownloads(vararg downloads: Download) {
val downloadsByManga = downloads.groupBy { it.manga.id }
downloadsByManga.map { entry ->
val manga = entry.value.first().manga
val source = entry.value.first().source
deleteChapters(entry.value.map { it.chapter }, manga, source)
}
}
/** /**
* Deletes the directories of a list of downloaded chapters. * Deletes the directories of a list of downloaded chapters.
* *
@@ -211,17 +221,35 @@ class DownloadManager(/* SY private */ val context: Context) {
*/ */
fun deleteChapters(chapters: List<Chapter>, manga: Manga, source: Source): List<Chapter> { fun deleteChapters(chapters: List<Chapter>, manga: Manga, source: Source): List<Chapter> {
val filteredChapters = getChaptersToDelete(chapters) val filteredChapters = getChaptersToDelete(chapters)
launchIO {
removeFromDownloadQueue(filteredChapters)
queue.remove(filteredChapters) val chapterDirs = provider.findChapterDirs(filteredChapters, manga, source)
chapterDirs.forEach { it.delete() }
cache.removeChapters(filteredChapters, manga)
if (cache.getDownloadCount(manga) == 0) { // Delete manga directory if empty
chapterDirs.firstOrNull()?.parentFile?.delete()
}
}
return filteredChapters
}
val chapterDirs = provider.findChapterDirs(filteredChapters, manga, source) private fun removeFromDownloadQueue(chapters: List<Chapter>) {
chapterDirs.forEach { it.delete() } val wasRunning = downloader.isRunning
cache.removeChapters(filteredChapters, manga) if (wasRunning) {
if (cache.getDownloadCount(manga) == 0) { // Delete manga directory if empty downloader.pause()
chapterDirs.firstOrNull()?.parentFile?.delete()
} }
return filteredChapters downloader.queue.remove(chapters)
if (wasRunning) {
if (downloader.queue.isEmpty()) {
DownloadService.stop(context)
downloader.stop()
} else if (downloader.queue.isNotEmpty()) {
downloader.start()
}
}
} }
// SY --> // SY -->
@@ -244,7 +272,7 @@ class DownloadManager(/* SY private */ val context: Context) {
if (removeNonFavorite && !manga.favorite) { if (removeNonFavorite && !manga.favorite) {
val mangaFolder = provider.getMangaDir(manga, source) val mangaFolder = provider.getMangaDir(manga, source)
cleaned += 1 + (mangaFolder.listFiles()?.size ?: 0) cleaned += 1 + mangaFolder.listFiles().orEmpty().size
mangaFolder.delete() mangaFolder.delete()
cache.removeManga(manga) cache.removeManga(manga)
return cleaned return cleaned
@@ -265,8 +293,7 @@ class DownloadManager(/* SY private */ val context: Context) {
if (cache.getDownloadCount(manga) == 0) { if (cache.getDownloadCount(manga) == 0) {
val mangaFolder = provider.getMangaDir(manga, source) val mangaFolder = provider.getMangaDir(manga, source)
val size = mangaFolder.listFiles()?.size ?: 0 if (!mangaFolder.listFiles().isNullOrEmpty()) {
if (size == 0) {
mangaFolder.delete() mangaFolder.delete()
cache.removeManga(manga) cache.removeManga(manga)
} else { } else {
@@ -284,9 +311,11 @@ class DownloadManager(/* SY private */ val context: Context) {
* @param source the source of the manga. * @param source the source of the manga.
*/ */
fun deleteManga(manga: Manga, source: Source) { fun deleteManga(manga: Manga, source: Source) {
queue.remove(manga) launchIO {
provider.findMangaDir(manga, source)?.delete() downloader.queue.remove(manga)
cache.removeManga(manga) provider.findMangaDir(manga, source)?.delete()
cache.removeManga(manga)
}
} }
/** /**
@@ -27,6 +27,8 @@ internal class DownloadNotifier(private val context: Context) {
private val progressNotificationBuilder by lazy { private val progressNotificationBuilder by lazy {
context.notificationBuilder(Notifications.CHANNEL_DOWNLOADER_PROGRESS) { context.notificationBuilder(Notifications.CHANNEL_DOWNLOADER_PROGRESS) {
setLargeIcon(BitmapFactory.decodeResource(context.resources, R.mipmap.ic_launcher)) setLargeIcon(BitmapFactory.decodeResource(context.resources, R.mipmap.ic_launcher))
setAutoCancel(false)
setOnlyAlertOnce(true)
} }
} }
@@ -66,15 +68,6 @@ internal class DownloadNotifier(private val context: Context) {
context.notificationManager.notify(id, build()) context.notificationManager.notify(id, build())
} }
/**
* Clear old actions if they exist.
*/
private fun NotificationCompat.Builder.clearActions() {
if (mActions.isNotEmpty()) {
mActions.clear()
}
}
/** /**
* Dismiss the downloader's notification. Downloader error notifications use a different id, so * Dismiss the downloader's notification. Downloader error notifications use a different id, so
* those can only be dismissed by the user. * those can only be dismissed by the user.
@@ -90,10 +83,8 @@ internal class DownloadNotifier(private val context: Context) {
*/ */
fun onProgressChange(download: Download) { fun onProgressChange(download: Download) {
with(progressNotificationBuilder) { with(progressNotificationBuilder) {
// Check if first call.
if (!isDownloading) { if (!isDownloading) {
setSmallIcon(android.R.drawable.stat_sys_download) setSmallIcon(android.R.drawable.stat_sys_download)
setAutoCancel(false)
clearActions() clearActions()
// Open download manager when clicked // Open download manager when clicked
setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context)) setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))
@@ -123,6 +114,7 @@ internal class DownloadNotifier(private val context: Context) {
} }
setProgress(download.pages!!.size, download.downloadedImages, false) setProgress(download.pages!!.size, download.downloadedImages, false)
setOngoing(true)
show(Notifications.ID_DOWNLOAD_CHAPTER_PROGRESS) show(Notifications.ID_DOWNLOAD_CHAPTER_PROGRESS)
} }
@@ -136,8 +128,8 @@ internal class DownloadNotifier(private val context: Context) {
setContentTitle(context.getString(R.string.chapter_paused)) setContentTitle(context.getString(R.string.chapter_paused))
setContentText(context.getString(R.string.download_notifier_download_paused)) setContentText(context.getString(R.string.download_notifier_download_paused))
setSmallIcon(R.drawable.ic_pause_24dp) setSmallIcon(R.drawable.ic_pause_24dp)
setAutoCancel(false)
setProgress(0, 0, false) setProgress(0, 0, false)
setOngoing(false)
clearActions() clearActions()
// Open download manager when clicked // Open download manager when clicked
setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context)) setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))
@@ -165,6 +157,8 @@ internal class DownloadNotifier(private val context: Context) {
* This function shows a notification to inform download tasks are done. * This function shows a notification to inform download tasks are done.
*/ */
fun onComplete() { fun onComplete() {
dismissProgress()
if (!errorThrown) { if (!errorThrown) {
// Create notification // Create notification
with(completeNotificationBuilder) { with(completeNotificationBuilder) {
@@ -224,7 +218,6 @@ internal class DownloadNotifier(private val context: Context) {
setContentText(error ?: context.getString(R.string.download_notifier_unknown_error)) setContentText(error ?: context.getString(R.string.download_notifier_unknown_error))
setSmallIcon(android.R.drawable.stat_sys_warning) setSmallIcon(android.R.drawable.stat_sys_warning)
clearActions() clearActions()
setAutoCancel(false)
setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context)) setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))
setProgress(0, 0, false) setProgress(0, 0, false)
@@ -137,7 +137,7 @@ class DownloadPendingDeleter(context: Context) {
val id: Long, val id: Long,
val url: String, val url: String,
val name: String, val name: String,
val scanlator: String? val scanlator: String? = null
) )
/** /**
@@ -9,11 +9,10 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.MainScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onEach
import timber.log.Timber
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
/** /**
@@ -26,7 +25,7 @@ class DownloadProvider(private val context: Context) {
private val preferences: PreferencesHelper by injectLazy() private val preferences: PreferencesHelper by injectLazy()
private val scope = CoroutineScope(Job() + Dispatchers.Main) private val scope = MainScope()
/** /**
* The root directory for downloads. * The root directory for downloads.
@@ -54,7 +53,8 @@ class DownloadProvider(private val context: Context) {
return downloadsDir return downloadsDir
.createDirectory(getSourceDirName(source)) .createDirectory(getSourceDirName(source))
.createDirectory(getMangaDirName(manga)) .createDirectory(getMangaDirName(manga))
} catch (e: NullPointerException) { } catch (e: Throwable) {
Timber.e(e, "Invalid download directory")
throw Exception(context.getString(R.string.invalid_download_dir)) throw Exception(context.getString(R.string.invalid_download_dir))
} }
} }
@@ -65,7 +65,7 @@ class DownloadProvider(private val context: Context) {
* @param source the source to query. * @param source the source to query.
*/ */
fun findSourceDir(source: Source): UniFile? { fun findSourceDir(source: Source): UniFile? {
return downloadsDir.findFile(getSourceDirName(source)) return downloadsDir.findFile(getSourceDirName(source), true)
} }
/** /**
@@ -76,7 +76,7 @@ class DownloadProvider(private val context: Context) {
*/ */
fun findMangaDir(manga: Manga, source: Source): UniFile? { fun findMangaDir(manga: Manga, source: Source): UniFile? {
val sourceDir = findSourceDir(source) val sourceDir = findSourceDir(source)
return sourceDir?.findFile(getMangaDirName(manga)) return sourceDir?.findFile(getMangaDirName(manga), true)
} }
/** /**
@@ -89,7 +89,7 @@ class DownloadProvider(private val context: Context) {
fun findChapterDir(chapter: Chapter, manga: Manga, source: Source): UniFile? { fun findChapterDir(chapter: Chapter, manga: Manga, source: Source): UniFile? {
val mangaDir = findMangaDir(manga, source) val mangaDir = findMangaDir(manga, source)
return getValidChapterDirNames(chapter).asSequence() return getValidChapterDirNames(chapter).asSequence()
.mapNotNull { mangaDir?.findFile(it) ?: mangaDir?.findFile("$it.cbz") } .mapNotNull { mangaDir?.findFile(it, true) ?: mangaDir?.findFile("$it.cbz", true) }
.firstOrNull() .firstOrNull()
} }
@@ -123,14 +123,12 @@ class DownloadProvider(private val context: Context) {
source: Source source: Source
): List<UniFile> { ): List<UniFile> {
val mangaDir = findMangaDir(manga, source) ?: return emptyList() val mangaDir = findMangaDir(manga, source) ?: return emptyList()
return mangaDir.listFiles()!!.asList().filter { return mangaDir.listFiles().orEmpty().asList().filter {
( chapters.find { chp ->
chapters.find { chp -> getValidChapterDirNames(chp).any { dir ->
getValidChapterDirNames(chp).any { dir -> mangaDir.findFile(dir) ?: mangaDir.findFile("$dir.cbz") != null
mangaDir.findFile(dir) ?: mangaDir.findFile("$dir.cbz") != null }
} } == null || it.name?.endsWith(Downloader.TMP_DIR_SUFFIX) == true
} == null
) || it.name?.endsWith(Downloader.TMP_DIR_SUFFIX) == true
} }
} }
// SY <-- // SY <--
@@ -141,7 +139,7 @@ class DownloadProvider(private val context: Context) {
* @param source the source to query. * @param source the source to query.
*/ */
fun getSourceDirName(source: Source): String { fun getSourceDirName(source: Source): String {
return source.toString() return DiskUtil.buildValidFilename(source.toString())
} }
/** /**
@@ -178,6 +176,7 @@ class DownloadProvider(private val context: Context) {
return listOf( return listOf(
getChapterDirName(chapter), getChapterDirName(chapter),
// TODO: remove this
// Legacy chapter directory name used in v0.9.2 and before // Legacy chapter directory name used in v0.9.2 and before
DiskUtil.buildValidFilename(chapter.name) DiskUtil.buildValidFilename(chapter.name)
) )
@@ -17,13 +17,12 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList
import eu.kanade.tachiyomi.util.lang.RetryWithDelay import eu.kanade.tachiyomi.util.lang.RetryWithDelay
import eu.kanade.tachiyomi.util.lang.launchIO
import eu.kanade.tachiyomi.util.lang.launchNow import eu.kanade.tachiyomi.util.lang.launchNow
import eu.kanade.tachiyomi.util.lang.launchUI
import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.util.lang.plusAssign
import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil
import eu.kanade.tachiyomi.util.storage.saveTo import eu.kanade.tachiyomi.util.storage.saveTo
import eu.kanade.tachiyomi.util.system.ImageUtil import eu.kanade.tachiyomi.util.system.ImageUtil
import exh.isEhBasedSource
import kotlinx.coroutines.async import kotlinx.coroutines.async
import okhttp3.Response import okhttp3.Response
import rx.Observable import rx.Observable
@@ -31,7 +30,6 @@ import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers import rx.schedulers.Schedulers
import rx.subscriptions.CompositeSubscription import rx.subscriptions.CompositeSubscription
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.io.BufferedOutputStream import java.io.BufferedOutputStream
import java.io.File import java.io.File
@@ -123,8 +121,8 @@ class Downloader(
initializeSubscriptions() initializeSubscriptions()
} }
val pending = queue.filter { it.status != Download.DOWNLOADED } val pending = queue.filter { it.status != Download.State.DOWNLOADED }
pending.forEach { if (it.status != Download.QUEUE) it.status = Download.QUEUE } pending.forEach { if (it.status != Download.State.QUEUE) it.status = Download.State.QUEUE }
notifier.paused = false notifier.paused = false
@@ -138,20 +136,21 @@ class Downloader(
fun stop(reason: String? = null) { fun stop(reason: String? = null) {
destroySubscriptions() destroySubscriptions()
queue queue
.filter { it.status == Download.DOWNLOADING } .filter { it.status == Download.State.DOWNLOADING }
.forEach { it.status = Download.ERROR } .forEach { it.status = Download.State.ERROR }
if (reason != null) { if (reason != null) {
notifier.onWarning(reason) notifier.onWarning(reason)
} else { return
if (notifier.paused) {
notifier.paused = false
notifier.onPaused()
} else {
notifier.dismissProgress()
notifier.onComplete()
}
} }
if (notifier.paused && !queue.isEmpty()) {
notifier.onPaused()
} else {
notifier.onComplete()
}
notifier.paused = false
} }
/** /**
@@ -160,8 +159,8 @@ class Downloader(
fun pause() { fun pause() {
destroySubscriptions() destroySubscriptions()
queue queue
.filter { it.status == Download.DOWNLOADING } .filter { it.status == Download.State.DOWNLOADING }
.forEach { it.status = Download.QUEUE } .forEach { it.status = Download.State.QUEUE }
notifier.paused = true notifier.paused = true
} }
@@ -176,8 +175,8 @@ class Downloader(
// Needed to update the chapter view // Needed to update the chapter view
if (isNotification) { if (isNotification) {
queue queue
.filter { it.status == Download.QUEUE } .filter { it.status == Download.State.QUEUE }
.forEach { it.status = Download.NOT_DOWNLOADED } .forEach { it.status = Download.State.NOT_DOWNLOADED }
} }
queue.clear() queue.clear()
notifier.dismissProgress() notifier.dismissProgress()
@@ -236,8 +235,8 @@ class Downloader(
* @param chapters the list of chapters to download. * @param chapters the list of chapters to download.
* @param autoStart whether to start the downloader after enqueing the chapters. * @param autoStart whether to start the downloader after enqueing the chapters.
*/ */
fun queueChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean) = launchUI { fun queueChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean) = launchIO {
val source = sourceManager.get(manga.source) as? HttpSource ?: return@launchUI val source = sourceManager.get(manga.source) as? HttpSource ?: return@launchIO
val wasEmpty = queue.isEmpty() val wasEmpty = queue.isEmpty()
// Called in background thread, the operation can be slow with SAF. // Called in background thread, the operation can be slow with SAF.
val chaptersWithoutDir = async { val chaptersWithoutDir = async {
@@ -280,7 +279,7 @@ class Downloader(
val availSpace = DiskUtil.getAvailableStorageSpace(mangaDir) val availSpace = DiskUtil.getAvailableStorageSpace(mangaDir)
if (availSpace != -1L && availSpace < MIN_DISK_SPACE) { if (availSpace != -1L && availSpace < MIN_DISK_SPACE) {
download.status = Download.ERROR download.status = Download.State.ERROR
notifier.onError(context.getString(R.string.download_insufficient_space), download.chapter.name) notifier.onError(context.getString(R.string.download_insufficient_space), download.chapter.name)
return@defer Observable.just(download) return@defer Observable.just(download)
} }
@@ -310,7 +309,7 @@ class Downloader(
?.forEach { it.delete() } ?.forEach { it.delete() }
download.downloadedImages = 0 download.downloadedImages = 0
download.status = Download.DOWNLOADING download.status = Download.State.DOWNLOADING
} }
// Get all the URLs to the source images, fetch pages if necessary // Get all the URLs to the source images, fetch pages if necessary
.flatMap { download.source.fetchAllImageUrlsFromPageList(it) } .flatMap { download.source.fetchAllImageUrlsFromPageList(it) }
@@ -326,7 +325,7 @@ class Downloader(
.doOnNext { ensureSuccessfulDownload(download, mangaDir, tmpDir, chapterDirname) } .doOnNext { ensureSuccessfulDownload(download, mangaDir, tmpDir, chapterDirname) }
// If the page list threw, it will resume here // If the page list threw, it will resume here
.onErrorReturn { error -> .onErrorReturn { error ->
download.status = Download.ERROR download.status = Download.State.ERROR
notifier.onError(error.message, download.chapter.name) notifier.onError(error.message, download.chapter.name)
download download
} }
@@ -390,19 +389,7 @@ class Downloader(
private fun downloadImage(page: Page, source: HttpSource, tmpDir: UniFile, filename: String): Observable<UniFile> { private fun downloadImage(page: Page, source: HttpSource, tmpDir: UniFile, filename: String): Observable<UniFile> {
page.status = Page.DOWNLOAD_IMAGE page.status = Page.DOWNLOAD_IMAGE
page.progress = 0 page.progress = 0
return /* SY --> If the source is E-Hentai request a new page if null */ Observable.just(Unit) return source.fetchImage(page)
.flatMap {
if (page.imageUrl == null && source.isEhBasedSource()) {
source.fetchImageUrl(page)
} else Observable.just(null)
}
.doOnNext { imageUrl ->
if (imageUrl != null) page.imageUrl = imageUrl
}
.flatMap {
source.fetchImage(page)
}
// SY <--
.map { response -> .map { response ->
val file = tmpDir.createFile("$filename.tmp") val file = tmpDir.createFile("$filename.tmp")
try { try {
@@ -412,9 +399,6 @@ class Downloader(
} catch (e: Exception) { } catch (e: Exception) {
response.close() response.close()
file.delete() file.delete()
// SY --> E-Hentai sometimes has dead pages, so we request a new one if it fails
if (source.isEhBasedSource()) page.imageUrl = null
// SY <--
throw e throw e
} }
file file
@@ -481,13 +465,13 @@ class Downloader(
val downloadedImages = tmpDir.listFiles().orEmpty().filterNot { it.name!!.endsWith(".tmp") } val downloadedImages = tmpDir.listFiles().orEmpty().filterNot { it.name!!.endsWith(".tmp") }
download.status = if (downloadedImages.size == download.pages!!.size) { download.status = if (downloadedImages.size == download.pages!!.size) {
Download.DOWNLOADED Download.State.DOWNLOADED
} else { } else {
Download.ERROR Download.State.ERROR
} }
// Only rename the directory if it's downloaded. // Only rename the directory if it's downloaded.
if (download.status == Download.DOWNLOADED) { if (download.status == Download.State.DOWNLOADED) {
if (preferences.saveChaptersAsCBZ().get()) { if (preferences.saveChaptersAsCBZ().get()) {
val zip = mangaDir.createFile("$dirname.cbz.tmp") val zip = mangaDir.createFile("$dirname.cbz.tmp")
val zipOut = ZipOutputStream(BufferedOutputStream(zip.openOutputStream())) val zipOut = ZipOutputStream(BufferedOutputStream(zip.openOutputStream()))
@@ -532,7 +516,7 @@ class Downloader(
*/ */
private fun completeDownload(download: Download) { private fun completeDownload(download: Download) {
// Delete successful downloads from queue // Delete successful downloads from queue
if (download.status == Download.DOWNLOADED) { if (download.status == Download.State.DOWNLOADED) {
// remove downloaded chapter from queue // remove downloaded chapter from queue
queue.remove(download) queue.remove(download)
} }
@@ -545,7 +529,7 @@ class Downloader(
* Returns true if all the queued downloads are in DOWNLOADED or ERROR state. * Returns true if all the queued downloads are in DOWNLOADED or ERROR state.
*/ */
private fun areAllDownloadsFinished(): Boolean { private fun areAllDownloadsFinished(): Boolean {
return queue.none { it.status <= Download.DOWNLOADING } return queue.none { it.status.value <= Download.State.DOWNLOADING.value }
} }
companion object { companion object {
@@ -20,7 +20,7 @@ class Download(val source: HttpSource, val manga: Manga, val chapter: Chapter) {
@Volatile @Volatile
@Transient @Transient
var status: Int = 0 var status: State = State.NOT_DOWNLOADED
set(status) { set(status) {
field = status field = status
statusSubject?.onNext(this) statusSubject?.onNext(this)
@@ -47,11 +47,11 @@ class Download(val source: HttpSource, val manga: Manga, val chapter: Chapter) {
statusCallback = f statusCallback = f
} }
companion object { enum class State(val value: Int) {
const val NOT_DOWNLOADED = 0 NOT_DOWNLOADED(0),
const val QUEUE = 1 QUEUE(1),
const val DOWNLOADING = 2 DOWNLOADING(2),
const val DOWNLOADED = 3 DOWNLOADED(3),
const val ERROR = 4 ERROR(4),
} }
} }
@@ -22,7 +22,7 @@ class DownloadQueue(
downloads.forEach { download -> downloads.forEach { download ->
download.setStatusSubject(statusSubject) download.setStatusSubject(statusSubject)
download.setStatusCallback(::setPagesFor) download.setStatusCallback(::setPagesFor)
download.status = Download.QUEUE download.status = Download.State.QUEUE
} }
queue.addAll(downloads) queue.addAll(downloads)
store.addAll(downloads) store.addAll(downloads)
@@ -34,8 +34,8 @@ class DownloadQueue(
store.remove(download) store.remove(download)
download.setStatusSubject(null) download.setStatusSubject(null)
download.setStatusCallback(null) download.setStatusCallback(null)
if (download.status == Download.DOWNLOADING || download.status == Download.QUEUE) { if (download.status == Download.State.DOWNLOADING || download.status == Download.State.QUEUE) {
download.status = Download.NOT_DOWNLOADED download.status = Download.State.NOT_DOWNLOADED
} }
if (removed) { if (removed) {
updatedRelay.call(Unit) updatedRelay.call(Unit)
@@ -60,8 +60,8 @@ class DownloadQueue(
queue.forEach { download -> queue.forEach { download ->
download.setStatusSubject(null) download.setStatusSubject(null)
download.setStatusCallback(null) download.setStatusCallback(null)
if (download.status == Download.DOWNLOADING || download.status == Download.QUEUE) { if (download.status == Download.State.DOWNLOADING || download.status == Download.State.QUEUE) {
download.status = Download.NOT_DOWNLOADED download.status = Download.State.NOT_DOWNLOADED
} }
} }
queue.clear() queue.clear()
@@ -70,7 +70,7 @@ class DownloadQueue(
} }
fun getActiveDownloads(): Observable<Download> = fun getActiveDownloads(): Observable<Download> =
Observable.from(this).filter { download -> download.status == Download.DOWNLOADING } Observable.from(this).filter { download -> download.status == Download.State.DOWNLOADING }
fun getStatusObservable(): Observable<Download> = statusSubject.onBackpressureBuffer() fun getStatusObservable(): Observable<Download> = statusSubject.onBackpressureBuffer()
@@ -79,7 +79,7 @@ class DownloadQueue(
.map { this } .map { this }
private fun setPagesFor(download: Download) { private fun setPagesFor(download: Download) {
if (download.status == Download.DOWNLOADED || download.status == Download.ERROR) { if (download.status == Download.State.DOWNLOADED || download.status == Download.State.ERROR) {
setPagesSubject(download.pages, null) setPagesSubject(download.pages, null)
} }
} }
@@ -88,19 +88,19 @@ class DownloadQueue(
return statusSubject.onBackpressureBuffer() return statusSubject.onBackpressureBuffer()
.startWith(getActiveDownloads()) .startWith(getActiveDownloads())
.flatMap { download -> .flatMap { download ->
if (download.status == Download.DOWNLOADING) { if (download.status == Download.State.DOWNLOADING) {
val pageStatusSubject = PublishSubject.create<Int>() val pageStatusSubject = PublishSubject.create<Int>()
setPagesSubject(download.pages, pageStatusSubject) setPagesSubject(download.pages, pageStatusSubject)
return@flatMap pageStatusSubject return@flatMap pageStatusSubject
.onBackpressureBuffer() .onBackpressureBuffer()
.filter { it == Page.READY } .filter { it == Page.READY }
.map { download } .map { download }
} else if (download.status == Download.DOWNLOADED || download.status == Download.ERROR) { } else if (download.status == Download.State.DOWNLOADED || download.status == Download.State.ERROR) {
setPagesSubject(download.pages, null) setPagesSubject(download.pages, null)
} }
Observable.just(download) Observable.just(download)
} }
.filter { it.status == Download.DOWNLOADING } .filter { it.status == Download.State.DOWNLOADING }
} }
private fun setPagesSubject(pages: List<Page>?, subject: PublishSubject<Int>?) { private fun setPagesSubject(pages: List<Page>?, subject: PublishSubject<Int>?) {
@@ -1,60 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import android.content.ContentValues.TAG
import android.util.Log
import com.bumptech.glide.Priority
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.data.DataFetcher
import timber.log.Timber
import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.io.IOException
import java.io.InputStream
open class FileFetcher(private val filePath: String = "") : DataFetcher<InputStream> {
private var data: InputStream? = null
override fun loadData(priority: Priority, callback: DataFetcher.DataCallback<in InputStream>) {
loadFromFile(callback)
}
private fun loadFromFile(callback: DataFetcher.DataCallback<in InputStream>) {
loadFromFile(File(filePath), callback)
}
protected fun loadFromFile(file: File, callback: DataFetcher.DataCallback<in InputStream>) {
try {
data = FileInputStream(file)
} catch (e: FileNotFoundException) {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Timber.d(e, "Failed to open file")
}
callback.onLoadFailed(e)
return
}
callback.onDataReady(data)
}
override fun cleanup() {
try {
data?.close()
} catch (e: IOException) {
// Ignored.
}
}
override fun cancel() {
// Do nothing.
}
override fun getDataClass(): Class<InputStream> {
return InputStream::class.java
}
override fun getDataSource(): DataSource {
return DataSource.LOCAL
}
}
@@ -1,25 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import com.bumptech.glide.Priority
import com.bumptech.glide.load.data.DataFetcher
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.models.Manga
import java.io.File
import java.io.InputStream
import java.lang.Exception
open class LibraryMangaCustomCoverFetcher(
private val manga: Manga,
private val coverCache: CoverCache
) : FileFetcher() {
override fun loadData(priority: Priority, callback: DataFetcher.DataCallback<in InputStream>) {
getCustomCoverFile()?.let {
loadFromFile(it, callback)
} ?: callback.onLoadFailed(Exception("Custom cover file not found"))
}
protected fun getCustomCoverFile(): File? {
return coverCache.getCustomCoverFile(manga).takeIf { it.exists() }
}
}
@@ -1,86 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import com.bumptech.glide.Priority
import com.bumptech.glide.load.data.DataFetcher
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.models.Manga
import java.io.File
import java.io.FileNotFoundException
import java.io.InputStream
/**
* A [DataFetcher] for loading a cover of a library manga.
* It tries to load the cover from our custom cache, and if it's not found, it fallbacks to network
* and copies the result to the cache.
*
* @param networkFetcher the network fetcher for this cover.
* @param manga the manga of the cover to load.
* @param file the file where this cover should be. It may exists or not.
*/
class LibraryMangaUrlFetcher(
private val networkFetcher: DataFetcher<InputStream>,
private val manga: Manga,
private val coverCache: CoverCache
) : LibraryMangaCustomCoverFetcher(manga, coverCache) {
override fun loadData(priority: Priority, callback: DataFetcher.DataCallback<in InputStream>) {
getCustomCoverFile()?.let {
loadFromFile(it, callback)
return
}
val cover = coverCache.getCoverFile(manga)
if (cover == null) {
callback.onLoadFailed(Exception("Null thumbnail url"))
return
}
if (!cover.exists()) {
networkFetcher.loadData(
priority,
object : DataFetcher.DataCallback<InputStream> {
override fun onDataReady(data: InputStream?) {
if (data != null) {
val tmpFile = File(cover.path + ".tmp")
try {
// Retrieve destination stream, create parent folders if needed.
val output = try {
tmpFile.outputStream()
} catch (e: FileNotFoundException) {
tmpFile.parentFile!!.mkdirs()
tmpFile.outputStream()
}
// Copy the file and rename to the original.
data.use { output.use { data.copyTo(output) } }
tmpFile.renameTo(cover)
loadFromFile(cover, callback)
} catch (e: Exception) {
tmpFile.delete()
callback.onLoadFailed(e)
}
} else {
callback.onLoadFailed(Exception("Null data"))
}
}
override fun onLoadFailed(e: Exception) {
callback.onLoadFailed(e)
}
}
)
} else {
loadFromFile(cover, callback)
}
}
override fun cleanup() {
super.cleanup()
networkFetcher.cleanup()
}
override fun cancel() {
super.cancel()
networkFetcher.cancel()
}
}
@@ -1,15 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import com.bumptech.glide.load.Key
import eu.kanade.tachiyomi.data.database.models.Manga
import java.security.MessageDigest
data class MangaThumbnail(val manga: Manga, val coverLastModified: Long) : Key {
val key = manga.url + coverLastModified
override fun updateDiskCacheKey(messageDigest: MessageDigest) {
messageDigest.update(key.toByteArray(Key.CHARSET))
}
}
fun Manga.toMangaThumbnail() = MangaThumbnail(this, cover_last_modified)
@@ -1,134 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import com.bumptech.glide.integration.okhttp3.OkHttpStreamFetcher
import com.bumptech.glide.load.Options
import com.bumptech.glide.load.model.GlideUrl
import com.bumptech.glide.load.model.Headers
import com.bumptech.glide.load.model.LazyHeaders
import com.bumptech.glide.load.model.ModelLoader
import com.bumptech.glide.load.model.ModelLoaderFactory
import com.bumptech.glide.load.model.MultiModelLoaderFactory
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy
import java.io.InputStream
/**
* A class for loading a cover associated with a [Manga] that can be present in our own cache.
* Coupled with [LibraryMangaUrlFetcher], this class allows to implement the following flow:
*
* - Check in RAM LRU.
* - Check in disk LRU.
* - Check in this module.
* - Fetch from the network connection.
*
* @param context the application context.
*/
class MangaThumbnailModelLoader : ModelLoader<MangaThumbnail, InputStream> {
/**
* Cover cache where persistent covers are stored.
*/
private val coverCache: CoverCache by injectLazy()
/**
* Source manager.
*/
private val sourceManager: SourceManager by injectLazy()
/**
* Default network client.
*/
private val defaultClient = Injekt.get<NetworkHelper>().client
/**
* Map where request headers are stored for a source.
*/
private val cachedHeaders = hashMapOf<Long, LazyHeaders>()
/**
* Factory class for creating [MangaThumbnailModelLoader] instances.
*/
class Factory : ModelLoaderFactory<MangaThumbnail, InputStream> {
override fun build(multiFactory: MultiModelLoaderFactory): ModelLoader<MangaThumbnail, InputStream> {
return MangaThumbnailModelLoader()
}
override fun teardown() {}
}
override fun handles(model: MangaThumbnail): Boolean {
return true
}
/**
* Returns a fetcher for the given manga or null if the url is empty.
*
* @param mangaThumbnail the model.
* @param width the width of the view where the resource will be loaded.
* @param height the height of the view where the resource will be loaded.
*/
override fun buildLoadData(
mangaThumbnail: MangaThumbnail,
width: Int,
height: Int,
options: Options
): ModelLoader.LoadData<InputStream>? {
val manga = mangaThumbnail.manga
val url = manga.thumbnail_url
if (url.isNullOrEmpty()) {
return if (!manga.favorite || manga.isLocal()) {
null
} else {
ModelLoader.LoadData(mangaThumbnail, LibraryMangaCustomCoverFetcher(manga, coverCache))
}
}
if (url.startsWith("http", true)) {
val source = sourceManager.get(manga.source) as? HttpSource
val glideUrl = GlideUrl(url, getHeaders(manga, source))
// Get the resource fetcher for this request url.
val networkFetcher = OkHttpStreamFetcher(source?.client ?: defaultClient, glideUrl)
if (!manga.favorite) {
return ModelLoader.LoadData(glideUrl, networkFetcher)
}
val libraryFetcher = LibraryMangaUrlFetcher(networkFetcher, manga, coverCache)
// Return an instance of the fetcher providing the needed elements.
return ModelLoader.LoadData(mangaThumbnail, libraryFetcher)
} else {
// Return an instance of the fetcher providing the needed elements.
return ModelLoader.LoadData(mangaThumbnail, FileFetcher(url.removePrefix("file://")))
}
}
/**
* Returns the request headers for a source copying its OkHttp headers and caching them.
*
* @param manga the model.
*/
private fun getHeaders(manga: Manga, source: HttpSource?): Headers {
if (source == null) return LazyHeaders.DEFAULT
return cachedHeaders.getOrPut(manga.source) {
LazyHeaders.Builder().apply {
val nullStr: String? = null
setHeader("User-Agent", nullStr)
for ((key, value) in source.headers.toMultimap()) {
addHeader(key, value[0])
}
}.build()
}
}
}
@@ -1,72 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import com.bumptech.glide.Priority
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.Options
import com.bumptech.glide.load.data.DataFetcher
import com.bumptech.glide.load.model.ModelLoader
import com.bumptech.glide.load.model.ModelLoaderFactory
import com.bumptech.glide.load.model.MultiModelLoaderFactory
import com.bumptech.glide.signature.ObjectKey
import java.io.IOException
import java.io.InputStream
class PassthroughModelLoader : ModelLoader<InputStream, InputStream> {
override fun buildLoadData(
model: InputStream,
width: Int,
height: Int,
options: Options
): ModelLoader.LoadData<InputStream>? {
return ModelLoader.LoadData(ObjectKey(model), Fetcher(model))
}
override fun handles(model: InputStream): Boolean {
return true
}
class Fetcher(private val stream: InputStream) : DataFetcher<InputStream> {
override fun getDataClass(): Class<InputStream> {
return InputStream::class.java
}
override fun cleanup() {
try {
stream.close()
} catch (e: IOException) {
// Do nothing
}
}
override fun getDataSource(): DataSource {
return DataSource.LOCAL
}
override fun cancel() {
// Do nothing
}
override fun loadData(
priority: Priority,
callback: DataFetcher.DataCallback<in InputStream>
) {
callback.onDataReady(stream)
}
}
/**
* Factory class for creating [PassthroughModelLoader] instances.
*/
class Factory : ModelLoaderFactory<InputStream, InputStream> {
override fun build(
multiFactory: MultiModelLoaderFactory
): ModelLoader<InputStream, InputStream> {
return PassthroughModelLoader()
}
override fun teardown() {}
}
}
@@ -1,55 +0,0 @@
package eu.kanade.tachiyomi.data.glide
import android.content.Context
import android.graphics.drawable.Drawable
import com.bumptech.glide.Glide
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.Registry
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory
import com.bumptech.glide.load.model.GlideUrl
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.request.RequestOptions
import eu.kanade.tachiyomi.network.NetworkHelper
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.InputStream
/**
* Class used to update Glide module settings
*/
@GlideModule
class TachiGlideModule : AppGlideModule() {
override fun applyOptions(context: Context, builder: GlideBuilder) {
builder.setDiskCache(InternalCacheDiskCacheFactory(context, 50 * 1024 * 1024))
builder.setDefaultRequestOptions(RequestOptions().format(DecodeFormat.PREFER_RGB_565))
builder.setDefaultTransitionOptions(
Drawable::class.java,
DrawableTransitionOptions.withCrossFade()
)
}
override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
val networkFactory = OkHttpUrlLoader.Factory(Injekt.get<NetworkHelper>().client)
registry.replace(
GlideUrl::class.java,
InputStream::class.java,
networkFactory
)
registry.append(
MangaThumbnail::class.java,
InputStream::class.java,
MangaThumbnailModelLoader.Factory()
)
registry.append(
InputStream::class.java,
InputStream::class.java,
PassthroughModelLoader.Factory()
)
}
}
@@ -8,58 +8,38 @@ import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import java.io.File import java.io.File
import java.util.Scanner
class CustomMangaManager(val context: Context) { class CustomMangaManager(val context: Context) {
private val editJson = File(context.getExternalFilesDir(null), "edits.json") private val editJson = File(context.getExternalFilesDir(null), "edits.json")
private var customMangaMap = mutableMapOf<Long, Manga>() private val customMangaMap = fetchCustomData()
init {
fetchCustomData()
}
fun getManga(manga: Manga): Manga? = customMangaMap[manga.id] fun getManga(manga: Manga): Manga? = customMangaMap[manga.id]
private fun fetchCustomData() { private fun fetchCustomData(): MutableMap<Long, Manga> {
if (!editJson.exists() || !editJson.isFile) return if (!editJson.exists() || !editJson.isFile) return mutableMapOf()
val json = try { val json = try {
Json.decodeFromString<MangaList>( Json.decodeFromString<MangaList>(
Scanner(editJson).useDelimiter("\\Z").next() editJson.bufferedReader().use { it.readText() }
) )
} catch (e: Exception) { } catch (e: Exception) {
null null
} ?: return } ?: return mutableMapOf()
val mangasJson = json.mangas ?: return val mangasJson = json.mangas ?: return mutableMapOf()
customMangaMap = mangasJson.mapNotNull { mangaJson -> return mangasJson.mapNotNull { mangaJson ->
val id = mangaJson.id ?: return@mapNotNull null val id = mangaJson.id ?: return@mapNotNull null
val manga = MangaImpl().apply { id to mangaJson.toManga()
this.id = id
title = mangaJson.title ?: ""
author = mangaJson.author
artist = mangaJson.artist
description = mangaJson.description
genre = mangaJson.genre?.joinToString(", ")
}
id to manga
}.toMap().toMutableMap() }.toMap().toMutableMap()
} }
fun saveMangaInfo(manga: MangaJson) { fun saveMangaInfo(manga: MangaJson) {
if (manga.title == null && manga.author == null && manga.artist == null && manga.description == null && manga.genre == null) { if (manga.title == null && manga.author == null && manga.artist == null && manga.description == null && manga.genre == null && manga.status == null) {
customMangaMap.remove(manga.id!!) customMangaMap.remove(manga.id!!)
} else { } else {
customMangaMap[manga.id!!] = MangaImpl().apply { customMangaMap[manga.id!!] = manga.toManga()
id = manga.id
title = manga.title ?: ""
author = manga.author
artist = manga.artist
description = manga.description
genre = manga.genre?.joinToString(", ")
}
} }
saveCustomInfo() saveCustomInfo()
} }
@@ -79,7 +59,8 @@ class CustomMangaManager(val context: Context) {
author, author,
artist, artist,
description, description,
genre?.split(", ") genre?.split(", "),
status
) )
} }
@@ -90,24 +71,23 @@ class CustomMangaManager(val context: Context) {
@Serializable @Serializable
data class MangaJson( data class MangaJson(
val id: Long? = null, var id: Long? = null,
val title: String? = null, val title: String? = null,
val author: String? = null, val author: String? = null,
val artist: String? = null, val artist: String? = null,
val description: String? = null, val description: String? = null,
val genre: List<String>? = null val genre: List<String>? = null,
val status: Int? = null
) { ) {
override fun equals(other: Any?): Boolean { fun toManga() = MangaImpl().apply {
if (this === other) return true id = this@MangaJson.id
if (javaClass != other?.javaClass) return false title = this@MangaJson.title ?: ""
other as MangaJson author = this@MangaJson.author
if (id != other.id) return false artist = this@MangaJson.artist
return true description = this@MangaJson.description
} genre = this@MangaJson.genre?.joinToString(", ")
status = this@MangaJson.status ?: 0
override fun hashCode(): Int {
return id.hashCode()
} }
} }
} }
@@ -8,7 +8,9 @@ import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager import androidx.work.WorkManager
import androidx.work.Worker import androidx.work.Worker
import androidx.work.WorkerParameters import androidx.work.WorkerParameters
import eu.kanade.tachiyomi.data.preference.CHARGING
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.UNMETERED_NETWORK
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@@ -31,9 +33,9 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
val preferences = Injekt.get<PreferencesHelper>() val preferences = Injekt.get<PreferencesHelper>()
val interval = prefInterval ?: preferences.libraryUpdateInterval().get() val interval = prefInterval ?: preferences.libraryUpdateInterval().get()
if (interval > 0) { if (interval > 0) {
val restrictions = preferences.libraryUpdateRestriction()!! val restrictions = preferences.libraryUpdateRestriction().get()
val acRestriction = "ac" in restrictions val acRestriction = CHARGING in restrictions
val wifiRestriction = if ("wifi" in restrictions) { val wifiRestriction = if (UNMETERED_NETWORK in restrictions) {
NetworkType.UNMETERED NetworkType.UNMETERED
} else { } else {
NetworkType.CONNECTED NetworkType.CONNECTED
@@ -6,20 +6,23 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import android.net.Uri import android.net.Uri
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import com.bumptech.glide.Glide import coil.imageLoader
import coil.request.ImageRequest
import coil.transform.CircleCropTransformation
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.glide.toMangaThumbnail
import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.NotificationReceiver
import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.util.lang.chop import eu.kanade.tachiyomi.util.lang.chop
import eu.kanade.tachiyomi.util.lang.launchUI
import eu.kanade.tachiyomi.util.system.notification import eu.kanade.tachiyomi.util.system.notification
import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notificationBuilder
import eu.kanade.tachiyomi.util.system.notificationManager import eu.kanade.tachiyomi.util.system.notificationManager
@@ -76,7 +79,8 @@ class LibraryUpdateNotifier(private val context: Context) {
context.notificationManager.notify( context.notificationManager.notify(
Notifications.ID_LIBRARY_PROGRESS, Notifications.ID_LIBRARY_PROGRESS,
progressNotificationBuilder progressNotificationBuilder
.setContentTitle(title) .setContentTitle(title.chop(40))
.setContentText("($current/$total)")
.setProgress(total, current, false) .setProgress(total, current, false)
.build() .build()
) )
@@ -110,8 +114,8 @@ class LibraryUpdateNotifier(private val context: Context) {
setContentIntent(errorLogIntent) setContentIntent(errorLogIntent)
addAction( addAction(
R.drawable.nnf_ic_file_folder, R.drawable.ic_folder_24dp,
context.getString(R.string.action_open_log), context.getString(R.string.action_show_errors),
errorLogIntent errorLogIntent
) )
} }
@@ -166,14 +170,17 @@ class LibraryUpdateNotifier(private val context: Context) {
// Per-manga notification // Per-manga notification
if (!preferences.hideNotificationContent()) { if (!preferences.hideNotificationContent()) {
updates.forEach { (manga, chapters) -> launchUI {
notify(manga.id.hashCode(), createNewChaptersNotification(manga, chapters)) updates.forEach { (manga, chapters) ->
notify(manga.id.hashCode(), createNewChaptersNotification(manga, chapters))
}
} }
} }
} }
} }
private fun createNewChaptersNotification(manga: Manga, chapters: Array<Chapter>): Notification { private suspend fun createNewChaptersNotification(manga: Manga, chapters: Array<Chapter>): Notification {
val icon = getMangaIcon(manga)
return context.notification(Notifications.CHANNEL_NEW_CHAPTERS) { return context.notification(Notifications.CHANNEL_NEW_CHAPTERS) {
setContentTitle(manga.title) setContentTitle(manga.title)
@@ -183,7 +190,6 @@ class LibraryUpdateNotifier(private val context: Context) {
setSmallIcon(R.drawable.ic_tachi) setSmallIcon(R.drawable.ic_tachi)
val icon = getMangaIcon(manga)
if (icon != null) { if (icon != null) {
setLargeIcon(icon) setLargeIcon(icon)
} }
@@ -227,23 +233,14 @@ class LibraryUpdateNotifier(private val context: Context) {
context.notificationManager.cancel(Notifications.ID_LIBRARY_PROGRESS) context.notificationManager.cancel(Notifications.ID_LIBRARY_PROGRESS)
} }
private fun getMangaIcon(manga: Manga): Bitmap? { private suspend fun getMangaIcon(manga: Manga): Bitmap? {
return try { val request = ImageRequest.Builder(context)
Glide.with(context) .data(manga)
.asBitmap() .transformations(CircleCropTransformation())
.load(manga.toMangaThumbnail()) .size(NOTIF_ICON_SIZE)
.dontTransform() .build()
.centerCrop() val drawable = context.imageLoader.execute(request).drawable
.circleCrop() return (drawable as? BitmapDrawable)?.bitmap
.override(
NOTIF_ICON_SIZE,
NOTIF_ICON_SIZE
)
.submit()
.get()
} catch (e: Exception) {
null
}
} }
private fun getNewChaptersDescription(chapters: Array<Chapter>): String { private fun getNewChaptersDescription(chapters: Array<Chapter>): String {
@@ -6,7 +6,6 @@ import android.content.Intent
import android.os.IBinder import android.os.IBinder
import android.os.PowerManager import android.os.PowerManager
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.elvishew.xlog.XLog
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.DatabaseHelper
@@ -14,6 +13,7 @@ import eu.kanade.tachiyomi.data.database.models.Category
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.LibraryManga import eu.kanade.tachiyomi.data.database.models.LibraryManga
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.database.models.toMangaInfo
import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.download.DownloadManager
import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.data.download.DownloadService
import eu.kanade.tachiyomi.data.library.LibraryUpdateRanker.rankingScheme import eu.kanade.tachiyomi.data.library.LibraryUpdateRanker.rankingScheme
@@ -22,37 +22,52 @@ import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferenceValues import eu.kanade.tachiyomi.data.preference.PreferenceValues
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.UnattendedTrackService
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.all.MangaDex import eu.kanade.tachiyomi.source.model.toSChapter
import eu.kanade.tachiyomi.source.model.toSManga
import eu.kanade.tachiyomi.source.online.all.MergedSource import eu.kanade.tachiyomi.source.online.all.MergedSource
import eu.kanade.tachiyomi.ui.library.LibraryGroup import eu.kanade.tachiyomi.ui.library.LibraryGroup
import eu.kanade.tachiyomi.ui.manga.track.TrackItem import eu.kanade.tachiyomi.ui.manga.track.TrackItem
import eu.kanade.tachiyomi.util.chapter.NoChaptersException import eu.kanade.tachiyomi.util.chapter.NoChaptersException
import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource
import eu.kanade.tachiyomi.util.lang.asObservable import eu.kanade.tachiyomi.util.chapter.syncChaptersWithTrackServiceTwoWay
import eu.kanade.tachiyomi.util.lang.awaitSingle import eu.kanade.tachiyomi.util.lang.withIOContext
import eu.kanade.tachiyomi.util.prepUpdateCover import eu.kanade.tachiyomi.util.prepUpdateCover
import eu.kanade.tachiyomi.util.shouldDownloadNewChapters import eu.kanade.tachiyomi.util.shouldDownloadNewChapters
import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.storage.getUriCompat
import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.acquireWakeLock
import eu.kanade.tachiyomi.util.system.createFileInCacheDir
import eu.kanade.tachiyomi.util.system.isServiceRunning import eu.kanade.tachiyomi.util.system.isServiceRunning
import exh.LIBRARY_UPDATE_EXCLUDED_SOURCES
import exh.MERGED_SOURCE_ID
import exh.md.utils.FollowStatus import exh.md.utils.FollowStatus
import exh.md.utils.MdUtil import exh.md.utils.MdUtil
import exh.metadata.metadata.base.insertFlatMetadata import exh.metadata.metadata.base.insertFlatMetadataAsync
import exh.source.LIBRARY_UPDATE_EXCLUDED_SOURCES
import exh.source.MERGED_SOURCE_ID
import exh.source.getMainSource import exh.source.getMainSource
import exh.source.isMdBasedSource
import exh.source.mangaDexSourceIds
import exh.util.executeOnIO
import exh.util.nullIfBlank import exh.util.nullIfBlank
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.CoroutineExceptionHandler
import rx.Observable import kotlinx.coroutines.CoroutineScope
import rx.Subscription import kotlinx.coroutines.Dispatchers
import rx.schedulers.Schedulers import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.supervisorScope
import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.sync.withPermit
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.io.File import java.io.File
import java.util.Date
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
/** /**
@@ -72,17 +87,12 @@ class LibraryUpdateService(
val coverCache: CoverCache = Injekt.get() val coverCache: CoverCache = Injekt.get()
) : Service() { ) : Service() {
/**
* Wake lock that will be held until the service is destroyed.
*/
private lateinit var wakeLock: PowerManager.WakeLock private lateinit var wakeLock: PowerManager.WakeLock
private lateinit var notifier: LibraryUpdateNotifier private lateinit var notifier: LibraryUpdateNotifier
private lateinit var ioScope: CoroutineScope
/** private var mangaToUpdate: List<LibraryManga> = mutableListOf()
* Subscription where the update is done. private var updateJob: Job? = null
*/
private var subscription: Subscription? = null
/** /**
* Defines what should be updated within a service execution. * Defines what should be updated within a service execution.
@@ -103,6 +113,8 @@ class LibraryUpdateService(
companion object { companion object {
private var instance: LibraryUpdateService? = null
/** /**
* Key for category to update. * Key for category to update.
*/ */
@@ -141,7 +153,7 @@ class LibraryUpdateService(
* @return true if service newly started, false otherwise * @return true if service newly started, false otherwise
*/ */
fun start(context: Context, category: Category? = null, target: Target = Target.CHAPTERS /* SY --> */, group: Int = LibraryGroup.BY_DEFAULT, groupExtra: String? = null /* SY <-- */): Boolean { fun start(context: Context, category: Category? = null, target: Target = Target.CHAPTERS /* SY --> */, group: Int = LibraryGroup.BY_DEFAULT, groupExtra: String? = null /* SY <-- */): Boolean {
if (!isRunning(context)) { return if (!isRunning(context)) {
val intent = Intent(context, LibraryUpdateService::class.java).apply { val intent = Intent(context, LibraryUpdateService::class.java).apply {
putExtra(KEY_TARGET, target) putExtra(KEY_TARGET, target)
category?.let { putExtra(KEY_CATEGORY, it.id) } category?.let { putExtra(KEY_CATEGORY, it.id) }
@@ -152,10 +164,11 @@ class LibraryUpdateService(
} }
ContextCompat.startForegroundService(context, intent) ContextCompat.startForegroundService(context, intent)
return true true
} else {
instance?.addMangaToQueue(category?.id ?: -1, group, groupExtra, target)
false
} }
return false
} }
/** /**
@@ -175,6 +188,7 @@ class LibraryUpdateService(
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
ioScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
notifier = LibraryUpdateNotifier(this) notifier = LibraryUpdateNotifier(this)
wakeLock = acquireWakeLock(javaClass.name) wakeLock = acquireWakeLock(javaClass.name)
@@ -186,10 +200,14 @@ class LibraryUpdateService(
* lock. * lock.
*/ */
override fun onDestroy() { override fun onDestroy() {
subscription?.unsubscribe() updateJob?.cancel()
ioScope?.cancel()
if (wakeLock.isHeld) { if (wakeLock.isHeld) {
wakeLock.release() wakeLock.release()
} }
if (instance == this) {
instance = null
}
super.onDestroy() super.onDestroy()
} }
@@ -213,77 +231,76 @@ class LibraryUpdateService(
val target = intent.getSerializableExtra(KEY_TARGET) as? Target val target = intent.getSerializableExtra(KEY_TARGET) as? Target
?: return START_NOT_STICKY ?: return START_NOT_STICKY
// Unsubscribe from any previous subscription if needed. instance = this
subscription?.unsubscribe()
// Update favorite manga. Destroy service when completed or in case of an error. // Unsubscribe from any previous subscription if needed
subscription = Observable updateJob?.cancel()
.defer {
val selectedScheme = preferences.libraryUpdatePrioritization().get()
val mangaList = getMangaToUpdate(intent, target)
.sortedWith(rankingScheme[selectedScheme])
// Update either chapter list or manga details. // Update favorite manga
when (target) { val categoryId = intent.getIntExtra(KEY_CATEGORY, -1)
Target.CHAPTERS -> updateChapterList(mangaList) val group = intent.getIntExtra(KEY_GROUP, LibraryGroup.BY_DEFAULT)
Target.COVERS -> updateCovers(mangaList) val groupExtra = intent.getStringExtra(KEY_GROUP_EXTRA)
Target.TRACKING -> updateTrackings(mangaList) addMangaToQueue(categoryId, group, groupExtra, target)
// SY -->
Target.SYNC_FOLLOWS -> syncFollows() // Destroy service when completed or in case of an error.
Target.PUSH_FAVORITES -> pushFavorites() val handler = CoroutineExceptionHandler { _, exception ->
// SY <-- Timber.e(exception)
} stopSelf(startId)
}
updateJob = ioScope.launch(handler) {
when (target) {
Target.CHAPTERS -> updateChapterList()
Target.COVERS -> updateCovers()
Target.TRACKING -> updateTrackings()
// SY -->
Target.SYNC_FOLLOWS -> syncFollows()
Target.PUSH_FAVORITES -> pushFavorites()
// SY <--
} }
.subscribeOn(Schedulers.io()) }
.subscribe( updateJob?.invokeOnCompletion { stopSelf(startId) }
{
},
{
Timber.e(it)
stopSelf(startId)
},
{
stopSelf(startId)
}
)
return START_REDELIVER_INTENT return START_REDELIVER_INTENT
} }
/** /**
* Returns the list of manga to be updated. * Adds list of manga to be updated.
* *
* @param intent the update intent. * @param category the ID of the category to update, or -1 if no category specified.
* @param target the target to update. * @param target the target to update.
* @return a list of manga to update
*/ */
fun getMangaToUpdate(intent: Intent, target: Target): List<LibraryManga> { fun addMangaToQueue(categoryId: Int, group: Int, groupExtra: String?, target: Target) {
val categoryId = intent.getIntExtra(KEY_CATEGORY, -1) val libraryManga = db.getLibraryMangas().executeAsBlocking()
// SY --> // SY -->
val group = intent.getIntExtra(KEY_GROUP, LibraryGroup.BY_DEFAULT)
val groupLibraryUpdateType = preferences.groupLibraryUpdateType().get() val groupLibraryUpdateType = preferences.groupLibraryUpdateType().get()
// SY <-- // SY <--
var listToUpdate = if (categoryId != -1) { var listToUpdate = if (categoryId != -1) {
db.getLibraryMangas().executeAsBlocking().filter { it.category == categoryId } libraryManga.filter { it.category == categoryId }
// SY --> // SY -->
} else if (group == LibraryGroup.BY_DEFAULT || groupLibraryUpdateType == PreferenceValues.GroupLibraryMode.GLOBAL || (groupLibraryUpdateType == PreferenceValues.GroupLibraryMode.ALL_BUT_UNGROUPED && group == LibraryGroup.UNGROUPED)) { } else if (group == LibraryGroup.BY_DEFAULT || groupLibraryUpdateType == PreferenceValues.GroupLibraryMode.GLOBAL || (groupLibraryUpdateType == PreferenceValues.GroupLibraryMode.ALL_BUT_UNGROUPED && group == LibraryGroup.UNGROUPED)) {
val categoriesToUpdate = preferences.libraryUpdateCategories().get().map(String::toInt) val categoriesToUpdate = preferences.libraryUpdateCategories().get().map(String::toInt)
if (categoriesToUpdate.isNotEmpty()) { val listToInclude = if (categoriesToUpdate.isNotEmpty()) {
db.getLibraryMangas().executeAsBlocking() libraryManga.filter { it.category in categoriesToUpdate }
.filter { it.category in categoriesToUpdate }
.distinctBy { it.id }
} else { } else {
db.getLibraryMangas().executeAsBlocking().distinctBy { it.id } libraryManga
} }
val categoriesToExclude = preferences.libraryUpdateCategoriesExclude().get().map(String::toInt)
val listToExclude = if (categoriesToExclude.isNotEmpty()) {
libraryManga.filter { it.category in categoriesToExclude }
} else {
emptyList()
}
listToInclude.minus(listToExclude)
} else { } else {
val libraryManga = db.getLibraryMangas().executeAsBlocking().distinctBy { it.id }
when (group) { when (group) {
LibraryGroup.BY_TRACK_STATUS -> { LibraryGroup.BY_TRACK_STATUS -> {
val trackingExtra = intent.getStringExtra(KEY_GROUP_EXTRA)?.toIntOrNull() ?: -1 val trackingExtra = groupExtra?.toIntOrNull() ?: -1
libraryManga.filter { libraryManga.filter {
val loggedServices = trackManager.services.filter { it.isLogged } val loggedServices = trackManager.services.filter { it.isLogged }
val status: String = { val status: String = run {
val tracks = db.getTracks(it).executeAsBlocking() val tracks = db.getTracks(it).executeAsBlocking()
val track = tracks.find { track -> val track = tracks.find { track ->
loggedServices.any { it.id == track?.sync_id } loggedServices.any { it.id == track?.sync_id }
@@ -294,17 +311,17 @@ class LibraryUpdateService(
} else { } else {
"not tracked" "not tracked"
} }
}() }
trackManager.mapTrackingOrder(status, applicationContext) == trackingExtra trackManager.mapTrackingOrder(status, applicationContext) == trackingExtra
} }
} }
LibraryGroup.BY_SOURCE -> { LibraryGroup.BY_SOURCE -> {
val sourceExtra = intent.getStringExtra(KEY_GROUP_EXTRA).nullIfBlank() val sourceExtra = groupExtra.nullIfBlank()
val source = sourceManager.getCatalogueSources().find { it.name == sourceExtra } val source = sourceManager.getCatalogueSources().find { it.name == sourceExtra }
if (source != null) libraryManga.filter { it.source == source.id } else emptyList() if (source != null) libraryManga.filter { it.source == source.id } else emptyList()
} }
LibraryGroup.BY_STATUS -> { LibraryGroup.BY_STATUS -> {
val statusExtra = intent.getStringExtra(KEY_GROUP_EXTRA)?.toIntOrNull() ?: -1 val statusExtra = groupExtra?.toIntOrNull() ?: -1
libraryManga.filter { libraryManga.filter {
it.status == statusExtra it.status == statusExtra
} }
@@ -315,10 +332,13 @@ class LibraryUpdateService(
// SY <-- // SY <--
} }
if (target == Target.CHAPTERS && preferences.updateOnlyNonCompleted()) { if (target == Target.CHAPTERS && preferences.updateOnlyNonCompleted()) {
listToUpdate = listToUpdate.filter { it.status != SManga.COMPLETED } listToUpdate = listToUpdate.filterNot { it.status == SManga.COMPLETED }
} }
return listToUpdate val selectedScheme = preferences.libraryUpdatePrioritization().get()
mangaToUpdate = listToUpdate
.distinctBy { it.id }
.sortedWith(rankingScheme[selectedScheme])
} }
/** /**
@@ -330,84 +350,77 @@ class LibraryUpdateService(
* @param mangaToUpdate the list to update * @param mangaToUpdate the list to update
* @return an observable delivering the progress of each update. * @return an observable delivering the progress of each update.
*/ */
fun updateChapterList(mangaToUpdate: List<LibraryManga>): Observable<LibraryManga> { suspend fun updateChapterList() {
// Initialize the variables holding the progress of the updates. val semaphore = Semaphore(5)
val count = AtomicInteger(0) val progressCount = AtomicInteger(0)
// List containing new updates
val newUpdates = mutableListOf<Pair<LibraryManga, Array<Chapter>>>() val newUpdates = mutableListOf<Pair<LibraryManga, Array<Chapter>>>()
// List containing failed updates
val failedUpdates = mutableListOf<Pair<Manga, String?>>() val failedUpdates = mutableListOf<Pair<Manga, String?>>()
// Boolean to determine if DownloadManager has downloads
var hasDownloads = false var hasDownloads = false
val loggedServices by lazy { trackManager.services.filter { it.isLogged } }
// Emit each manga and update it sequentially. withIOContext {
return Observable.from(mangaToUpdate) mangaToUpdate.groupBy { it.source }
// Notify manga that will update. .filterNot { it.key in LIBRARY_UPDATE_EXCLUDED_SOURCES }
.doOnNext { notifier.showProgressNotification(it, count.andIncrement, mangaToUpdate.size) } .values.map { mangaInSource ->
// Update the chapters of the manga async {
.concatMap { manga -> semaphore.withPermit {
// SY --> mangaInSource
if (manga.source in LIBRARY_UPDATE_EXCLUDED_SOURCES) { .onEach { manga ->
// Ignore EXH manga, updating chapters for every manga will get you banned if (updateJob?.isActive != true) {
Observable.empty() return@async
} else { }
// SY <--
updateManga(manga) notifier.showProgressNotification(manga, progressCount.andIncrement, mangaToUpdate.size)
// If there's any error, return empty update and continue.
.onErrorReturn { try {
val errorMessage = if (it is NoChaptersException) { val (newChapters, _) = updateManga(manga)
getString(R.string.no_chapters_error)
} else { if (newChapters.isNotEmpty()) {
it.message if (manga.shouldDownloadNewChapters(db, preferences)) {
} downloadChapters(manga, newChapters)
failedUpdates.add(Pair(manga, errorMessage)) hasDownloads = true
Pair(emptyList(), emptyList()) }
// Convert to the manga that contains new chapters
newUpdates.add(
manga to newChapters.sortedByDescending { ch -> ch.source_order }
.toTypedArray()
)
}
} catch (e: Throwable) {
val errorMessage = if (e is NoChaptersException) {
getString(R.string.no_chapters_error)
} else {
e.message
}
failedUpdates.add(manga to errorMessage)
}
if (preferences.autoUpdateTrackers()) {
updateTrackings(manga, loggedServices)
}
}
} }
// Filter out mangas without new chapters (or failed).
.filter { (first) -> first.isNotEmpty() }
.doOnNext {
if (manga.shouldDownloadNewChapters(db, preferences)) {
downloadChapters(manga, it.first)
hasDownloads = true
}
}
}
// Convert to the manga that contains new chapters.
.map {
Pair(
manga,
(
it.first.sortedByDescending { ch -> ch.source_order }
.toTypedArray()
)
)
} }
} }.awaitAll()
// Add manga with new chapters to the list. }
.doOnNext { manga ->
// Add to the list
newUpdates.add(manga)
}
// Notify result of the overall update.
.doOnCompleted {
notifier.cancelProgressNotification()
if (newUpdates.isNotEmpty()) { notifier.cancelProgressNotification()
notifier.showUpdateNotifications(newUpdates)
if (hasDownloads) {
DownloadService.start(this)
}
}
if (preferences.showLibraryUpdateErrors() && failedUpdates.isNotEmpty()) { if (newUpdates.isNotEmpty()) {
val errorFile = writeErrorFile(failedUpdates) notifier.showUpdateNotifications(newUpdates)
notifier.showUpdateErrorNotification( if (hasDownloads) {
failedUpdates.map { it.first.title }, DownloadService.start(this)
errorFile.getUriCompat(this)
)
}
} }
.map { (first) -> first } }
if (preferences.showLibraryUpdateErrors() && failedUpdates.isNotEmpty()) {
val errorFile = writeErrorFile(failedUpdates)
notifier.showUpdateErrorNotification(
failedUpdates.map { it.first.title },
errorFile.getUriCompat(this)
)
}
} }
private fun downloadChapters(manga: Manga, chapters: List<Chapter>) { private fun downloadChapters(manga: Manga, chapters: List<Chapter>) {
@@ -427,166 +440,192 @@ class LibraryUpdateService(
* @param manga the manga to update. * @param manga the manga to update.
* @return a pair of the inserted and removed chapters. * @return a pair of the inserted and removed chapters.
*/ */
fun updateManga(manga: Manga): Observable<Pair<List<Chapter>, List<Chapter>>> { suspend fun updateManga(manga: Manga): Pair<List<Chapter>, List<Chapter>> {
val source = sourceManager.getOrStub(manga.source).getMainSource() val source = sourceManager.getOrStub(manga.source).getMainSource()
// Update manga details metadata in the background // Update manga details metadata in the background
if (preferences.autoUpdateMetadata()) { if (preferences.autoUpdateMetadata()) {
source.fetchMangaDetails(manga) val handler = CoroutineExceptionHandler { _, exception ->
.map { updatedManga -> Timber.e(exception)
// Avoid "losing" existing cover }
if (!updatedManga.thumbnail_url.isNullOrEmpty()) { GlobalScope.launch(Dispatchers.IO + handler) {
manga.prepUpdateCover(coverCache, updatedManga, false) val updatedManga = source.getMangaDetails(manga.toMangaInfo())
} else { val sManga = updatedManga.toSManga()
updatedManga.thumbnail_url = manga.thumbnail_url // Avoid "losing" existing cover
} if (!sManga.thumbnail_url.isNullOrEmpty()) {
manga.prepUpdateCover(coverCache, sManga, false)
manga.copyFrom(updatedManga) } else {
db.insertManga(manga).executeAsBlocking() sManga.thumbnail_url = manga.thumbnail_url
manga
} }
.onErrorResumeNext { Observable.just(manga) }
.subscribeOn(Schedulers.io()) manga.copyFrom(sManga)
.subscribe() db.insertManga(manga).executeAsBlocking()
}
} }
return ( // SY -->
/* SY --> */ if (source is MergedSource) runBlocking { source.fetchChaptersAndSync(manga, false).asObservable() } val handler = CoroutineExceptionHandler { _, exception ->
else /* SY <-- */ source.fetchChapterList(manga) Timber.e(exception)
.map { syncChaptersWithSource(db, it, manga, source) } }
// SY --> ioScope.launch(handler) {
) if (source.isMdBasedSource() && trackManager.mdList.isLogged) {
.doOnNext { val tracks = db.getTracks(manga).executeOnIO()
if (source is MangaDex && trackManager.mdList.isLogged) { if (tracks.isEmpty() || tracks.none { it.sync_id == TrackManager.MDLIST }) {
try { var track = trackManager.mdList.createInitialTracker(manga)
val tracks = db.getTracks(manga).executeAsBlocking() track = trackManager.mdList.refresh(track)
if (tracks.isEmpty() || tracks.all { it.sync_id != TrackManager.MDLIST }) { db.insertTrack(track).executeOnIO()
var track = trackManager.mdList.createInitialTracker(manga)
track = runBlocking { trackManager.mdList.refresh(track).awaitSingle() }
db.insertTrack(track).executeAsBlocking()
}
} catch (e: Exception) {
XLog.tag("LibraryUpdateService").e(e)
}
} }
} }
}
if (source is MergedSource) {
return source.fetchChaptersAndSync(manga, false)
}
// SY <-- // SY <--
val chapters = source.getChapterList(manga.toMangaInfo())
.map { it.toSChapter() }
return syncChaptersWithSource(db, chapters, manga, source)
} }
private fun updateCovers(mangaToUpdate: List<LibraryManga>): Observable<LibraryManga> { private suspend fun updateCovers() {
var count = 0 var progressCount = 0
return Observable.from(mangaToUpdate) mangaToUpdate.forEach { manga ->
.doOnNext { if (updateJob?.isActive != true) {
notifier.showProgressNotification(it, count++, mangaToUpdate.size) return
} }
.flatMap { manga ->
val source = sourceManager.get(manga.source)
?: return@flatMap Observable.empty<LibraryManga>()
source.fetchMangaDetails(manga) notifier.showProgressNotification(manga, progressCount++, mangaToUpdate.size)
.map { networkManga ->
manga.prepUpdateCover(coverCache, networkManga, true) sourceManager.get(manga.source)?.let { source ->
networkManga.thumbnail_url?.let { try {
manga.thumbnail_url = it val networkManga = source.getMangaDetails(manga.toMangaInfo())
db.insertManga(manga).executeAsBlocking() val sManga = networkManga.toSManga()
} manga.prepUpdateCover(coverCache, sManga, true)
manga sManga.thumbnail_url?.let {
manga.thumbnail_url = it
db.insertManga(manga).executeAsBlocking()
} }
.onErrorReturn { manga } } catch (e: Throwable) {
} // Ignore errors and continue
.doOnCompleted { Timber.e(e)
notifier.cancelProgressNotification() }
} }
}
coverCache.clearMemoryCache()
notifier.cancelProgressNotification()
} }
/** /**
* Method that updates the metadata of the connected tracking services. It's called in a * Method that updates the metadata of the connected tracking services. It's called in a
* background thread, so it's safe to do heavy operations or network calls here. * background thread, so it's safe to do heavy operations or network calls here.
*/ */
private fun updateTrackings(mangaToUpdate: List<LibraryManga>): Observable<LibraryManga> { private suspend fun updateTrackings() {
// Initialize the variables holding the progress of the updates. var progressCount = 0
var count = 0
val loggedServices = trackManager.services.filter { it.isLogged } val loggedServices = trackManager.services.filter { it.isLogged }
// Emit each manga and update it sequentially. mangaToUpdate.forEach { manga ->
return Observable.from(mangaToUpdate) if (updateJob?.isActive != true) {
// Notify manga that will update. return
.doOnNext { notifier.showProgressNotification(it, count++, mangaToUpdate.size) } }
// Update the tracking details.
.concatMap { manga ->
val tracks = db.getTracks(manga).executeAsBlocking()
Observable.from(tracks) // Notify manga that will update.
.concatMap { track -> notifier.showProgressNotification(manga, progressCount++, mangaToUpdate.size)
// Update the tracking details.
updateTrackings(manga, loggedServices)
}
notifier.cancelProgressNotification()
}
private suspend fun updateTrackings(manga: LibraryManga, loggedServices: List<TrackService>) {
db.getTracks(manga).executeAsBlocking()
.map { track ->
supervisorScope {
async {
val service = trackManager.getService(track.sync_id) val service = trackManager.getService(track.sync_id)
if (service != null && service in loggedServices) { if (service != null && service in loggedServices) {
service.refresh(track) try {
.doOnNext { db.insertTrack(it).executeAsBlocking() } val updatedTrack = service.refresh(track)
.onErrorReturn { track } db.insertTrack(updatedTrack).executeAsBlocking()
} else {
Observable.empty() if (service is UnattendedTrackService) {
syncChaptersWithTrackServiceTwoWay(db, db.getChapters(manga).executeAsBlocking(), track, service)
}
} catch (e: Throwable) {
// Ignore errors and continue
Timber.e(e)
}
} }
} }
.map { manga } }
}
.doOnCompleted {
notifier.cancelProgressNotification()
} }
.awaitAll()
} }
// SY --> // SY -->
// filter all follows from Mangadex and only add reading or rereading manga to library /**
private fun syncFollows(): Observable<LibraryManga> { * filter all follows from Mangadex and only add reading or rereading manga to library
*/
private suspend fun syncFollows() {
val count = AtomicInteger(0) val count = AtomicInteger(0)
val mangaDex = MdUtil.getEnabledMangaDex(preferences, sourceManager) ?: return Observable.empty() val mangaDex = MdUtil.getEnabledMangaDex(preferences, sourceManager) ?: return
return mangaDex.fetchAllFollows(true) val syncFollowStatusInts = preferences.mangadexSyncToLibraryIndexes().get().map { it.toInt() }
.asObservable()
.map { listManga ->
listManga.filter { (_, metadata) ->
metadata.follow_status == FollowStatus.RE_READING.int || metadata.follow_status == FollowStatus.READING.int
}
}
.doOnNext { listManga ->
listManga.forEach { (networkManga, metadata) ->
notifier.showProgressNotification(networkManga, count.andIncrement, listManga.size)
var dbManga = db.getManga(networkManga.url, mangaDex.id)
.executeAsBlocking()
if (dbManga == null) {
dbManga = Manga.create(
networkManga.url,
networkManga.title,
mangaDex.id
)
dbManga.date_added = Date().time
}
dbManga.copyFrom(networkManga) val size: Int
dbManga.favorite = true mangaDex.fetchAllFollows()
val id = db.insertManga(dbManga).executeAsBlocking().insertedId() .filter { (_, metadata) ->
if (id != null) { syncFollowStatusInts.contains(metadata.followStatus)
metadata.mangaId = id }
db.insertFlatMetadata(metadata.flatten()).await() .also { size = it.size }
} .forEach { (networkManga, metadata) ->
if (updateJob?.isActive != true) {
return
}
notifier.showProgressNotification(networkManga, count.andIncrement, size)
var dbManga = db.getManga(networkManga.url, mangaDex.id)
.executeOnIO()
if (dbManga == null) {
dbManga = Manga.create(
networkManga.url,
networkManga.title,
mangaDex.id
)
dbManga.date_added = System.currentTimeMillis()
}
dbManga.copyFrom(networkManga)
dbManga.favorite = true
val id = db.insertManga(dbManga).executeOnIO().insertedId()
if (id != null) {
metadata.mangaId = id
db.insertFlatMetadataAsync(metadata.flatten()).await()
} }
} }
.doOnCompleted {
notifier.cancelProgressNotification() notifier.cancelProgressNotification()
}
.flatMap { Observable.empty() }
} }
/** /**
* Method that updates the all mangas which are not tracked as "reading" on mangadex * Method that updates the all mangas which are not tracked as "reading" on mangadex
*/ */
private fun pushFavorites(): Observable<LibraryManga> { private suspend fun pushFavorites() {
val count = AtomicInteger(0) val count = AtomicInteger(0)
val listManga = db.getLibraryMangas().executeAsBlocking() val listManga = db.getFavoriteMangas().executeAsBlocking().filter { it.source in mangaDexSourceIds }
// filter all follows from Mangadex and only add reading or rereading manga to library // filter all follows from Mangadex and only add reading or rereading manga to library
return Observable.from(if (trackManager.mdList.isLogged) listManga else emptyList()) if (trackManager.mdList.isLogged) {
.flatMap { manga -> listManga.forEach { manga ->
if (updateJob?.isActive != true) {
return
}
notifier.showProgressNotification(manga, count.andIncrement, listManga.size) notifier.showProgressNotification(manga, count.andIncrement, listManga.size)
// Get this manga's trackers from the database // Get this manga's trackers from the database
@@ -597,18 +636,13 @@ class LibraryUpdateService(
if (tracker.track?.status == FollowStatus.UNFOLLOWED.int) { if (tracker.track?.status == FollowStatus.UNFOLLOWED.int) {
tracker.track.status = FollowStatus.READING.int tracker.track.status = FollowStatus.READING.int
tracker.service.update(tracker.track) val updatedTrack = tracker.service.update(tracker.track)
} else Observable.just(null) db.insertTrack(updatedTrack).executeOnIO()
}
.doOnNext { returnedTracker ->
returnedTracker?.let {
db.insertTrack(returnedTracker)
} }
} }
.doOnCompleted { }
notifier.cancelProgressNotification()
} notifier.cancelProgressNotification()
.flatMap { Observable.empty() }
} }
// SY <-- // SY <--
@@ -618,15 +652,14 @@ class LibraryUpdateService(
private fun writeErrorFile(errors: List<Pair<Manga, String?>>): File { private fun writeErrorFile(errors: List<Pair<Manga, String?>>): File {
try { try {
if (errors.isNotEmpty()) { if (errors.isNotEmpty()) {
val destFile = File(externalCacheDir, "tachiyomi_update_errors.txt") val file = createFileInCacheDir("tachiyomi_update_errors.txt")
file.bufferedWriter().use { out ->
destFile.bufferedWriter().use { out ->
errors.forEach { (manga, error) -> errors.forEach { (manga, error) ->
val source = sourceManager.getOrStub(manga.source) val source = sourceManager.getOrStub(manga.source)
out.write("${manga.title} ($source): $error\n") out.write("${manga.title} ($source): $error\n")
} }
} }
return destFile return file
} }
} catch (e: Exception) { } catch (e: Exception) {
// Empty // Empty
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.notification
import android.app.PendingIntent import android.app.PendingIntent
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.ClipData
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
@@ -25,7 +26,6 @@ import eu.kanade.tachiyomi.util.storage.DiskUtil
import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.storage.getUriCompat
import eu.kanade.tachiyomi.util.system.notificationManager import eu.kanade.tachiyomi.util.system.notificationManager
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import exh.md.similar.SimilarUpdateService
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@@ -58,21 +58,22 @@ class NotificationReceiver : BroadcastReceiver() {
ACTION_SHARE_IMAGE -> ACTION_SHARE_IMAGE ->
shareImage( shareImage(
context, context,
intent.getStringExtra(EXTRA_FILE_LOCATION), intent.getStringExtra(EXTRA_FILE_LOCATION)!!,
intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1) intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1)
) )
// Delete image from path and dismiss notification // Delete image from path and dismiss notification
ACTION_DELETE_IMAGE -> ACTION_DELETE_IMAGE ->
deleteImage( deleteImage(
context, context,
intent.getStringExtra(EXTRA_FILE_LOCATION), intent.getStringExtra(EXTRA_FILE_LOCATION)!!,
intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1) intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1)
) )
// Share backup file // Share backup file
ACTION_SHARE_BACKUP -> ACTION_SHARE_BACKUP ->
shareBackup( shareFile(
context, context,
intent.getParcelableExtra(EXTRA_URI), intent.getParcelableExtra(EXTRA_URI)!!,
"application/x-protobuf+gzip",
intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1) intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1)
) )
ACTION_CANCEL_RESTORE -> cancelRestore( ACTION_CANCEL_RESTORE -> cancelRestore(
@@ -101,9 +102,14 @@ class NotificationReceiver : BroadcastReceiver() {
markAsRead(urls, mangaId) markAsRead(urls, mangaId)
} }
} }
// SY --> // Share crash dump file
ACTION_CANCEL_SIMILAR_UPDATE -> cancelSimilarUpdate(context) ACTION_SHARE_CRASH_LOG ->
// SY <-- shareFile(
context,
intent.getParcelableExtra(EXTRA_URI)!!,
"text/plain",
intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1)
)
} }
} }
@@ -124,14 +130,13 @@ class NotificationReceiver : BroadcastReceiver() {
* @param notificationId id of notification * @param notificationId id of notification
*/ */
private fun shareImage(context: Context, path: String, notificationId: Int) { private fun shareImage(context: Context, path: String, notificationId: Int) {
// Create intent
val intent = Intent(Intent.ACTION_SEND).apply { val intent = Intent(Intent.ACTION_SEND).apply {
val uri = File(path).getUriCompat(context) val uri = File(path).getUriCompat(context)
putExtra(Intent.EXTRA_STREAM, uri) putExtra(Intent.EXTRA_STREAM, uri)
clipData = ClipData.newRawUri(null, uri)
type = "image/*" type = "image/*"
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
} }
// Dismiss notification
dismissNotification(context, notificationId) dismissNotification(context, notificationId)
// Launch share activity // Launch share activity
context.startActivity(intent) context.startActivity(intent)
@@ -144,10 +149,11 @@ class NotificationReceiver : BroadcastReceiver() {
* @param path path of file * @param path path of file
* @param notificationId id of notification * @param notificationId id of notification
*/ */
private fun shareBackup(context: Context, uri: Uri, notificationId: Int) { private fun shareFile(context: Context, uri: Uri, fileMimeType: String, notificationId: Int) {
val sendIntent = Intent(Intent.ACTION_SEND).apply { val sendIntent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_STREAM, uri) putExtra(Intent.EXTRA_STREAM, uri)
type = "application/json" clipData = ClipData.newRawUri(null, uri)
type = fileMimeType
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
} }
// Dismiss notification // Dismiss notification
@@ -245,80 +251,37 @@ class NotificationReceiver : BroadcastReceiver() {
} }
} }
// SY -->
/**
* Method called when user wants to stop a similar manga update
*
* @param context context of application
*/
private fun cancelSimilarUpdate(context: Context) {
SimilarUpdateService.stop(context)
Handler().post { dismissNotification(context, Notifications.ID_SIMILAR_PROGRESS) }
}
// SY <--
companion object { companion object {
private const val NAME = "NotificationReceiver" private const val NAME = "NotificationReceiver"
// Called to launch share intent.
private const val ACTION_SHARE_IMAGE = "$ID.$NAME.SHARE_IMAGE" private const val ACTION_SHARE_IMAGE = "$ID.$NAME.SHARE_IMAGE"
// Called to delete image.
private const val ACTION_DELETE_IMAGE = "$ID.$NAME.DELETE_IMAGE" private const val ACTION_DELETE_IMAGE = "$ID.$NAME.DELETE_IMAGE"
// Called to launch send intent.
private const val ACTION_SHARE_BACKUP = "$ID.$NAME.SEND_BACKUP" private const val ACTION_SHARE_BACKUP = "$ID.$NAME.SEND_BACKUP"
// Called to cancel backup restore job. private const val ACTION_SHARE_CRASH_LOG = "$ID.$NAME.SEND_CRASH_LOG"
private const val ACTION_CANCEL_RESTORE = "$ID.$NAME.CANCEL_RESTORE" private const val ACTION_CANCEL_RESTORE = "$ID.$NAME.CANCEL_RESTORE"
// Called to cancel library update.
private const val ACTION_CANCEL_LIBRARY_UPDATE = "$ID.$NAME.CANCEL_LIBRARY_UPDATE" private const val ACTION_CANCEL_LIBRARY_UPDATE = "$ID.$NAME.CANCEL_LIBRARY_UPDATE"
// Called to mark manga chapters as read.
private const val ACTION_MARK_AS_READ = "$ID.$NAME.MARK_AS_READ" private const val ACTION_MARK_AS_READ = "$ID.$NAME.MARK_AS_READ"
// Called to open chapter.
private const val ACTION_OPEN_CHAPTER = "$ID.$NAME.ACTION_OPEN_CHAPTER" private const val ACTION_OPEN_CHAPTER = "$ID.$NAME.ACTION_OPEN_CHAPTER"
// Value containing file location.
private const val EXTRA_FILE_LOCATION = "$ID.$NAME.FILE_LOCATION"
// Called to resume downloads.
private const val ACTION_RESUME_DOWNLOADS = "$ID.$NAME.ACTION_RESUME_DOWNLOADS" private const val ACTION_RESUME_DOWNLOADS = "$ID.$NAME.ACTION_RESUME_DOWNLOADS"
// Called to pause downloads.
private const val ACTION_PAUSE_DOWNLOADS = "$ID.$NAME.ACTION_PAUSE_DOWNLOADS" private const val ACTION_PAUSE_DOWNLOADS = "$ID.$NAME.ACTION_PAUSE_DOWNLOADS"
// Called to clear downloads.
private const val ACTION_CLEAR_DOWNLOADS = "$ID.$NAME.ACTION_CLEAR_DOWNLOADS" private const val ACTION_CLEAR_DOWNLOADS = "$ID.$NAME.ACTION_CLEAR_DOWNLOADS"
// Called to dismiss notification.
private const val ACTION_DISMISS_NOTIFICATION = "$ID.$NAME.ACTION_DISMISS_NOTIFICATION" private const val ACTION_DISMISS_NOTIFICATION = "$ID.$NAME.ACTION_DISMISS_NOTIFICATION"
// Value containing uri. private const val EXTRA_FILE_LOCATION = "$ID.$NAME.FILE_LOCATION"
private const val EXTRA_URI = "$ID.$NAME.URI" private const val EXTRA_URI = "$ID.$NAME.URI"
// Value containing notification id.
private const val EXTRA_NOTIFICATION_ID = "$ID.$NAME.NOTIFICATION_ID" private const val EXTRA_NOTIFICATION_ID = "$ID.$NAME.NOTIFICATION_ID"
// Value containing group id.
private const val EXTRA_GROUP_ID = "$ID.$NAME.EXTRA_GROUP_ID" private const val EXTRA_GROUP_ID = "$ID.$NAME.EXTRA_GROUP_ID"
// Value containing manga id.
private const val EXTRA_MANGA_ID = "$ID.$NAME.EXTRA_MANGA_ID" private const val EXTRA_MANGA_ID = "$ID.$NAME.EXTRA_MANGA_ID"
// Value containing chapter id.
private const val EXTRA_CHAPTER_ID = "$ID.$NAME.EXTRA_CHAPTER_ID" private const val EXTRA_CHAPTER_ID = "$ID.$NAME.EXTRA_CHAPTER_ID"
// Value containing chapter url.
private const val EXTRA_CHAPTER_URL = "$ID.$NAME.EXTRA_CHAPTER_URL" private const val EXTRA_CHAPTER_URL = "$ID.$NAME.EXTRA_CHAPTER_URL"
// Sy -->
// Called to cancel similar manga update.
private const val ACTION_CANCEL_SIMILAR_UPDATE = "$ID.$NAME.CANCEL_SIMILAR_UPDATE"
// SY <--
/** /**
* Returns a [PendingIntent] that resumes the download of a chapter * Returns a [PendingIntent] that resumes the download of a chapter
* *
@@ -555,6 +518,23 @@ class NotificationReceiver : BroadcastReceiver() {
return PendingIntent.getActivity(context, 0, intent, 0) return PendingIntent.getActivity(context, 0, intent, 0)
} }
/**
* Returns [PendingIntent] that starts a share activity for a crash log dump file.
*
* @param context context of application
* @param uri uri of file
* @param notificationId id of notification
* @return [PendingIntent]
*/
internal fun shareCrashLogPendingBroadcast(context: Context, uri: Uri, notificationId: Int): PendingIntent {
val intent = Intent(context, NotificationReceiver::class.java).apply {
action = ACTION_SHARE_CRASH_LOG
putExtra(EXTRA_URI, uri)
putExtra(EXTRA_NOTIFICATION_ID, notificationId)
}
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
}
/** /**
* Returns [PendingIntent] that cancels a backup restore job. * Returns [PendingIntent] that cancels a backup restore job.
* *
@@ -569,20 +549,5 @@ class NotificationReceiver : BroadcastReceiver() {
} }
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT) return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
} }
// SY -->
/**
* Returns [PendingIntent] that starts a service which stops the similar update
*
* @param context context of application
* @return [PendingIntent]
*/
internal fun cancelSimilarUpdatePendingBroadcast(context: Context): PendingIntent {
val intent = Intent(context, NotificationReceiver::class.java).apply {
action = ACTION_CANCEL_SIMILAR_UPDATE
}
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
}
// SY <--
} }
} }
@@ -62,14 +62,17 @@ object Notifications {
const val ID_BACKUP_COMPLETE = -502 const val ID_BACKUP_COMPLETE = -502
const val ID_RESTORE_COMPLETE = -504 const val ID_RESTORE_COMPLETE = -504
// SY -->
/** /**
* Notification channel and ids used for backup and restore. * Notification channel used for crash log file sharing.
*/ */
const val CHANNEL_SIMILAR = "similar_channel" const val CHANNEL_CRASH_LOGS = "crash_logs_channel"
const val ID_SIMILAR_PROGRESS = -601 const val ID_CRASH_LOGS = -601
const val ID_SIMILAR_COMPLETE = -602
// SY <-- /**
* Notification channel used for Incognito Mode
*/
const val CHANNEL_INCOGNITO_MODE = "incognito_mode_channel"
const val ID_INCOGNITO_MODE = -701
private val deprecatedChannels = listOf( private val deprecatedChannels = listOf(
"downloader_channel", "downloader_channel",
@@ -154,12 +157,15 @@ object Notifications {
setSound(null, null) setSound(null, null)
}, },
NotificationChannel( NotificationChannel(
CHANNEL_SIMILAR, CHANNEL_CRASH_LOGS,
context.getString(R.string.similar), context.getString(R.string.channel_crash_logs),
NotificationManager.IMPORTANCE_HIGH
),
NotificationChannel(
CHANNEL_INCOGNITO_MODE,
context.getString(R.string.pref_incognito_mode),
NotificationManager.IMPORTANCE_LOW NotificationManager.IMPORTANCE_LOW
).apply { )
setShowBadge(false)
}
).forEach(context.notificationManager::createNotificationChannel) ).forEach(context.notificationManager::createNotificationChannel)
// Delete old notification channels // Delete old notification channels
@@ -13,16 +13,26 @@ object PreferenceKeys {
const val confirmExit = "pref_confirm_exit" const val confirmExit = "pref_confirm_exit"
const val hideBottomBar = "pref_hide_bottom_bar_on_scroll" const val hideBottomBarOnScroll = "pref_hide_bottom_bar_on_scroll"
const val rotation = "pref_rotation_type_key" const val showSideNavOnBottom = "pref_show_side_nav_on_bottom"
const val enableTransitions = "pref_enable_transitions_key" const val enableTransitionsPager = "pref_enable_transitions_pager_key"
const val enableTransitionsWebtoon = "pref_enable_transitions_webtoon_key"
const val doubleTapAnimationSpeed = "pref_double_tap_anim_speed" const val doubleTapAnimationSpeed = "pref_double_tap_anim_speed"
const val showPageNumber = "pref_show_page_number_key" const val showPageNumber = "pref_show_page_number_key"
const val dualPageSplitPaged = "pref_dual_page_split"
const val dualPageSplitWebtoon = "pref_dual_page_split_webtoon"
const val dualPageInvertPaged = "pref_dual_page_invert"
const val dualPageInvertWebtoon = "pref_dual_page_invert_webtoon"
const val showReadingMode = "pref_show_reading_mode" const val showReadingMode = "pref_show_reading_mode"
const val trueColor = "pref_true_color_key" const val trueColor = "pref_true_color_key"
@@ -43,7 +53,11 @@ object PreferenceKeys {
const val colorFilterMode = "color_filter_mode" const val colorFilterMode = "color_filter_mode"
const val defaultViewer = "pref_default_viewer_key" const val grayscale = "pref_grayscale"
const val defaultReadingMode = "pref_default_reading_mode_key"
const val defaultOrientationType = "pref_default_orientation_type_key"
const val imageScaleType = "pref_image_scale_type_key" const val imageScaleType = "pref_image_scale_type_key"
@@ -57,7 +71,9 @@ object PreferenceKeys {
const val readWithTapping = "reader_tap" const val readWithTapping = "reader_tap"
const val readWithTappingInverted = "reader_tapping_inverted" const val pagerNavInverted = "reader_tapping_inverted"
const val webtoonNavInverted = "reader_tapping_inverted_webtoon"
const val readWithLongTap = "reader_long_tap" const val readWithLongTap = "reader_long_tap"
@@ -65,6 +81,14 @@ object PreferenceKeys {
const val readWithVolumeKeysInverted = "reader_volume_keys_inverted" const val readWithVolumeKeysInverted = "reader_volume_keys_inverted"
const val navigationModePager = "reader_navigation_mode_pager"
const val navigationModeWebtoon = "reader_navigation_mode_webtoon"
const val showNavigationOverlayNewUser = "reader_navigation_overlay_new_user"
const val showNavigationOverlayOnStart = "reader_navigation_overlay_on_start"
const val webtoonSidePadding = "webtoon_side_padding" const val webtoonSidePadding = "webtoon_side_padding"
const val portraitColumns = "pref_library_columns_portrait_key" const val portraitColumns = "pref_library_columns_portrait_key"
@@ -77,6 +101,8 @@ object PreferenceKeys {
const val autoUpdateTrack = "pref_auto_update_manga_sync_key" const val autoUpdateTrack = "pref_auto_update_manga_sync_key"
const val autoAddTrack = "pref_auto_add_track_key"
const val lastUsedSource = "last_catalogue_source" const val lastUsedSource = "last_catalogue_source"
const val lastUsedCategory = "last_used_category" const val lastUsedCategory = "last_used_category"
@@ -91,6 +117,8 @@ object PreferenceKeys {
const val downloadOnlyOverWifi = "pref_download_only_over_wifi_key" const val downloadOnlyOverWifi = "pref_download_only_over_wifi_key"
const val folderPerManga = "create_folder_per_manga"
const val numberOfBackups = "backup_slots" const val numberOfBackups = "backup_slots"
const val backupInterval = "backup_interval" const val backupInterval = "backup_interval"
@@ -106,6 +134,7 @@ object PreferenceKeys {
const val libraryUpdateRestriction = "library_update_restriction" const val libraryUpdateRestriction = "library_update_restriction"
const val libraryUpdateCategories = "library_update_categories" const val libraryUpdateCategories = "library_update_categories"
const val libraryUpdateCategoriesExclude = "library_update_categories_exclude"
const val libraryUpdatePrioritization = "library_update_prioritization" const val libraryUpdatePrioritization = "library_update_prioritization"
@@ -117,21 +146,23 @@ object PreferenceKeys {
const val filterCompleted = "pref_filter_library_completed" const val filterCompleted = "pref_filter_library_completed"
const val filterStarted = "pref_filter_library_started"
const val filterTracked = "pref_filter_library_tracked" const val filterTracked = "pref_filter_library_tracked"
const val filterStarted = "pref_filter_library_started"
const val filterLewd = "pref_filter_library_lewd" const val filterLewd = "pref_filter_library_lewd"
const val librarySortingMode = "library_sorting_mode" const val librarySortingMode = "library_sorting_mode"
const val automaticExtUpdates = "automatic_ext_updates" const val automaticExtUpdates = "automatic_ext_updates"
const val allowNsfwSource = "allow_nsfw_source" const val showNsfwSource = "show_nsfw_source"
const val showNsfwExtension = "show_nsfw_extension"
const val labelNsfwExtension = "label_nsfw_extension"
const val startScreen = "start_screen" const val startScreen = "start_screen"
const val useBiometricLock = "use_biometric_lock" const val useAuthenticator = "use_biometric_lock"
const val lockAppAfter = "lock_app_after" const val lockAppAfter = "lock_app_after"
@@ -143,11 +174,14 @@ object PreferenceKeys {
const val autoUpdateMetadata = "auto_update_metadata" const val autoUpdateMetadata = "auto_update_metadata"
const val autoUpdateTrackers = "auto_update_trackers"
const val showLibraryUpdateErrors = "show_library_update_errors" const val showLibraryUpdateErrors = "show_library_update_errors"
const val downloadNew = "download_new" const val downloadNew = "download_new"
const val downloadNewCategories = "download_new_categories" const val downloadNewCategories = "download_new_categories"
const val downloadNewCategoriesExclude = "download_new_categories_exclude"
const val libraryDisplayMode = "pref_display_mode_library" const val libraryDisplayMode = "pref_display_mode_library"
@@ -165,15 +199,17 @@ object PreferenceKeys {
const val unreadBadge = "display_unread_badge" const val unreadBadge = "display_unread_badge"
const val localBadge = "display_local_badge"
const val categoryTabs = "display_category_tabs" const val categoryTabs = "display_category_tabs"
const val skipPreMigration = "skip_pre_migration" const val categoryNumberOfItems = "display_number_of_items"
const val alwaysShowChapterTransition = "always_show_chapter_transition" const val alwaysShowChapterTransition = "always_show_chapter_transition"
const val searchPinnedSourcesOnly = "search_pinned_sources_only" const val searchPinnedSourcesOnly = "search_pinned_sources_only"
const val enableDoh = "enable_doh" const val dohProvider = "doh_provider"
const val defaultChapterFilterByRead = "default_chapter_filter_by_read" const val defaultChapterFilterByRead = "default_chapter_filter_by_read"
@@ -195,6 +231,8 @@ object PreferenceKeys {
fun trackToken(syncId: Int) = "track_token_$syncId" fun trackToken(syncId: Int) = "track_token_$syncId"
const val skipPreMigration = "skip_pre_migration"
const val eh_showSyncIntro = "eh_show_sync_intro" const val eh_showSyncIntro = "eh_show_sync_intro"
const val eh_readOnlySync = "eh_sync_read_only" const val eh_readOnlySync = "eh_sync_read_only"
@@ -295,11 +333,7 @@ object PreferenceKeys {
const val mangaDexForceLatestCovers = "manga_dex_force_latest_covers" const val mangaDexForceLatestCovers = "manga_dex_force_latest_covers"
const val mangadexSimilarEnabled = "pref_related_show_tab_key" const val mangadexSyncToLibraryIndexes = "pref_mangadex_sync_to_library_indexes"
const val mangadexSimilarUpdateInterval = "related_update_interval"
const val mangadexSimilarOnlyOverWifi = "pref_simular_only_over_wifi_key"
const val preferredMangaDexId = "preferred_mangaDex_id" const val preferredMangaDexId = "preferred_mangaDex_id"
@@ -323,11 +357,31 @@ object PreferenceKeys {
const val allowLocalSourceHiddenFolders = "allow_local_source_hidden_folders" const val allowLocalSourceHiddenFolders = "allow_local_source_hidden_folders"
const val biometricTimeRanges = "biometric_time_ranges" const val authenticatorTimeRanges = "biometric_time_ranges"
const val sortTagsForLibrary = "sort_tags_for_library" const val sortTagsForLibrary = "sort_tags_for_library"
const val createLegacyBackup = "create_legacy_backup"
const val dontDeleteFromCategories = "dont_delete_from_categories" const val dontDeleteFromCategories = "dont_delete_from_categories"
const val extensionRepos = "extension_repos"
const val cropBordersContinuousVertical = "crop_borders_continues_vertical"
const val landscapeVerticalSeekbar = "pref_show_vert_seekbar_landscape"
const val leftVerticalSeekbar = "pref_left_handed_vertical_seekbar"
const val forceHorizontalSeekbar = "pref_force_horz_seekbar"
const val readerBottomButtons = "reader_bottom_buttons"
const val bottomBarLabels = "pref_show_bottom_bar_labels"
const val hideUpdatesButton = "pref_hide_updates_button"
const val hideHistoryButton = "pref_hide_history_button"
const val pageLayout = "page_layout"
const val invertDoublePages = "invert_double_pages"
} }
@@ -1,10 +1,15 @@
package eu.kanade.tachiyomi.data.preference package eu.kanade.tachiyomi.data.preference
const val UNMETERED_NETWORK = "wifi"
const val CHARGING = "ac"
/** /**
* This class stores the values for the preferences in the application. * This class stores the values for the preferences in the application.
*/ */
object PreferenceValues { object PreferenceValues {
/* ktlint-disable experimental:enum-entry-name-case */
// Keys are lowercase to match legacy string values // Keys are lowercase to match legacy string values
enum class ThemeMode { enum class ThemeMode {
light, light,
@@ -16,16 +21,23 @@ object PreferenceValues {
enum class LightThemeVariant { enum class LightThemeVariant {
default, default,
blue, blue,
strawberrydaiquiri,
} }
// Keys are lowercase to match legacy string values // Keys are lowercase to match legacy string values
enum class DarkThemeVariant { enum class DarkThemeVariant {
default, default,
blue, blue,
greenapple,
midnightdusk,
amoled, amoled,
hotpink,
amoledblue,
red, red,
} }
/* ktlint-enable experimental:enum-entry-name-case */
enum class DisplayMode { enum class DisplayMode {
COMPACT_GRID, COMPACT_GRID,
COMFORTABLE_GRID, COMFORTABLE_GRID,
@@ -37,17 +49,11 @@ object PreferenceValues {
LIST, LIST,
} }
enum class TappingInvertMode { enum class TappingInvertMode(val shouldInvertHorizontal: Boolean = false, val shouldInvertVertical: Boolean = false) {
NONE, NONE,
HORIZONTAL, HORIZONTAL(shouldInvertHorizontal = true),
VERTICAL, VERTICAL(shouldInvertVertical = true),
BOTH BOTH(shouldInvertHorizontal = true, shouldInvertVertical = true)
}
enum class NsfwAllowance {
ALLOWED,
PARTIAL,
BLOCKED
} }
// SY --> // SY -->
@@ -10,11 +10,13 @@ import com.tfcporciuncula.flow.Preference
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode
import eu.kanade.tachiyomi.data.preference.PreferenceValues.NsfwAllowance
import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.anilist.Anilist import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.ui.reader.setting.ReaderBottomButton
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig
import eu.kanade.tachiyomi.widget.ExtendedNavigationView import eu.kanade.tachiyomi.widget.ExtendedNavigationView
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onEach
import java.io.File import java.io.File
@@ -24,8 +26,7 @@ import java.util.Locale
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values
@OptIn(ExperimentalCoroutinesApi::class) fun <T> Preference<T>.asImmediateFlow(block: (T) -> Unit): Flow<T> {
fun <T> Preference<T>.asImmediateFlow(block: (value: T) -> Unit): Flow<T> {
block(get()) block(get())
return asFlow() return asFlow()
.onEach { block(it) } .onEach { block(it) }
@@ -39,7 +40,11 @@ operator fun <T> Preference<Set<T>>.minusAssign(item: T) {
set(get() - item) set(get() - item)
} }
@OptIn(ExperimentalCoroutinesApi::class) fun Preference<Boolean>.toggle(): Boolean {
set(!get())
return get()
}
class PreferencesHelper(val context: Context) { class PreferencesHelper(val context: Context) {
private val prefs = PreferenceManager.getDefaultSharedPreferences(context) private val prefs = PreferenceManager.getDefaultSharedPreferences(context)
@@ -61,9 +66,11 @@ class PreferencesHelper(val context: Context) {
fun confirmExit() = prefs.getBoolean(Keys.confirmExit, false) fun confirmExit() = prefs.getBoolean(Keys.confirmExit, false)
fun hideBottomBar() = flowPrefs.getBoolean(Keys.hideBottomBar, true) fun hideBottomBarOnScroll() = flowPrefs.getBoolean(Keys.hideBottomBarOnScroll, true)
fun useBiometricLock() = flowPrefs.getBoolean(Keys.useBiometricLock, false) fun showSideNavOnBottom() = flowPrefs.getBoolean(Keys.showSideNavOnBottom, false)
fun useAuthenticator() = flowPrefs.getBoolean(Keys.useAuthenticator, false)
fun lockAppAfter() = flowPrefs.getInt(Keys.lockAppAfter, 0) fun lockAppAfter() = flowPrefs.getInt(Keys.lockAppAfter, 0)
@@ -75,9 +82,9 @@ class PreferencesHelper(val context: Context) {
fun autoUpdateMetadata() = prefs.getBoolean(Keys.autoUpdateMetadata, false) fun autoUpdateMetadata() = prefs.getBoolean(Keys.autoUpdateMetadata, false)
fun showLibraryUpdateErrors() = prefs.getBoolean(Keys.showLibraryUpdateErrors, false) fun autoUpdateTrackers() = prefs.getBoolean(Keys.autoUpdateTrackers, false)
fun clear() = prefs.edit { clear() } fun showLibraryUpdateErrors() = prefs.getBoolean(Keys.showLibraryUpdateErrors, false)
fun themeMode() = flowPrefs.getEnum(Keys.themeMode, Values.ThemeMode.system) fun themeMode() = flowPrefs.getEnum(Keys.themeMode, Values.ThemeMode.system)
@@ -85,14 +92,22 @@ class PreferencesHelper(val context: Context) {
fun themeDark() = flowPrefs.getEnum(Keys.themeDark, Values.DarkThemeVariant.default) fun themeDark() = flowPrefs.getEnum(Keys.themeDark, Values.DarkThemeVariant.default)
fun rotation() = flowPrefs.getInt(Keys.rotation, 1) fun pageTransitionsPager() = flowPrefs.getBoolean(Keys.enableTransitionsPager, true)
fun pageTransitions() = flowPrefs.getBoolean(Keys.enableTransitions, true) fun pageTransitionsWebtoon() = flowPrefs.getBoolean(Keys.enableTransitionsWebtoon, true)
fun doubleTapAnimSpeed() = flowPrefs.getInt(Keys.doubleTapAnimationSpeed, 500) fun doubleTapAnimSpeed() = flowPrefs.getInt(Keys.doubleTapAnimationSpeed, 500)
fun showPageNumber() = flowPrefs.getBoolean(Keys.showPageNumber, true) fun showPageNumber() = flowPrefs.getBoolean(Keys.showPageNumber, true)
fun dualPageSplitPaged() = flowPrefs.getBoolean(Keys.dualPageSplitPaged, false)
fun dualPageSplitWebtoon() = flowPrefs.getBoolean(Keys.dualPageSplitWebtoon, false)
fun dualPageInvertPaged() = flowPrefs.getBoolean(Keys.dualPageInvertPaged, false)
fun dualPageInvertWebtoon() = flowPrefs.getBoolean(Keys.dualPageInvertWebtoon, false)
fun showReadingMode() = prefs.getBoolean(Keys.showReadingMode, true) fun showReadingMode() = prefs.getBoolean(Keys.showReadingMode, true)
fun trueColor() = flowPrefs.getBoolean(Keys.trueColor, false) fun trueColor() = flowPrefs.getBoolean(Keys.trueColor, false)
@@ -113,7 +128,11 @@ class PreferencesHelper(val context: Context) {
fun colorFilterMode() = flowPrefs.getInt(Keys.colorFilterMode, 0) fun colorFilterMode() = flowPrefs.getInt(Keys.colorFilterMode, 0)
fun defaultViewer() = prefs.getInt(Keys.defaultViewer, 2) fun grayscale() = flowPrefs.getBoolean(Keys.grayscale, false)
fun defaultReadingMode() = prefs.getInt(Keys.defaultReadingMode, ReadingModeType.RIGHT_TO_LEFT.flagValue)
fun defaultOrientationType() = prefs.getInt(Keys.defaultOrientationType, OrientationType.FREE.flagValue)
fun imageScaleType() = flowPrefs.getInt(Keys.imageScaleType, 1) fun imageScaleType() = flowPrefs.getInt(Keys.imageScaleType, 1)
@@ -131,7 +150,9 @@ class PreferencesHelper(val context: Context) {
fun readWithTapping() = flowPrefs.getBoolean(Keys.readWithTapping, true) fun readWithTapping() = flowPrefs.getBoolean(Keys.readWithTapping, true)
fun readWithTappingInverted() = flowPrefs.getEnum(Keys.readWithTappingInverted, Values.TappingInvertMode.NONE) fun pagerNavInverted() = flowPrefs.getEnum(Keys.pagerNavInverted, Values.TappingInvertMode.NONE)
fun webtoonNavInverted() = flowPrefs.getEnum(Keys.webtoonNavInverted, Values.TappingInvertMode.NONE)
fun readWithLongTap() = flowPrefs.getBoolean(Keys.readWithLongTap, true) fun readWithLongTap() = flowPrefs.getBoolean(Keys.readWithLongTap, true)
@@ -139,6 +160,14 @@ class PreferencesHelper(val context: Context) {
fun readWithVolumeKeysInverted() = flowPrefs.getBoolean(Keys.readWithVolumeKeysInverted, false) fun readWithVolumeKeysInverted() = flowPrefs.getBoolean(Keys.readWithVolumeKeysInverted, false)
fun navigationModePager() = flowPrefs.getInt(Keys.navigationModePager, 0)
fun navigationModeWebtoon() = flowPrefs.getInt(Keys.navigationModeWebtoon, 0)
fun showNavigationOverlayNewUser() = flowPrefs.getBoolean(Keys.showNavigationOverlayNewUser, true)
fun showNavigationOverlayOnStart() = flowPrefs.getBoolean(Keys.showNavigationOverlayOnStart, false)
fun portraitColumns() = flowPrefs.getInt(Keys.portraitColumns, 0) fun portraitColumns() = flowPrefs.getInt(Keys.portraitColumns, 0)
fun landscapeColumns() = flowPrefs.getInt(Keys.landscapeColumns, 0) fun landscapeColumns() = flowPrefs.getInt(Keys.landscapeColumns, 0)
@@ -149,6 +178,8 @@ class PreferencesHelper(val context: Context) {
fun autoUpdateTrack() = prefs.getBoolean(Keys.autoUpdateTrack, true) fun autoUpdateTrack() = prefs.getBoolean(Keys.autoUpdateTrack, true)
fun autoAddTrack() = prefs.getBoolean(Keys.autoAddTrack, true)
fun lastUsedSource() = flowPrefs.getLong(Keys.lastUsedSource, -1) fun lastUsedSource() = flowPrefs.getLong(Keys.lastUsedSource, -1)
fun lastUsedCategory() = flowPrefs.getInt(Keys.lastUsedCategory, 0) fun lastUsedCategory() = flowPrefs.getInt(Keys.lastUsedCategory, 0)
@@ -185,6 +216,8 @@ class PreferencesHelper(val context: Context) {
fun downloadOnlyOverWifi() = prefs.getBoolean(Keys.downloadOnlyOverWifi, true) fun downloadOnlyOverWifi() = prefs.getBoolean(Keys.downloadOnlyOverWifi, true)
fun folderPerManga() = prefs.getBoolean(Keys.folderPerManga, false)
fun numberOfBackups() = flowPrefs.getInt(Keys.numberOfBackups, 1) fun numberOfBackups() = flowPrefs.getInt(Keys.numberOfBackups, 1)
fun backupInterval() = flowPrefs.getInt(Keys.backupInterval, 0) fun backupInterval() = flowPrefs.getInt(Keys.backupInterval, 0)
@@ -197,9 +230,10 @@ class PreferencesHelper(val context: Context) {
fun libraryUpdateInterval() = flowPrefs.getInt(Keys.libraryUpdateInterval, 24) fun libraryUpdateInterval() = flowPrefs.getInt(Keys.libraryUpdateInterval, 24)
fun libraryUpdateRestriction() = prefs.getStringSet(Keys.libraryUpdateRestriction, setOf("wifi")) fun libraryUpdateRestriction() = flowPrefs.getStringSet(Keys.libraryUpdateRestriction, setOf(UNMETERED_NETWORK))
fun libraryUpdateCategories() = flowPrefs.getStringSet(Keys.libraryUpdateCategories, emptySet()) fun libraryUpdateCategories() = flowPrefs.getStringSet(Keys.libraryUpdateCategories, emptySet())
fun libraryUpdateCategoriesExclude() = flowPrefs.getStringSet(Keys.libraryUpdateCategoriesExclude, emptySet())
fun libraryUpdatePrioritization() = flowPrefs.getInt(Keys.libraryUpdatePrioritization, 0) fun libraryUpdatePrioritization() = flowPrefs.getInt(Keys.libraryUpdatePrioritization, 0)
@@ -207,21 +241,25 @@ class PreferencesHelper(val context: Context) {
fun downloadBadge() = flowPrefs.getBoolean(Keys.downloadBadge, false) fun downloadBadge() = flowPrefs.getBoolean(Keys.downloadBadge, false)
fun localBadge() = flowPrefs.getBoolean(Keys.localBadge, true)
fun downloadedOnly() = flowPrefs.getBoolean(Keys.downloadedOnly, false) fun downloadedOnly() = flowPrefs.getBoolean(Keys.downloadedOnly, false)
fun unreadBadge() = flowPrefs.getBoolean(Keys.unreadBadge, true) fun unreadBadge() = flowPrefs.getBoolean(Keys.unreadBadge, true)
fun categoryTabs() = flowPrefs.getBoolean(Keys.categoryTabs, true) fun categoryTabs() = flowPrefs.getBoolean(Keys.categoryTabs, true)
fun categoryNumberOfItems() = flowPrefs.getBoolean(Keys.categoryNumberOfItems, false)
fun filterDownloaded() = flowPrefs.getInt(Keys.filterDownloaded, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterDownloaded() = flowPrefs.getInt(Keys.filterDownloaded, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
fun filterUnread() = flowPrefs.getInt(Keys.filterUnread, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterUnread() = flowPrefs.getInt(Keys.filterUnread, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
fun filterCompleted() = flowPrefs.getInt(Keys.filterCompleted, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterCompleted() = flowPrefs.getInt(Keys.filterCompleted, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
fun filterStarted() = flowPrefs.getInt(Keys.filterStarted, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterTracking(name: Int) = flowPrefs.getInt("${Keys.filterTracked}_$name", ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
fun filterTracked() = flowPrefs.getInt(Keys.filterTracked, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterStarted() = flowPrefs.getInt(Keys.filterStarted, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
fun filterLewd() = flowPrefs.getInt(Keys.filterLewd, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value) fun filterLewd() = flowPrefs.getInt(Keys.filterLewd, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
@@ -231,7 +269,9 @@ class PreferencesHelper(val context: Context) {
fun automaticExtUpdates() = flowPrefs.getBoolean(Keys.automaticExtUpdates, true) fun automaticExtUpdates() = flowPrefs.getBoolean(Keys.automaticExtUpdates, true)
fun allowNsfwSource() = flowPrefs.getEnum(Keys.allowNsfwSource, NsfwAllowance.ALLOWED) fun showNsfwSource() = flowPrefs.getBoolean(Keys.showNsfwSource, true)
fun showNsfwExtension() = flowPrefs.getBoolean(Keys.showNsfwExtension, true)
fun labelNsfwExtension() = prefs.getBoolean(Keys.labelNsfwExtension, true)
fun extensionUpdatesCount() = flowPrefs.getInt("ext_updates_count", 0) fun extensionUpdatesCount() = flowPrefs.getInt("ext_updates_count", 0)
@@ -246,6 +286,7 @@ class PreferencesHelper(val context: Context) {
fun downloadNew() = flowPrefs.getBoolean(Keys.downloadNew, false) fun downloadNew() = flowPrefs.getBoolean(Keys.downloadNew, false)
fun downloadNewCategories() = flowPrefs.getStringSet(Keys.downloadNewCategories, emptySet()) fun downloadNewCategories() = flowPrefs.getStringSet(Keys.downloadNewCategories, emptySet())
fun downloadNewCategoriesExclude() = flowPrefs.getStringSet(Keys.downloadNewCategoriesExclude, emptySet())
fun lang() = prefs.getString(Keys.lang, "") fun lang() = prefs.getString(Keys.lang, "")
@@ -259,7 +300,7 @@ class PreferencesHelper(val context: Context) {
fun trustedSignatures() = flowPrefs.getStringSet("trusted_signatures", emptySet()) fun trustedSignatures() = flowPrefs.getStringSet("trusted_signatures", emptySet())
fun enableDoh() = prefs.getBoolean(Keys.enableDoh, false) fun dohProvider() = prefs.getInt(Keys.dohProvider, -1)
fun lastSearchQuerySearchSettings() = flowPrefs.getString("last_search_query", "") fun lastSearchQuerySearchSettings() = flowPrefs.getString("last_search_query", "")
@@ -269,16 +310,14 @@ class PreferencesHelper(val context: Context) {
fun filterChapterByBookmarked() = prefs.getInt(Keys.defaultChapterFilterByBookmarked, Manga.SHOW_ALL) fun filterChapterByBookmarked() = prefs.getInt(Keys.defaultChapterFilterByBookmarked, Manga.SHOW_ALL)
fun sortChapterBySourceOrNumber() = prefs.getInt(Keys.defaultChapterSortBySourceOrNumber, Manga.SORTING_SOURCE) fun sortChapterBySourceOrNumber() = prefs.getInt(Keys.defaultChapterSortBySourceOrNumber, Manga.CHAPTER_SORTING_SOURCE)
fun displayChapterByNameOrNumber() = prefs.getInt(Keys.defaultChapterDisplayByNameOrNumber, Manga.DISPLAY_NAME) fun displayChapterByNameOrNumber() = prefs.getInt(Keys.defaultChapterDisplayByNameOrNumber, Manga.CHAPTER_DISPLAY_NAME)
fun sortChapterByAscendingOrDescending() = prefs.getInt(Keys.defaultChapterSortByAscendingOrDescending, Manga.SORT_DESC) fun sortChapterByAscendingOrDescending() = prefs.getInt(Keys.defaultChapterSortByAscendingOrDescending, Manga.CHAPTER_SORT_DESC)
fun incognitoMode() = flowPrefs.getBoolean(Keys.incognitoMode, false) fun incognitoMode() = flowPrefs.getBoolean(Keys.incognitoMode, false)
fun createLegacyBackup() = flowPrefs.getBoolean(Keys.createLegacyBackup, true)
fun setChapterSettingsDefault(manga: Manga) { fun setChapterSettingsDefault(manga: Manga) {
prefs.edit { prefs.edit {
putInt(Keys.defaultChapterFilterByRead, manga.readFilter) putInt(Keys.defaultChapterFilterByRead, manga.readFilter)
@@ -286,7 +325,7 @@ class PreferencesHelper(val context: Context) {
putInt(Keys.defaultChapterFilterByBookmarked, manga.bookmarkedFilter) putInt(Keys.defaultChapterFilterByBookmarked, manga.bookmarkedFilter)
putInt(Keys.defaultChapterSortBySourceOrNumber, manga.sorting) putInt(Keys.defaultChapterSortBySourceOrNumber, manga.sorting)
putInt(Keys.defaultChapterDisplayByNameOrNumber, manga.displayMode) putInt(Keys.defaultChapterDisplayByNameOrNumber, manga.displayMode)
putInt(Keys.defaultChapterSortByAscendingOrDescending, if (manga.sortDescending()) Manga.SORT_DESC else Manga.SORT_ASC) putInt(Keys.defaultChapterSortByAscendingOrDescending, if (manga.sortDescending()) Manga.CHAPTER_SORT_DESC else Manga.CHAPTER_SORT_ASC)
} }
} }
@@ -411,13 +450,7 @@ class PreferencesHelper(val context: Context) {
fun preferredMangaDexId() = flowPrefs.getString(Keys.preferredMangaDexId, "0") fun preferredMangaDexId() = flowPrefs.getString(Keys.preferredMangaDexId, "0")
fun mangadexSimilarEnabled() = flowPrefs.getBoolean(Keys.mangadexSimilarEnabled, false) fun mangadexSyncToLibraryIndexes() = flowPrefs.getStringSet(Keys.mangadexSyncToLibraryIndexes, emptySet())
fun shownMangaDexSimilarAskDialog() = flowPrefs.getBoolean("shown_similar_ask_dialog", false)
fun mangadexSimilarOnlyOverWifi() = flowPrefs.getBoolean(Keys.mangadexSimilarOnlyOverWifi, true)
fun mangadexSimilarUpdateInterval() = flowPrefs.getInt(Keys.mangadexSimilarUpdateInterval, 2)
fun dataSaver() = flowPrefs.getBoolean(Keys.dataSaver, false) fun dataSaver() = flowPrefs.getBoolean(Keys.dataSaver, false)
@@ -439,9 +472,31 @@ class PreferencesHelper(val context: Context) {
fun allowLocalSourceHiddenFolders() = flowPrefs.getBoolean(Keys.allowLocalSourceHiddenFolders, false) fun allowLocalSourceHiddenFolders() = flowPrefs.getBoolean(Keys.allowLocalSourceHiddenFolders, false)
fun biometricTimeRanges() = flowPrefs.getStringSet(Keys.biometricTimeRanges, mutableSetOf()) fun authenticatorTimeRanges() = flowPrefs.getStringSet(Keys.authenticatorTimeRanges, mutableSetOf())
fun sortTagsForLibrary() = flowPrefs.getStringSet(Keys.sortTagsForLibrary, mutableSetOf()) fun sortTagsForLibrary() = flowPrefs.getStringSet(Keys.sortTagsForLibrary, mutableSetOf())
fun dontDeleteFromCategories() = flowPrefs.getStringSet(Keys.dontDeleteFromCategories, emptySet()) fun dontDeleteFromCategories() = flowPrefs.getStringSet(Keys.dontDeleteFromCategories, emptySet())
fun extensionRepos() = flowPrefs.getStringSet(Keys.extensionRepos, emptySet())
fun cropBordersContinuousVertical() = flowPrefs.getBoolean(Keys.cropBordersContinuousVertical, false)
fun forceHorizontalSeekbar() = flowPrefs.getBoolean(Keys.forceHorizontalSeekbar, false)
fun landscapeVerticalSeekbar() = flowPrefs.getBoolean(Keys.landscapeVerticalSeekbar, false)
fun leftVerticalSeekbar() = flowPrefs.getBoolean(Keys.leftVerticalSeekbar, false)
fun readerBottomButtons() = flowPrefs.getStringSet(Keys.readerBottomButtons, ReaderBottomButton.BUTTONS_DEFAULTS)
fun bottomBarLabels() = flowPrefs.getBoolean(Keys.bottomBarLabels, true)
fun hideUpdatesButton() = flowPrefs.getBoolean(Keys.hideUpdatesButton, false)
fun hideHistoryButton() = flowPrefs.getBoolean(Keys.hideHistoryButton, false)
fun pageLayout() = flowPrefs.getInt(Keys.pageLayout, PagerConfig.PageLayout.SINGLE_PAGE)
fun invertDoublePages() = flowPrefs.getBoolean(Keys.invertDoublePages, false)
} }
@@ -0,0 +1,8 @@
package eu.kanade.tachiyomi.data.track
/**
* A TrackService that doesn't need explicit login.
*/
interface NoLoginTrackService {
fun loginNoop()
}
@@ -4,6 +4,7 @@ import android.content.Context
import eu.kanade.tachiyomi.data.track.anilist.Anilist import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.data.track.bangumi.Bangumi import eu.kanade.tachiyomi.data.track.bangumi.Bangumi
import eu.kanade.tachiyomi.data.track.kitsu.Kitsu import eu.kanade.tachiyomi.data.track.kitsu.Kitsu
import eu.kanade.tachiyomi.data.track.komga.Komga
import eu.kanade.tachiyomi.data.track.mdlist.MdList import eu.kanade.tachiyomi.data.track.mdlist.MdList
import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList
import eu.kanade.tachiyomi.data.track.shikimori.Shikimori import eu.kanade.tachiyomi.data.track.shikimori.Shikimori
@@ -16,9 +17,10 @@ class TrackManager(context: Context) {
const val KITSU = 3 const val KITSU = 3
const val SHIKIMORI = 4 const val SHIKIMORI = 4
const val BANGUMI = 5 const val BANGUMI = 5
const val KOMGA = 6
// SY --> Mangadex from Neko // SY --> Mangadex from Neko
const val MDLIST = 6 const val MDLIST = 60
// SY <-- // SY <--
// SY --> // SY -->
@@ -44,11 +46,13 @@ class TrackManager(context: Context) {
val bangumi = Bangumi(context, BANGUMI) val bangumi = Bangumi(context, BANGUMI)
val services = listOf(mdList, myAnimeList, aniList, kitsu, shikimori, bangumi) val komga = Komga(context, KOMGA)
val services = listOf(mdList, myAnimeList, aniList, kitsu, shikimori, bangumi, komga)
fun getService(id: Int) = services.find { it.id == id } fun getService(id: Int) = services.find { it.id == id }
fun hasLoggedServices(isMangaDexManga: Boolean = true) = services.any { it.isLogged && ((it.id == MDLIST && isMangaDexManga) || it.id != MDLIST) } fun hasLoggedServices() = services.any { it.isLogged }
// SY --> // SY -->
fun mapTrackingOrder(status: String, context: Context): Int { fun mapTrackingOrder(status: String, context: Context): Int {

Some files were not shown because too many files have changed in this diff Show More