Compare commits

...
513 Commits
Author SHA1 Message Date
Mend Renovate 446f6df82c Update androidx.paging to v3.5.3 (#4099) 2026-10-13 10:30:48 +06:00
AntsyLich 3100dceddd Release v0.21.2
Keeps the changelog entries that f45d0ad31d removed for the release under
Unreleased, since main still has the WebGPU reader and the new image
decoder.

(cherry picked from commit 9612d955db)
2026-10-13 10:27:57 +06:00
AntsyLichandNGB-Was-Taken 771ba33a33 Stream entries when creating and restoring backups
Closes #3850

Co-authored-by: NGB-Was-Taken <76197326+NGB-Was-Taken@users.noreply.github.com>
2026-10-13 01:51:35 +06:00
AntsyLichandtigeryu8900 5a5ff22c37 Fix concurrent Cloudflare challenges each opening a WebView
Closes #3858

Co-authored-by: tigeryu8900 <tigeryu8900@gmail.com>
2026-10-13 01:51:35 +06:00
AntsyLich f0f1e4de5a Fix some downloads not being recognized 2026-10-12 22:33:31 +06:00
AntsyLich c371d6331d Ignore long strip taps confirmed after the reader is gone 2026-10-12 22:33:31 +06:00
AntsyLich 2df48e19a1 Fail the install when nothing can confirm it instead of crashing 2026-10-12 22:33:30 +06:00
AntsyLich c9e1b6e96e Show invalid filters from extensions instead of crashing 2026-10-12 22:33:30 +06:00
AntsyLich 3156b4a1c4 Insert split pages only into the chapter they belong to 2026-10-12 22:33:30 +06:00
hazptr ee59394542 Fix tracker start date being shifted by the UTC offset (#4049)
Closes #1340
Closes #4049
2026-10-12 22:33:30 +06:00
AntsyLich 7ae858e602 Solve Cloudflare challenges of non-GET requests on the site's root
Closes #3909
2026-10-12 22:33:30 +06:00
AntsyLich 43de88c718 Update navigationevent to stop back gestures crashing closed screens 2026-10-12 22:33:30 +06:00
AntsyLich ea2b73ad78 Guard the database update against duplicates and damaged indexes 2026-10-12 22:33:30 +06:00
MajorTanya 1ca9b0efb8 Don't send full Doubles to Comick for progress (#4090)
Previously, user could end up with progress displays like

35.019996643066406/100

because Mihon was sending raw Doubles/simply stringified Doubles for
progress data.

We now round to 2 decimal places & trim off any trailing zeroes such
that integers are sent as "1" instead of "1.0" while retaining "25.5"
and "41.02" as such.
2026-10-12 12:27:25 +00:00
AntsyLich 66e736222d Release v0.21.1
Keeps the changelog entries that f45d0ad31d removed for the release under
Unreleased, since main still has the WebGPU reader and the new image
decoder.

(cherry picked from commit e9670d8a12)
2026-10-12 14:22:38 +06:00
AntsyLich 51b61a36e8 Keep the pager on its page when chapters are added before layout
Closes #4079
2026-10-12 13:56:33 +06:00
AntsyLich 010ac71a84 Revert "Always update uninitialized library entries (#3179)"
This reverts commit 8c0419657b.

Closes #4081
2026-10-12 13:56:33 +06:00
AntsyLich 9dbb7148c5 Show failed migrations instead of waiting on them forever 2026-10-12 13:56:33 +06:00
AntsyLich a999e49f2f Index duplicate entries so moving their chapters doesn't take hours 2026-10-12 13:56:33 +06:00
AntsyLich ae749bb4f8 Only cancel the install of the extension being cancelled 2026-10-12 13:56:33 +06:00
AntsyLich 649fc83ffa Keep the app alive when a WebView renderer dies 2026-10-12 13:56:32 +06:00
AntsyLich 6dffca1593 Keep a missing date added as is when merging it into favorite_at 2026-10-12 13:56:32 +06:00
AntsyLich 07b9fb695c Fix extension installer crash when cancelling off the main thread 2026-10-12 13:56:32 +06:00
AntsyLich c279291e29 Fix manga screen FAB going under the taskbar on tablets
Closes #4077
2026-10-12 13:51:25 +06:00
AntsyLich abb126ad20 Fix startup crash on some Samsung Android 9 to 11 devices
Closes #4078
2026-10-12 13:51:25 +06:00
AntsyLich 8457fb91e0 Fix chapter refresh failing in locales with non-ASCII digits
Closes #4075
2026-10-12 13:51:25 +06:00
AntsyLich 143a060ac9 Release v0.21.0
Keeps the changelog entries that f45d0ad31d removed for the release under
Unreleased, since main still has the WebGPU reader and the new image
decoder.

(cherry picked from commit 79fc3a0a8a)
2026-10-12 02:40:27 +06:00
AntsyLich 8912ef5b5c Regenerate baseline profiles
(cherry picked from commit c8b820a08f)
2026-10-12 02:34:27 +06:00
AntsyLichandMatheus William b5856135c5 Fix webtoon scroll stutter between pages
Closes #4026

Co-authored-by: Matheus William <matheuswr89@outlook.com>
2026-10-12 00:37:45 +06:00
MajorTanya 039138ce99 Add Comick Tracker (#4056)
* Add Comick Tracker

Comick specifically requires a native reverse-domain scheme (just
`mihon://` is not accepted), so I went with `app.mihon://` which works
fine.

I added a new `intent-filter` for this because adding the scheme to
the existing `intent-filter` would effectively create all permutations
of schemes and hosts (i.e. it'd also accept `app.mihon://anilist-auth`
which we don't use).

A real client ID for Mihon's actual client is still missing.

* Changelog

 Conflicts:
	CHANGELOG.md

* Fix library adding failing with 400

I made this change after testing because I thought it'd have no
consequences.

Don't do that.

Comick does not allow `progress: {number: null}`, only
`progress: null` or `progress: {number: 123}`.

* Adjust to fit with changes in #4068

* Cut search query to fit Comick's 100 char limit

* Mihon client ID

* Close fire-forget requests according to c46317f0
2026-10-11 23:43:59 +06:00
WizaHX 35bd0a4b35 Fixed long strip side padding being counted in zoom bounds (#4072) 2026-10-11 17:11:51 +00:00
WizaHX dd4e9f00f1 Show a confirmation dialog when unfavoriting manga from the manga screen (#4073) 2026-10-11 22:59:40 +06:00
AntsyLich bce1f71958 Update changelog 2026-10-11 21:50:32 +06:00
AntsyLich d58130a5fc Check for app updates every 6 hours while the app is open 2026-10-11 21:45:51 +06:00
AntsyLich e562a9b4f8 Show a wavy progress ring while a chapter downloads 2026-10-11 21:33:35 +06:00
AntsyLich ba44815254 Count early, late and backdated releases when predicting next update 2026-10-11 21:33:35 +06:00
AntsyLich fc20410ceb Allow skipping an app update version
Closes #3969
Closes #3700
2026-10-11 15:38:14 +06:00
AntsyLich b454c1b469 Keep the migration screen up for at least a second 2026-10-11 15:11:07 +06:00
AntsyLich f02bf5ba7e Queue many chapters without probing each one on disk 2026-10-11 14:54:32 +06:00
AntsyLich ba16158b13 Show download progress and open the manga screen with less work 2026-10-11 13:43:35 +06:00
AntsyLich 8066b8dfc9 Read extension stores once at startup
Refreshing stores now fetches them all first and writes them in one transaction.
2026-10-11 13:43:34 +06:00
AntsyLich 260e31cd2c Improve performance across screens (#4071)
* Keep screens loaded while they're hidden and rebuild the library faster

* Count chapters in SQL for the migration list

* Show the extension list sooner and check trust against loaded stores

* Cancel the previous tracker search when searching again

* Write reader progress less often and keep its work off the main thread

* Stop rebuilding the settings search index on every key

* Watch updates for widgets only while one is placed

The query re-ran on every chapter or manga write even with no widget on
the home screen.

* Observe download pages and limit how often their progress updates

* Throttle the library update notification and write fetch data together
2026-10-11 04:28:52 +00:00
AntsyLich b15af71b94 Load installed extension and source icons through Coil 2026-10-11 05:04:59 +06:00
AntsyLich 3e5d593e28 Implement parallel page loading and preloading in reader (#2986) 2026-10-10 19:14:53 +00:00
MajorTanya c0c0909999 Fix Kitsu showing novels in search results (#4069) 2026-10-11 00:48:29 +06:00
AntsyLich c46317f099 Move blocking work off the main thread and fix threading races (#4068)
* Defer startup work until first use

* Move cover work off the main thread

* Make tracker calls main-safe and token refresh thread-safe

Kitsu, Shikimori and MangaBaka refresh their token under a lock like
MAL, so parallel calls no longer refresh it twice.

* Fix extension threading and make installs cancellable

The store service read response bodies on Main, which failed with
NetworkOnMainThreadException for http stores.

* Move reader work off the main thread and save progress in order

* Serialize the downloader and fix download threading

* Stop blocking on WorkManager status queries

Also removes NotificationReceiver's open chapter action: nothing sends
it, and its handler used runBlocking.

* Start migration jobs on the migrator's dispatcher

They started undispatched, so each ran on the caller's thread until its
first suspension.

* Run screen and view model work on fitting dispatchers

* Launch work that outlives a screen on the app scope

A launch on another dispatcher is dropped if the screen closes before it
starts, which dialogs that dismiss right away often do. Only the UI
follow-up stays on viewModelScope.

* Remove the coroutine helper extensions

They hid which dispatcher and scope a call used, and the GlobalScope
ones hid that it was global.
2026-10-10 17:08:49 +00:00
AntsyLich f9c5fa9011 Log app scope failures instead of crashing outside debug builds 2026-10-10 22:51:17 +06:00
AntsyLich a82d27c3a6 Keep the chapter selection when new chapters download after a refresh 2026-10-10 22:37:58 +06:00
AntsyLich 611578313e Index a finished download found on disk instead of downloading it again 2026-10-10 20:19:06 +06:00
AntsyLich f921ec07a6 Use an app scoped CoroutineScope
Replaces the eight ad hoc application lifetime scopes and the GlobalScope
launchUI/launchIO/launchNow helpers with a single injected
CoroutineScope(SupervisorJob() + Dispatchers.IO), qualified by
@AppCoroutineScope.

Every scope this replaces was already on IO, or named IO explicitly, so
call sites keep their dispatcher. The two that need the main thread use
scope.launchUI. Scopes with a real cancellation point keep their own:
HttpPageLoader, ShizukuInstaller and the reader viewers. Only
HttpPageLoader's page list cache save moves to the app scope, since it
runs after recycle() has cancelled the loader's own scope.

NotificationReceiver now holds the broadcast open with goAsync() while
its work runs, so the process isn't torn down mid update.

This reverts the revert of #3403. It was reverted for #3429, where
restore() dropped every download because SourceManager.get() returned
null until the extensions had loaded. That surface suspends since #3869,
so the race is gone.
2026-10-10 17:37:45 +06:00
AntsyLich e21414b229 Drop the legacy chapter model and narrow last page read to an Int
eu.kanade.tachiyomi.data.database.models.Chapter predates SQLDelight. It
survived because it implements SChapter, so ReaderChapter could hand the
same object to the database and to the source.

ReaderChapter now holds the domain Chapter and converts at the three
points that actually need a source model: getPageList, getFormat and
getChapterUrl. The domain model is immutable, so the reader replaces the
chapter rather than writing through it, behind an update function so the
field cannot be reassigned from outside. Equality stays on the chapter it
was loaded with, which keeps the identity comparisons in the viewers
stable while progress is recorded against it.

updateChapterProgress no longer mutates the chapter and reads the values
straight back out to build the update it persists; it computes them once
and passes them. Marking a chapter read moves out of the function named
for completing it and into the same place the page is recorded.

Removing the interface also drops the nullable id it carried, along with
three non-null assertions and a Float to Double conversion that the
compiler had been warning about.

A page position is an index into a chapter's pages, so it cannot exceed
Int range, but SQLite has one integer type and the column came back as a
Long. That width reached the domain model and then every caller either
carried it or converted, and the viewers had to narrow it again to index
a list with.

Declaring the column INTEGER AS Int moves the narrowing into a column
adapter, so it happens once where the value stops being a database
number. No migration: SQLite still stores an INTEGER, only the type
SQLDelight generates changes.

Backups are the exception and keep converting, because the field is on
the wire as int64 and has to stay that way. That is also the only place
the value arrives from outside the app, where a malformed file could
carry something that does not fit and truncate to a negative index, so
it is clamped rather than cast.
2026-10-10 17:37:44 +06:00
AntsyLich e42e01049d Recognize volumes and use neighbouring chapters for chapter numbers
Sync now recognizes the chapters of a manga together, which tells what a
name alone can't:
- Numbers every similar name shares, like the group in "Group 2 Chapter
  386", aren't the chapter number.
- Chapters without a number get one from the chapters around them, as long
  as none of them is in another volume, since numbers may start over in the
  next one. Between two chapters they get the missing whole numbers when
  those fit (2, ?, 4 -> 3), or .5, .6 and so on (10, ?, ?, 11 -> 10.5,
  10.6). Bonus chapters after the newest chapter go above it. A prologue
  gets 0, and volume 0 when the chapter after it has a volume.

Recognition returns a ChapterNumbering of the volume and chapter number as
strings, null when there is none. Sub-chapters keep their letter (19a) and
parts become one (Chapter 1.5 Part I -> 1.5a); sync turns the chapter
number into a double the way letters always counted. Volumes, seasons
included, are recognized from names and are no longer taken as the chapter
number. Sync only uses the chapter number for now.
2026-10-10 17:37:44 +06:00
AntsyLich 6c1b0702ba Use the beta Compose BOM
The alpha BOM's 2026.10.00 has the same Compose and Material 3 versions as the
beta one, but it keeps material3-adaptive on alpha. Tracker search now reads the
locale from composition, since Locale.current is deprecated.

Closes #4065
2026-10-10 17:37:44 +06:00
AntsyLich 292381662a Follow weekday and monthly release patterns for next update and back it up 2026-10-10 17:37:43 +06:00
AntsyLich 44c1e1915d Store every date in the database as an Instant 2026-10-10 17:37:43 +06:00
AntsyLich 8972882a34 Use plain icon buttons for extension actions 2026-10-10 17:37:43 +06:00
AntsyLichandJammo e9234f205d Match setting group headings in settings search (#4044)
Closes #4044
Fixes #3098

Co-authored-by: Jammo <8018115+kaosjammo@users.noreply.github.com>
2026-10-10 17:36:21 +06:00
Jammo adc9ee74ec Respect hidden missing chapter indicators in chapter headers (#4039)
Closes #4039
Fixes #2430
2026-10-10 17:36:20 +06:00
AntsyLichandAddictToTheKey be44a81fb6 Keep listing local chapters when one archive can't be read (#3997)
Closes #3997
Fixes #2548

Co-authored-by: AddictToTheKey <addicttothekey@local>
2026-10-10 17:36:20 +06:00
AntsyLichandChopper 88d4071cce Don't let the stored download index overwrite a startup rescan (#3968)
Closes #3968
Fixes #3526
Fixes #2808
Fixes #1429

Co-authored-by: Chopper <156493704+choppeh@users.noreply.github.com>
2026-10-10 17:36:20 +06:00
AntsyLichandJoseph f28b2d887e Cancel queued downloads of chapters the source removed (#3845)
Closes #3845
Fixes #3811
Fixes #3501

Co-authored-by: Joseph <50675784+JoJoKorok@users.noreply.github.com>
2026-10-10 17:36:20 +06:00
AntsyLichandAMendoza 287cbbb986 Keep the last update time on an empty Updates screen (#3790)
Closes #3790
Closes #4052
Fixes #3647

Co-authored-by: AMendoza <allanmaleman@gmail.com>
2026-10-10 17:36:20 +06:00
David d3f10772f2 Include the local source in global search (#3784)
Closes #3784
Fixes #3783
2026-10-10 17:36:19 +06:00
mliem2k 785f4fd1ed Keep downloads in excluded categories when marking them read (#3558)
Closes #3558
Closes #3130
Fixes #1521
2026-10-10 17:36:19 +06:00
AntsyLichandNarwhalHorns 40f552981a Don't match every library entry as a duplicate of a blank title (#3308)
Closes #3308

Co-authored-by: NarwhalHorns <onefailedgamer@gamil.com>
2026-10-10 17:36:19 +06:00
AntsyLichandNarwhalHorns 8c0419657b Always update library entries that were never initialized (#3179)
Closes #3179
Closes #3144

Co-authored-by: NarwhalHorns <onefailedgamer@gamil.com>
2026-10-10 17:36:19 +06:00
AntsyLichandLeodyver Semilla 36ec043a5c Delete downloads of duplicates read along with a chapter (#3030)
Closes #3030
Fixes #2454

Co-authored-by: Leodyver Semilla <leodyversemilla07@gmail.com>
2026-10-10 17:36:18 +06:00
AntsyLichandQuickdev 0c1be369b0 Ask to add an entry to the library before editing its cover (#2265)
Closes #2265

Co-authored-by: Quickdev <fyfrive@gmail.com>
2026-10-10 17:36:18 +06:00
Mend Renovate 157679bba5 Update spotless to v8.10.4 (#4063) 2026-10-10 07:23:12 +00:00
Mend Renovate 5b3505bf5f Update sqldelight to v2.4.1 (#4064) 2026-10-10 07:07:21 +00:00
Mend Renovate 2f5b9c1641 Update kotlin monorepo to v2.4.21 (#4061) 2026-10-10 07:06:15 +00:00
Mend Renovate 24bd3c95a5 Update Gradle to v9.8.1 (#4060) 2026-10-10 07:05:34 +00:00
Mend Renovate 7f2b4962b7 Update dependency com.google.firebase:firebase-bom to v35 (#4066) 2026-10-10 07:05:19 +00:00
Mend Renovate 8d39153569 Update androidx.paging to v3.5.2 (#4058) 2026-10-10 06:40:17 +00:00
Mend Renovate e998904fb6 Update GitHub Actions (#4059) 2026-10-10 06:38:43 +00:00
w d1e71ab58f Bump webgpuviewer (#4051) 2026-10-09 23:55:31 +06:00
AntsyLich a80027ff36 Update icons and move remaining to Material Symbols (#4057)
* Update Simple Icons to 16.34.0

The brand paths are unchanged; only the version in the headers moves.

* Use the current Material Symbols names

Several symbols were renamed after the Valkyrie migration. people_alt,
new_releases, screen_lock_*, screen_rotation and stay_current_* are only
aliases in the font now, for group, verified and the mobile_* symbols.
done, push_pin and expand_less/expand_more become check, keep and
keyboard_arrow_up/down, which draw the same or an almost identical glyph.

* Use filled icons where the Material Symbols migration dropped the fill

The migration mapped Filled and Default references to the outline symbols,
but the classic glyph was often solid, and Outlined Warning, Error and
Pause were solid as well. Each call site was compared against the rendered
classic glyph, and the solid ones now use RoundedFilled. view_list needs an
auto-mirrored filled pack. The outline SVGs this leaves unused are removed.

* Show a compact grid icon for the compact display modes

Compact and cover-only grids showed the same view_module icon as the
comfortable grid.

* Generate notification and layout drawables from Material Symbols

Notifications and XML layouts can't use ImageVectors, so they relied on
hand-kept copies of classic Material drawables. A build-logic task now
converts an opt-in list of the module's SVGs with AGP's Svg2Vector into
generated resources. sdk-common is taken from AGP's own dependency metadata,
so its version always matches AGP.

Compose call sites that only needed a drawable (tab close, crop) use the
ImageVectors instead. The icons module's R class must be imported as
MaterialSymbolsR, enforced by spotless, so it isn't mistaken for the app's R.

* Redraw custom icons in the Material Symbols style

The reading mode, crop off, mark previous as read and chapter download
icons were drawn in the classic style. They are rebuilt from Material
Symbols shapes (mobile_gear, mobile_arrow_right/down, crop,
arrow_circle_down, downloading) in a new custom-material-symbols module;
each SVG header lists where its parts come from. The default reading mode
and incognito use mobile_gear and eyeglasses_2 as they are.

ReadingMode holds an ImageVector now, and the module's R class follows the
same alias rule as MaterialSymbolsR.

* Use Material Symbols for the launcher shortcuts

Updates uses release_alert because the symbol named new_releases is now a
check badge.

* Rename the animated icon drawables

anim_*_enter no longer fits now that the icons play in both directions.
This is a pure rename so the following commits show only content changes.

* Use Material Symbols for the bottom navigation icons

The library, updates, history and browse animations are rebuilt from the
outline and filled symbols but keep their original motion: the white inside
is pushed into the ribbon, the "!" and the needle, and the history ring
still spins. Updates uses release_alert, like the shortcut. More already
matches more_horiz and is unchanged.

* Use rounded bars for the manga description caret

The animation is unchanged; the bars get rounded ends to match the
Material Symbols stroke.

* Settle the browse tab icon when selecting and deselecting

The compass turns a full turn and settles with overshoot both ways, instead
of deselecting by playing the select animation backwards. A
rememberAnimatedVectorPainter overload takes separate enter and exit
animations and doesn't animate on the first composition.
2026-10-09 17:50:12 +00:00
AntsyLich dd46413e10 List MangaBaka first among trackers 2026-10-09 19:16:42 +06:00
無字名3 ab7ee00c48 Fix tap navigation staying off after a cancelled button press (#3655)
Re-enable tap navigation after a cancelled button touch

A cancelled touch on a reader button (ACTION_CANCEL, e.g. the press turns
into a scroll) left tap navigation suppressed until the next press, so the
following tap did nothing.
2026-10-07 23:02:22 +06:00
AntsyLich fd4f73c908 Show a screen while the app migrates after an update 2026-10-07 22:22:32 +06:00
AntsyLich a6ee4bc596 Fix library range selection crash across categories 2026-10-07 19:59:52 +06:00
AntsyLich 6d4ed6cb22 Use the backport class loader for extensions before Android 17
ART maps app images compiled for the built-in DelegateLastClassLoader's class loader chain, and before Android 17 a damaged one crashes every launch until the app is updated.
2026-10-07 19:59:52 +06:00
AntsyLich 76b146f3d4 Show the updates widget's empty and locked text 2026-10-07 19:59:52 +06:00
AntsyLich 5910a51eb4 Keep the names of uninstalled sources across backup restores 2026-10-07 19:59:52 +06:00
AntsyLich 1e471a414c Stop updates showing a finished chapter as still downloading 2026-10-07 19:59:52 +06:00
AntsyLich 06d6128116 Let R8 shrink and optimize app code
Names stay as they are, since -dontobfuscate is unchanged. Injekt reads the injected type from the generic superclass of its type tokens, so those keep their Signature attribute.
2026-10-07 19:59:52 +06:00
AntsyLich 6a329386c2 Build a chapter's folder name variants from parts computed once 2026-10-07 19:59:52 +06:00
AntsyLich 179bfaca72 Load all tracks in one query for statistics 2026-10-07 19:59:52 +06:00
AntsyLich 5df78e305e Read the library's last read time without joining history to chapters
Migration 18 replaces libraryView, so the version code is bumped.
2026-10-07 19:59:51 +06:00
AntsyLich 940272f75a Load tracks in the library only for tracker filters and sorting 2026-10-07 19:59:51 +06:00
AntsyLich 7ff97761b9 Make MangaViewModel collect the entry only while subscribed 2026-10-07 19:59:51 +06:00
AntsyLich 9a6dea804d Stop polling queued downloads for their page list 2026-10-07 19:59:51 +06:00
AntsyLich fb8e640d69 Look up queued and downloaded chapters once per chapter list 2026-10-07 19:59:51 +06:00
AntsyLich 1f85a5a8db Share one cover load between rows that show it at the same time 2026-10-07 19:59:51 +06:00
AntsyLich 730e43fd14 Download a source's next chapter while the current one finishes
Downloader now runs one job per source, whose chapters share the source's page slots, so the next chapter starts as soon as the current one's last pages have a slot.
2026-10-07 19:59:51 +06:00
AntsyLich 61cd786e7f Use WAL on every device 2026-10-07 19:59:51 +06:00
AntsyLich 6490c41e63 Wait for a canceled downloader job to finish before starting another
Page writes block, so a canceled job could still be writing pages when the next one started on the same pages, leaving duplicate "(1)" files and failed chapters.
2026-10-07 01:15:18 +06:00
AntsyLich a5d584eeb0 Sanitize the scanlator in chapter download folder names
A "/" in the scanlator nested the chapter in a folder of its own, where the download was never found again. Names built from the unsanitized scanlator are still looked up.
2026-10-07 01:05:30 +06:00
AntsyLich f027de8c2e Look up library item sources and download counts once per library update 2026-10-07 01:05:30 +06:00
AntsyLich 7aacaa3490 Keep the paused download notification after the worker stops
The paused notification reused the download worker's foreground notification
id, so it was removed together with the foreground service when the worker
finished.

Closes #2791
2026-10-04 13:36:43 +06:00
AntsyLich f82a7a68f4 Build download error notifications fresh each time
The warning and error notifications shared one builder for the life of
the app, so an error kept the first notification's timestamp and the
previous warning's expanded text, auto cancel and timeout.

Closes #3341
2026-10-04 13:11:06 +06:00
AntsyLich d1c5c12bdd Fix webtoon reader leaving a gap after zooming in a resized window
The reader measured its height once, so zooming after a split screen or
window resize pinned it to the old size until the reader was reopened.

Closes #1721
2026-10-04 13:11:06 +06:00
Mend Renovate f35bc341ae Update dependency com.cheonjaeung.compose.grid:grid to v2.9.0 (#4041) 2026-10-04 12:06:42 +06:00
Mend Renovate a7a8cc8343 Update dependency com.mohamedrejeb.richeditor:richeditor-compose to v1.2.1 (#4030) 2026-10-04 11:55:19 +06:00
Chopper 4c88f02646 Fix race condition when updating search items in SearchViewModel (#4037) 2026-10-03 09:11:04 +00:00
Chopper a4780e4edb Use Dispatchers.IO.limitedParallelism in SearchViewModel to prevent thread leak (#4036) 2026-10-03 07:33:20 +00:00
AntsyLich db45dda525 Make CoroutineWorker supertypes have Worker suffix 2026-10-02 10:23:07 +06:00
AntsyLich 9abc830769 Rename Preference.enabled to visible to correctly reflect usage 2026-10-02 10:23:07 +06:00
AntsyLich 9409740d7e Let SliderPreference collect its own preference
Closes #3958

Assisted-by: Claude:claude-opus-5-5
2026-10-02 10:23:07 +06:00
AntsyLich 38e93086c8 Configure database connections like Room 2026-10-02 10:23:07 +06:00
AntsyLich 01d302febd Let DownloadJob own the downloader lifecycle
Assisted-by: Claude:claude-opus-5-5
2026-10-02 10:23:07 +06:00
AntsyLich 6dfa10ffac Ensure tachiyomix public API is not removed by R8
Fixes #4027
2026-10-02 10:23:07 +06:00
ChopperandAntsyLich f2464a1ba6 Add an option to disable the MD5 suffix in chapter names (#3966)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-10-02 03:31:38 +06:00
w 98ba693054 Bump webgpuviewer (#4029)
* Add crop for long strip

* Don't save all animation frames in memory

* Fix navigation

* Update libs.versions.toml
2026-10-02 03:30:24 +06:00
AntsyLich 972c9d43da Bump versionCode to 33 2026-10-01 01:17:41 +06:00
Mend Renovate 866d045c7a Update gradle/actions action to v6.4.0 (#4024) 2026-09-29 03:33:54 +06:00
w 65d7110e1e Remove libvips based imagedecoder and add progressive rendering (#4023) 2026-09-29 03:11:45 +06:00
AntsyLich 2d1d2e4cab Rework database queries for the new schema (#4022)
* query - category

Key every single-row statement on :id and list columns on one line. A
lookup by primary key no longer needs LIMIT 1, and resetting every
category's flags takes a value rather than a nullable nobody passed.

Assisted-by: Claude:claude-opus-5

* query - chapter

List columns in the table's order and name bind and mapper parameters
after the columns they fill. Inserts pass their arguments by name,
since reordering the columns put the upload and fetch dates side by
side with the same type.

With (manga_id, remote_url) unique, looking a chapter up by them no
longer needs LIMIT 1. Available scanlators come back distinct instead of
one row per chapter, which is all the only caller wanted. insert was
insertReturningId without the RETURNING, so restore uses the latter and
the former goes, along with the unused getChapterByUrl.

Inserting skips a chapter that a sync running alongside stored first,
rather than failing the whole batch and losing every new chapter of
that update.

Assisted-by: Claude:claude-opus-5

* query - excluded_scanlator

An entry excludes a scanlator at most once now. Inserting one that is
already excluded does nothing, so restoring a backup that lists one twice
drops the repeat instead of failing the entry, and restore no longer
reads the stored exclusions first to skip them itself.

Saving an unchanged selection no longer runs an empty delete, which
still made every chapter query run again.

Assisted-by: Claude:claude-opus-5

* query - extension_store

Take the upsert's new values from excluded and drop a WHERE its
conflict target already implies. That also retires a
`signing_key =: signingKey` that only parsed by accident.

Assisted-by: Claude:claude-opus-5

* query - history

Restoring an entry's history looked up the history row and, failing
that, the chapter for every item in the backup, one query each. It now
reads the entry's chapters and history once and matches them in memory,
which leaves getHistoryByChapterUrlAndMangaId without callers.

Creating a backup looked up the chapter of every history row one at a
time and failed on a row whose chapter was gone. It reads the entry's
chapters once and leaves such a row out.

The upsert takes its new values from excluded, drops a trailing WHERE
its conflict target already pins, and names its parameters after the
columns they fill.

Assisted-by: Claude:claude-opus-5

* query - manga

List columns in the table's order and name bind and mapper parameters
after the columns they fill, forwarding mapper arguments by name.

With (source_id, remote_url) unique, looking an entry up by them no
longer needs LIMIT 1, and fetching a network entry becomes a single
upsert that refreshes an existing row only while it is outside the
library, instead of an insert guarded by NOT EXISTS followed by an
update of the same row.

"Is anything read" checks use EXISTS rather than IN over a DISTINCT
subquery, category membership drops a coalesce on a column that is
never null, and the unused getAllManga goes. Applying the default
chapter flags to the library is one transaction instead of one per
entry, and restore checks backup entries against the stored urls as a
set rather than a list.

Assisted-by: Claude:claude-opus-5

* query - manga_category

An entry belongs to a category at most once now. Inserting a pairing
that already exists does nothing, so setting an entry's categories from
a list that names one twice no longer fails, which restore could produce
when two backup categories resolve to the same local one.

Assisted-by: Claude:claude-opus-5

* query - manga_track

List columns in the table's order and name bind and mapper parameters
after the columns they fill. That retires the sync-era :syncId,
:mediaId, :totalChapter and :trackingUrl.

Assisted-by: Claude:claude-opus-5

* query - source

List columns in the table's order and name the upsert's parameters
after its columns. The upsert takes the conflicting row's values from
excluded instead of rebinding them, and drops a WHERE its conflict
target already implies. The call passes its two string arguments by
name, since swapping them would still compile.

Assisted-by: Claude:claude-opus-5

* query - historyView

The latest read entry is read from the tables through the index on history's read time instead
of aggregating the whole view for one row: ~50ms to under 1ms on a 114k chapter library.

Assisted-by: Claude:claude-opus-5

* query - libraryView

List the columns like the other queries.

Assisted-by: Claude:claude-opus-5

* query - updatesView

Drop a coalesce on category_id, which is never null, from the queries
over updatesView, and the unused getRecentUpdates. The view definitions
themselves are unchanged, so no migration is needed.

The read and unread lookups become separate queries with the status
written into each. SQLite only uses a partial index when the query's own
condition matches it, which a bound parameter never does, so the unread
lookup the widget follows walked nearly the whole fetch date index,
~60ms each time on a 114k chapter library and after every chapter or
history write. With the status written in, it's served by the partial
index over unread chapters, ~8ms.

Assisted-by: Claude:claude-opus-5

* Query browse entries only while they are shown

Each loaded entry kept a live query for as long as the screen existed,
so every write to manga re-ran all of them. An entry now starts from the
row the listing stored and queries only while shown.

Assisted-by: Claude:claude-opus-5

* Read library selection categories from memory

The change category dialog and category updates read each selected
entry's categories from the loaded library instead of querying them one
at a time.

Assisted-by: Claude:claude-opus-5
2026-09-28 21:57:53 +06:00
AntsyLich 93cc075116 Tweak database table and view schema (#3805)
* Select explicit columns and name same-typed arguments

SQLDelight expands SELECT * using the table's column order and binds
mappers to it by position, so reordering columns would silently swap
mapper arguments. Queries list their columns instead. Calls whose
arguments share a type pass them by name, so swapping two still fails to
compile.

The generated code is unchanged apart from the SQL text.

* table - manga

Rebuild `mangas` as `manga` with a UNIQUE(source_id, remote_url) constraint,
`remote_`/`user_`/`state_` column prefixes and `_id` -> `id`. `remote_` is what the
source reported, `user_` is what the user set, `state_` is local bookkeeping that is
neither; `source_id` keeps its name because it identifies the source rather than
carrying its data.

Entries sharing a source and url are merged rather than dropped. The copies are ranked
with the ones in the library first, since that is the entry the user has, then by age.
The first one stays, takes each detail it is missing from the first copy that has it,
and absorbs the children of the rest. The duplicate chapters that repointing creates
are merged too, read state and history included.

The child tables keep pointing at the table this replaces until their own step rebuilds
them. Foreign keys are off for the whole migration, so nothing reads those clauses in
between, and copying every child table here just to rewrite one clause would double the
work the migration does. For the same reason the children resolve the surviving entry
while they are copied rather than being rewritten here first.

Merging entries is also what creates duplicate chapters and duplicate tracks, but each of
those is resolved in the step that rebuilds its own table, where the constraint that makes
the collision matter is introduced.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - chapter

Rebuild `chapters` as `chapter` with a UNIQUE(manga_id, remote_url) constraint,
`remote_`/`user_`/`state_` column prefixes and `_id` -> `id`.

The entries that merged in the previous step brought their chapters with them, so the
chapters move onto the surviving entry here and the duplicates that creates are merged:
the copy with reading history is kept, the oldest otherwise, and the read state and
history of the others are folded into it. It happens here rather than with the merge
because this is where the constraint that rejects the duplicates is introduced.

`chapters_manga_id_index`, `chapters_unread_by_manga_index` and `idx_chapters_url` go away:
the new unique constraint indexes `manga_id`, and the only url-only lookup has no callers.
The unread index served the updates view's read filter, but that view sorts by fetch date
and stops at a limit, which an index on `state_date_fetch` serves better with or without the
read filter, so that index takes its place. A second, partial one covers only the unread
chapters' fetch dates: most chapters in a library are read, so finding the unread ones
through the full index means walking nearly all of it.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - category

Rebuild `categories` as `category` with `_id` -> `id` and `sort` -> `order`, the name it
already had everywhere above the database. `order` gains a UNIQUE constraint, since two
categories sharing a position was never meaningful.

`sort` was never unique, and reordering wrote colliding values often enough that it cannot
simply be copied under the constraint. The migration renumbers the rows from 0 in the order
they were displayed, ties broken by id, and keeps the system category at -1.

`mangas_categories` is rebuilt in the migration only to point its foreign key at the new
table; it gets its real rebuild in its own step. Queries are only retargeted at the new
names; using the new structure is left to later changes.

Assisted-by: Claude:claude-opus-5

* table - manga_category

Rebuild `mangas_categories` as `manga_category`. The surrogate `_id` went unused, so the
pair becomes the identity with a UNIQUE(manga_id, category_id) constraint; duplicate
memberships were never meaningful. `idx_mangas_categories_manga_id` goes away because the
unique constraint already indexes `manga_id` as its leading column.

Entries merged in the manga step bring their memberships along. When the merged entry is
in the library, only the copies that were in it decide its categories, since a copy
outside the library can still hold the categories it had before it was removed.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - history

Rebuild `history` with `_id` -> `id`, `last_read` -> `read_at` and `time_read` ->
`read_duration`; the old names read as booleans rather than the timestamp and duration
they hold. `history_history_chapter_id_index` goes away because `chapter_id` is already
UNIQUE and therefore indexed.

A row also names the entry it belongs to now, not just the chapter. Reaching the entry
meant joining through the chapter every time, and the entry is the thing history is read
by. It is filled from the chapter it hangs off, and keyed to both: the entry first, then
the chapter. A row whose chapter is already gone cannot name an entry and is dropped,
which is what the foreign key would do to it once it is enforced again.

The table is the only one here that keeps its name, so the original is renamed aside and
the new one built under the real name. Building it beside the original and renaming it
into place makes SQLite rewrite the stored definition, which would leave this table
spelled differently from the same table on a fresh install.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - excluded_scanlator

Rebuild `excluded_scanlators` as `excluded_scanlator`, singular like the other tables.
The pair becomes the identity with a UNIQUE(manga_id, scanlator) constraint; excluding
the same scanlator twice for one entry was never meaningful.
`excluded_scanlators_manga_id_index` goes away because the unique constraint already
indexes `manga_id` as its leading column.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - manga_track

Rebuild `manga_sync` as `manga_track`: the table holds tracker entries, and nothing about
it is a sync. `_id` -> `id` and `sync_id` -> `tracker_id`, which is what it identifies.
`idx_manga_sync_manga_id` goes away because UNIQUE(manga_id, tracker_id) already indexes
`manga_id` as its leading column.

The constraint drops ON CONFLICT REPLACE and aborts like every other one. Replacing
deleted the row and inserted a new one under a new id, which lost anything keyed to the
old id, such as a queued tracking update, and it hid any other write that collided. The
insert now says what a conflict means: an existing track for the entry and tracker is
updated in place.

When entries merge, two rows for the same tracker can end up pointing at the survivor, so
the row to keep is chosen first: one on a copy in the library, then the one furthest read,
then the one on the copy ranked first, then the oldest. A track is taken whole rather than
merged field by field, because two rows on the same tracker can point at different remote
entries.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* table - source

Rebuild `sources` as `source` with `_id` -> `id` and `lang` -> `language`, spelled out
like every other column here.

Queries are only retargeted at the new names; using the new structure is left to later
changes.

Assisted-by: Claude:claude-opus-5

* view - updates

The view is the Kotlin-facing shape of a row, so its columns are named the way the
callers read them; `last_page_read` and `datefetch` were the only two that weren't.

The migration builds every view once at its end, so this updates that definition rather
than dropping and recreating it again. Queries are only retargeted at the new names;
using the new structure is left to later changes.

Assisted-by: Claude:claude-opus-5

* view - library

Bound the chapter and category aggregates to the library. Both subqueries group over
every chapter and every category membership in the database, and only the outer query
drops the entries that are not in the library, so an entry that was merely browsed still
pays for its chapters every time the library is read. The entries the view keeps are the
only ones whose aggregates it uses, so the same filter belongs inside them, where
`manga_user_favorite_at_index` can serve it.

The view returns the same rows either way. On a 560k chapter database holding 400 entries
among 4400, reading the library goes from ~156ms to ~23ms.

Assisted-by: Claude:claude-opus-5

* view - history

The view is the Kotlin-facing shape of a row, so its columns are named the way the
callers read them: `source` becomes `sourceId` and `state_cover_last_modified` loses the
prefix it only carried because the column it reads has one.

The migration builds every view once at its end, so this updates that definition rather
than dropping and recreating it again. Queries are only retargeted at the new names;
using the new structure is left to later changes.

Assisted-by: Claude:claude-opus-5
2026-09-28 21:44:11 +06:00
MajorTanyaandMitchell Syer ec614bb4c3 Use Apollo GraphQL for Trackers with GraphQL APIs (#3827)
* Add Apollo for GraphQL interactions

* Migrate AniList to use Apollo

* Migrate Shikimori to use Apollo

Not all Shikimori requests can be served by their GraphQL API (notably
they do not offer any mutations), so those remain as-is.

* Migrate Suwayomi to use Apollo

Includes leveraging some slightly newer Suwayomi features,
specifically the Double/Float filter fixes first pre-released in
2.1.1985 on 2025-10-26 and first fully released in 2.1.2100 on
2026-05-08.

Considering the tachiyomix 1.6 extension lib changes were added in
Suwayomi 2.3.2223 on 2026-06-30, I think it is fair to depend on such
sorta-recent behaviour.

* Fix temp migration names and leftovers

* Create ApolloResponse.dataOrElse extension

Because Apollo doesn't throw exceptions and instead just provides them
as response attributes, the current ApolloResponse.awaitSuccess() is
useless and will be removed shortly.

This new extension function should wrap the basic handling of an
ApolloResponse object neatly.

Co-authored-by: Mitchell Syer <6090655+Syer10@users.noreply.github.com>

* Use dataOrElse in AnilistApi.kt

* Use dataOrElse in ShikimoriApi.kt

* Use dataOrElse in SuwayomiApi.kt

* Delete obsolete ApolloCall.awaitSuccess

* Migrate Kitsu to use Apollo

Kitsu has some unfortunate edges in its GraphQL API (such as returning
nonstandard bodies which don't play well with Apollo) but this should
be an equivalent implementation.

* Extract a MangaFragment for AniList

This simplifies the queries and the converters (which can now delegate
to the MangaFragment.toTrackSearch() method internally and adjust the
track as needed).

Also move the toALUser converter to AnilistUtils.kt to keep all
converters together.

Added a scalar-mapper for AL's CountryCode type.

* Minor consistency cleanup of the queries

* Store list entry ID not title ID for Shikimori

* Extract common MangaFragment for Shikimori

Also map the ISO8601Date to a Kotlin String in the service config.

* Map Kitsu's ISO8601DateTime to kotlin.time.Instant

Utilises Apollo's own adapter-core library which provides the mapper.

Requires opting in to ExperimentalTime until the library resolves the
outdated annotation.

Co-authored-by: Mitchell Syer <6090655+Syer10@users.noreply.github.com>

* Replace Kitsu TODO comment

So much for STOPSHIP preventing me shipping this...

* Bump Apollo version to 5.1.0

* Bump apollo-adapters-core to 0.8.0

Freshly released just earlier.
This resolves having to opt in to ExperimentalTime.

* Make new utils internal to align with #3908

* Fix leftover issues from merged #3828

This PR restructured the AniList and Kitsu user objects.

* Bump apollo to 5.2.0

* Remove unused attributes from queries

* Allow custom exception handler in dataOrElse

Enables callers to manually handle specific non-200 responses.

Callers MUST close the `ApolloHttpException.body` attached to the
passed exception to avoid resource and socket leaks.

Defaults to current behaviour of (re)throwing the status code with our
HttpException.

Utilized in KitsuApi.kt to specially handle Kitsu sending a 500 error
response when deleting library IDs not actually in a user's library
and falling back to the "throw as HttpException" if it's any other
error response.

* Rethrow networking/IO exceptions

This helps to avoid masking networking problems as "This isn't in your
list" problems.

Currently, the app shows "Failed to connect to ..." when the remote
server is unreachable (e.g. downtime, DNS block, etc) because that's
the message provided by the ConnectException thrown by Android's
network stack.

This change restores that behaviour, approximately.

Not the most elegant solution but it _should_ avoid false-positive
toasts.

---------

Co-authored-by: Mitchell Syer <6090655+Syer10@users.noreply.github.com>
2026-09-28 10:34:26 +06:00
Mend Renovate 59fdf7e7fa Update dependency androidx.work:work-runtime to v2.12.0 (#4015) 2026-09-28 08:55:38 +06:00
Mend Renovate 7451c228e6 Update Gradle to v9.8.0 (#4016) 2026-09-28 08:55:25 +06:00
AntsyLich 9b5e0ae735 Show an extension's store and install failures in the extension list (#3955) 2026-09-28 08:55:09 +06:00
Mend Renovate 7f4c55176f Update dependency androidx.annotation:annotation to v1.11.0 (#4014) 2026-09-28 08:39:33 +06:00
Mend Renovate 9b4c3115db Update spotless to v8.10.3 (#4013) 2026-09-28 08:39:19 +06:00
Mend Renovate f835398094 Update metro to v1.4.5 (#4012) 2026-09-28 08:39:08 +06:00
Mend Renovate 3542143b40 Update dependency androidx.webkit:webkit to v1.17.1 (#4011) 2026-09-28 08:38:55 +06:00
Mend Renovate ba4c04fe74 Update dependency androidx.core:core to v1.19.1 (#4010) 2026-09-28 08:38:41 +06:00
Mend Renovate 087e38ad47 Update dependency androidx.compose:compose-bom-alpha to v2026.09.01 (#4009) 2026-09-28 08:38:29 +06:00
AntsyLich 09edf7dc8d Keep an installed extension's store current as stores change
Extensions only reload when the set of signing keys changes, so one could keep a store that was removed while another with the same key stayed, or a store's old name. The manager now reassigns each installed extension's store whenever the stores change.
2026-09-28 00:52:24 +06:00
AntsyLich 4f33486aa4 Clean up extension update checking
ExtensionApi only wrapped the store repository and the launch check, which matched updates again on its own. The manager now fetches listings and checks for updates itself with the statuses it already keeps, so the check covers not-loaded extensions and keeps the Extensions tab current from launch. Statuses are derived in one place, and the extension list is split before it's sorted instead of sorted twice.
2026-09-28 00:48:03 +06:00
AntsyLich 2d86a70ce2 Offer updates for extensions that aren't loaded
Extensions that aren't loaded now get updates like loaded ones, which is often what gets them loaded again. They're counted, notified and listed with the other pending updates. Every installed extension, loaded or not, records the added store whose key signed it when it loads.
2026-09-28 00:46:54 +06:00
AntsyLich 0938411053 Install and update extensions only from a store whose signing key matches
Updates come only from stores whose key the installed extension is signed with, the highest version among them. A downloaded apk must be signed with its store's key before it's installed.
2026-09-27 23:41:21 +06:00
AntsyLich ed17ece4e3 Return an entry's categories in display order
An entry's categories came back in whatever order SQLite found them. They're now ordered by position, the same order the library and the category list show.
2026-09-27 23:10:36 +06:00
AntsyLich b74e010bfe Order updates by fetch date in the queries themselves
The updates queries relied on the view's ORDER BY surviving into the query that reads from it, which SQLite doesn't promise. Each now orders by fetch date itself.
2026-09-27 23:10:14 +06:00
AntsyLich 4b48a84ec9 Keep a stored track's remote entry when restoring
Restoring over an existing track took the backup's remote id and library id but kept the stored url and title, pairing one remote entry's id with another's details. The stored track now wins like the rest of an entry's stored data, and the backup only moves its last chapter read forward.
2026-09-27 23:09:32 +06:00
AntsyLich 9a77baedcc Update an existing track in place instead of replacing it
Upserting a track for an entry and tracker that already have one updates that row, instead of the table's REPLACE deleting it and inserting a new one under a new id. Anything keyed to the old id, such as a queued tracking update, keeps working. The query, repository methods and interactor are renamed from insert to upsert to say so.
2026-09-27 23:02:26 +06:00
AntsyLich 2b4b8472bb Open a requested chapter in the reader even if its scanlator is excluded by filter
The reader builds its chapter list with excluded scanlators filtered out, so a chapter opened directly (from a deep link or a notification) whose scanlator is excluded wasn't in the list and failed to open. The requested chapter is now added back when the filter removed it.
2026-09-27 22:56:42 +06:00
AntsyLich 553762fae8 Fix reading history being double counted
Restore groups a backup's history entries by chapter before comparing them with the stored row, so a backup carrying one entry per copy of a duplicated chapter no longer adds its reading time more than once or moves the last read backwards. A removed history entry keeps its 0 instead of becoming NULL, a tracker's start date skips removed history, and the reader clears a session's start time before saving it, so overlapping saves can't count it twice.
2026-09-27 22:55:41 +06:00
AntsyLich 8bfa495f34 Assign category positions inside the database
A new category's position is computed by its insert, one after the highest, so two categories created at once can't take the same one. Inserts take a NewCategory rather than a Category whose id and position would be ignored. Reordering places any category missing from the given order after the rest instead of leaving it at a stale position. Restore still creates missing categories all or none, in backup order, and the create dialog no longer accepts an empty name.
2026-09-27 22:53:09 +06:00
AntsyLich fc5592ff75 Don't bring back extension stores removed during a refresh
A store's refreshed details are written only if the store still exists when its fetch returns, so one removed while its index was loading stays removed. The unused get query becomes contains.
2026-09-27 22:44:15 +06:00
AntsyLich 0044cc73ec Fix stored stub sources not loading and being rewritten on every reload
Stub sources loaded from the database were written into a throwaway copy of the map, so they never reached the source manager. StubSource also becomes a data class, so a stored one compares equal to the same source again and isn't rewritten on every reload.
2026-09-27 22:43:48 +06:00
AntsyLich 6ee529c5aa Apply chapter sync in one transaction
A chapter sync's removals, inserts and updates go through one ChapterRepository.updateFromRemote call, applied atomically. A failure no longer leaves some of a sync's changes written and others missing. Restore folds duplicate chapters in a backup into one before writing, and the chapter deep link looks up the synced chapter afterwards rather than relying on the sync's return value.
2026-09-27 22:41:55 +06:00
AntsyLich 4df0e6b168 Keep category orders unique while reordering
Reordering first moves every category to a temporary negative position, then assigns the final ones, so two categories never share a position mid-update. Deleting a category no longer renumbers the system category.
2026-09-27 22:37:39 +06:00
AntsyLich 986f46c09a Merge manga favorite related fields into favorite_at
Migration 16 replaces favorite, date_added and favorite_modified_at with one nullable favorite_at. A favorite whose date_added is 0 falls back to favorite_modified_at. Manga.favorite and dateAdded become getters derived from it, and restore merges it by taking the earliest non-zero time.
2026-09-27 22:37:02 +06:00
AntsyLich f8fff318ba Build manga and chapter updates with a lambda and track assigned fields
MangaUpdate and ChapterUpdate are built with a lambda that records which fields were assigned, so an update writes only those fields.
2026-09-27 22:36:13 +06:00
AntsyLich 306befb214 Restrict raw database access to the data module
app no longer touches the database directly. Backup restore's queries move into a new RestoreRepository in :data, which restores a batch of entries all or nothing, stopping between entries if cancelled, as before. The remaining direct calls (excluded scanlators, clear database, backup creation, store and category restore) go through their repositories, and the database bindings move from AppBindings into :data.
2026-09-27 22:30:51 +06:00
AntsyLich a4abb6292b Split the universal update queries into case-specific ones
Source-owned fields move out of MangaUpdate/ChapterUpdate into MangaRemoteUpdate/ChapterRemoteUpdate, which only UpdateMangaFromRemote and SyncChaptersWithSource write. Backup restore gets its own updateFromBackup queries for entries and chapters, writing only what a backup carries.
2026-09-27 21:50:38 +06:00
AntsyLich c67a33f3d4 Remove unused sync scaffold
Drops the unused version, is_syncing and last_modified_at columns and their triggers.
2026-09-27 21:47:12 +06:00
Secozzi 532575e29e Fixed entries being incorrectly marked as duplicates when tracked with some trackers (#4008)
If a tracker doesn't set `remote_id`, it defaults to 0 so comparing entries based on `remote_id` when it's 0 doesn't make sense
2026-09-26 22:53:32 +06:00
Chopper f52d890e7f Fix library search when clicking source name in manga info screen (#4002) 2026-09-22 18:10:12 +06:00
449c4e08e7 Translations update from Hosted Weblate (#3987)
* Translated using Weblate (Catalan)

Currently translated at 100.0% (958 of 958 strings)

Translation: Mihon/Mihon
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ca/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (958 of 958 strings)

Translation: Mihon/Mihon
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (958 of 958 strings)

Translation: Mihon/Mihon
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/

---------

Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: nay nai <naynaimiaonai@gmail.com>
2026-09-20 21:33:11 +06:00
Mend RenovateandAntsyLich 57666e9207 Update sqldelight to v2.4.0 (#3985)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-09-20 15:19:59 +00:00
Mend Renovate 73fef961e9 Update dependency me.zhanghai.android.libarchive:library to v1.1.7 (#3983) 2026-09-20 15:04:35 +00:00
AntsyLich 93a163f96e Only upload Crashlytics mapping file when building for release 2026-09-20 19:56:59 +06:00
AntsyLich 61680580dd Simplify build flags setup with distribution profile 2026-09-20 19:46:27 +06:00
AntsyLich 0de91a9c53 Remove redundant dimens.xm in :app 2026-09-20 16:36:15 +06:00
AntsyLich 2c979d2d32 Enable android.nonTransitiveRClass 2026-09-20 16:32:33 +06:00
AntsyLich 2b9cb4ca5a Refactor GenerateLocalesConfigTask to run when string files updates 2026-09-20 04:58:39 +06:00
AntsyLich 427e105840 Enable Gradle isolated projects 2026-09-20 04:58:39 +06:00
AntsyLich 12fbb13df5 Enable Gradle configuration cache 2026-09-20 04:58:38 +06:00
AntsyLich c69b14c975 Bump compileSdk to 37.2 2026-09-20 04:58:38 +06:00
AntsyLich debab6c261 Enable Gradle Tooling parallelism explicitly
Android Studio disables the backward compatibility that Gradle has for Tooling parallelism https://cs.android.com/search?q=org.gradle.tooling.parallel.ignore-legacy-default%3Dtrue&sq=
2026-09-20 04:58:38 +06:00
Mend Renovate 424bbc53b8 Update coil to v3.6.3 (#3979) 2026-09-20 03:45:51 +06:00
Mend Renovate 71cd94a31d Update dependency ubuntu to v26 (#3986) 2026-09-20 01:11:12 +06:00
MajorTanya 01e3f8c605 Add refresh button to tracker for new profile info (#3828)
* Add refresh button to tracker for new profile info

As-is, allows a user to manually refresh their current user data from
the tracker in order to update Mihon's knowledge of remote settings
(e.g. nickname changes, AL/MB/Kitsu score types, etc.).

* Catch errors to prevent app crashing

Surfaces errors as toasts in the same way library title refreshes do.

* spotless

* [skip ci] Remove leftover debugging logs

* Fix Kitsu user attribute access

* Spotless

* Lowercase Kitsu score type on refresh

Maybe prevent needing another #3887 for this.

* Center tracker vertically name if not logged in

Looks much better than the name being stuck at the top with empty
space below it.

* Don't show Refresh button for Enhanced trackers

* [skip ci] Add changelog entry
2026-09-20 00:35:25 +06:00
Mend Renovate 504ec2afae Update android.gradle to v9.4.1 (#3982) 2026-09-19 16:49:32 +00:00
hosted-weblate[bot]andMajorTanya 385d076d43 Translations update from Hosted Weblate (#3972)
Translated using Weblate (German)

Currently translated at 99.2% (948 of 955 strings)

Translation: Mihon/Mihon
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/

Co-authored-by: MajorTanya <github@majortanya.eu>
2026-09-19 22:39:45 +06:00
Mend Renovate 5848ffb4c4 Update metro to v1.4.4 (#3973) 2026-09-17 13:37:56 +06:00
+13 51efde975b Translations update from Hosted Weblate (#3950)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/am/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/bg/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ca/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ceb/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/cv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/da/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/eu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/gl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/hi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/hu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/it/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/jv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ka/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/kk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/km/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/kn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/lt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/lv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ml/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/mr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/nn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/pl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/pt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sah/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sc/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sdh/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sq/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/te/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/th/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/uk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/uz/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/am/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ar/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/as/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/az/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/be/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/bg/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ca/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ceb/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/da/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/el/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/es/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/gl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/id/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/it/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/jv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ka/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/km/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kmr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/lt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/lv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ml/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/mr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ms/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/my/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ro/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sah/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sc/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sdh/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sq/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ta/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/te/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/th/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/uk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/uz/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hant/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: AntsyLich <antsylich@gmail.com>
Co-authored-by: Arash <ara.khoram95@gmail.com>
Co-authored-by: Arif Budiman <arifpedia@gmail.com>
Co-authored-by: David Katrinka <davidkatrinka1995@gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Eduard Ereza Martínez <eduard@ereza.cat>
Co-authored-by: Giuseppe Ventrone <ventrone524@gmail.com>
Co-authored-by: Horace Johnson <horacejohnson99@gmail.com>
Co-authored-by: Infy Milliaria <ced.paltep10@gmail.com>
Co-authored-by: KING APPS <kiperking1@gmail.com>
Co-authored-by: KraXen <dpelech1@gmail.com>
Co-authored-by: Lucas Correia <anicetoclucas@gmail.com>
Co-authored-by: Lyfja <45209212+lyfja@users.noreply.github.com>
Co-authored-by: Szafranek13 <jakubfabijan@tuta.io>
Co-authored-by: Throw Away <throwawayacc4gulshan@gmail.com>
Co-authored-by: abc0922001 <abc0922001@hotmail.com>
Co-authored-by: icarus suraci <mhmtylmz112000@gmail.com>
Co-authored-by: nadevko <me+oss@nadevko.cc>
Co-authored-by: on9686 <on9686@users.noreply.hosted.weblate.org>
2026-09-16 23:59:22 +06:00
MajorTanya 1e142c4255 Fix padded year & 31-clamped month in local source (#3970) 2026-09-16 23:56:27 +06:00
MajorTanya a7179805ad Use & write Year, Month, Day info in ComicInfo (#3967)
* Use & write Year, Month, Day info in ComicInfo

Currently, users can only modify the date Mihon displays in the
chapter list by manipulating the _last modified date_ of the file.
This is obviously inconvenient, especially since the ComicInfo spec
includes Year, Month, and Day fields for this exact purpose.

If present, this reads the date at start of day in the current default
system time zone (which matches how we use Chapter.dateUpload with
relativeDateText, for example).

If Year is not specified, the entire date process is skipped.
If Month is not specified, it is set to January.
If Day is not specified, it is set to the first.

The parsed date (if any) is set as the Chapter's `date_upload` which
is used for display in the app.

Additionally, Mihon now includes this info in the written
ComicInfo.xml file for downloaded chapters. This will be convenient
for many more users, not least of which those who move
source-downloaded chapters to Local Source to read from there.

---

I used kotlinx.datetime because it's what we use for date parsing in
non-i18n places already.

* Changelog
2026-09-16 08:23:25 +06:00
AntsyLich 1c43addeca Resolve Injekt dependencies directly from the Metro graph (#3965)
The previous setup had a circular dependency between Injekt
registration and extension loading.

In regard to #3931, I've moved the culprit ExtensionManager out of
Injekt altogether, alongside CoverCache, PreferenceStore and
TrackPreferences, none of which a source needs.
2026-09-15 15:57:48 +06:00
MajorTanya b2cda03e3a Use modern OpenDocument for backup file selection (#3948)
This might also fix the underlying problem of #3947.

I don't have any nonstandard devices available, but this works fine
in an A17 Pixel emulator & on my A14 Xiaomi device.

Looks like the GetContent approach was merely carried over from older
code without being updated to the more modern OpenDocument contract.
2026-09-15 02:20:09 +06:00
AntsyLich fdc2d40a1d Reload extensions when relevant settings are updated (#3954) 2026-09-14 22:41:53 +06:00
AntsyLich e6d8efe6f8 Expose installed extensions that failed to load (#3953) 2026-09-14 21:34:55 +06:00
AntsyLich 0e0bc6972a Allow user to load installed extensions regardless of content warning (#3952) 2026-09-14 21:22:32 +06:00
w a5cd541bdf webgpuviewer: Fix menu hiding when navigating in long strip (#3956) 2026-09-14 21:01:27 +06:00
AntsyLich 0fbaa1ecec Replace extension NSFW flag with content warning app-wide (#3951) 2026-09-14 15:00:06 +00:00
+21 cbafe9bf3f Translations update from Hosted Weblate (#3938)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/am/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/be/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/bg/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ca/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ceb/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/cv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/da/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/eu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/gl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/hi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/hu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/it/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/jv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ka/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/kk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/km/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/kn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/lt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/lv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ml/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/mr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/nn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/pl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/pt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sah/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sc/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sdh/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sq/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/te/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/th/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/uk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/uz/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/am/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ar/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/as/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/az/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/be/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/bg/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ca/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ceb/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/da/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/el/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/es/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/gl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hu/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/id/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/it/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/jv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ka/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/km/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kmr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/lt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/lv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ml/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/mr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ms/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/my/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nb_NO/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ro/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sa/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sah/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sc/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sdh/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sq/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ta/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/te/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/th/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/uk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/uz/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hant/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: A <ogloppi@mailbox.org>
Co-authored-by: Ajeje Brazorf <lmelonimamo@yahoo.it>
Co-authored-by: Akhil Raj <89210430+akhi07rx@users.noreply.github.com>
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Arash <ara.khoram95@gmail.com>
Co-authored-by: B4LiN7 <87660017+B4LiN7@users.noreply.github.com>
Co-authored-by: Crazyom <naxom@laposte.net>
Co-authored-by: David Katrinka <davidkatrinka1995@gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: FateXBlood <fatexblood@gmail.com>
Co-authored-by: Federico Pierantoni <federico.pieranton@gmail.com>
Co-authored-by: Frosted <frosted@users.noreply.hosted.weblate.org>
Co-authored-by: Horace Johnson <horacejohnson99@gmail.com>
Co-authored-by: Infy Milliaria <ced.paltep10@gmail.com>
Co-authored-by: KraXen <dpelech1@gmail.com>
Co-authored-by: Lucas Correia <anicetoclucas@gmail.com>
Co-authored-by: Lyfja <45209212+lyfja@users.noreply.github.com>
Co-authored-by: Matyáš Caras <matyas@caras.wtf>
Co-authored-by: Paweł Waresiak <pwaresia@redhat.com>
Co-authored-by: Romb38 <r.barbier38@gmail.com>
Co-authored-by: Saft Octavian <saftoctavian@gmail.com>
Co-authored-by: Throw Away <throwawayacc4gulshan@gmail.com>
Co-authored-by: ZerOriSama <godarms2010@live.com>
Co-authored-by: abc0922001 <abc0922001@hotmail.com>
Co-authored-by: icarus suraci <mhmtylmz112000@gmail.com>
Co-authored-by: kevans <albapazpi@gmail.com>
Co-authored-by: nadevko <me@nadevko.cc>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: stevenlele <stevenlele@outlook.com>
2026-09-14 03:39:36 +06:00
w 7418f4e7bc Bump webgpuviewer (#3949)
* Continuous background color

* Use ImageDecoder instead of Kim

* Only get tag when in dual mode

* Update libs.versions.toml

* Make progress circle smaller and animate progress

* Fix long strip showing the menu at ends
2026-09-14 03:38:00 +06:00
MajorTanya 2d1a8bbeff Tighten AniList rate limit (#3942)
https://docs.anilist.co/guide/rate-limiting
2026-09-12 19:54:10 +00:00
AntsyLich 60e74b8d8f Don't try to create slider state when slider can't or won't be rendered (#3941) 2026-09-12 22:34:39 +06:00
Mend RenovateandAntsyLich 6ef6e81814 Update dependency com.google.android.material:material to v1.14.0 (#3226)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-09-12 18:23:14 +06:00
Mend RenovateandAntsyLich 855918bbf4 Update dependency androidx.compose:compose-bom-alpha to v2026.09.00 (#3752)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-09-12 18:21:37 +06:00
Mend RenovateandAntsyLich 6c6eff3ab8 Update markdown to v0.45.0 (#3806)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-09-12 18:21:24 +06:00
AntsyLich d435dd9217 Switch to upstream Injekt
The patch is redundant given we switched to Metro DI and don't use `Injekt.addSingletonFactory` anymore
2026-09-12 16:04:58 +06:00
AntsyLich f7da5c856a Switch to upstream sqldelight-androidx-driver
The deadlock issue should be fixed upstream
2026-09-12 16:03:50 +06:00
AntsyLich 737fdbfbf0 Switch to upstream FlexibleAdapter
Closes #3932

Upstream published to Maven Central
2026-09-12 16:03:50 +06:00
AntsyLich 802958b1ea Bump compileSdk to 37.1 2026-09-12 15:28:40 +06:00
Mend Renovate 2292554d97 Update dependency de.stefan-oltmann:kim to v0.40.0 (#3937) 2026-09-12 08:22:15 +00:00
Mend Renovate 918cfb3dda Update dependency androidx.benchmark:benchmark-macro-junit4 to v1.5.0 (#3936) 2026-09-12 08:20:37 +00:00
Mend Renovate 5de262675a Update dependency io.kotest:kotest-assertions-core to v6.2.5 (#3935) 2026-09-12 14:11:48 +06:00
Mend Renovate 9f480564c2 Update dependency androidx.baselineprofile to v1.5.0 (#3934) 2026-09-12 14:10:54 +06:00
w d17ad1e002 Bump webgpuviewer (#3933)
* add disable zoom out

* add hdr

* Fix dual mode page progress and cleanup

* webgpu viewer add page gap setting

* Update libs.versions.toml
2026-09-12 11:57:02 +06:00
MajorTanya 1e054ea14d Fix inverted MAL OAuth expiry check logic (#3927) 2026-09-10 16:28:53 +00:00
Mend Renovate 5f87f7e054 Update dependency androidx.sqlite:sqlite-bundled to v2.7.1 (#3916) 2026-09-10 14:38:45 +06:00
Mend RenovateandAntsyLich a5260487d3 Update metro to v1.4.3 (#3918)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-09-09 22:38:45 +00:00
Mend Renovate 0ce6f22cf5 Update kotlin monorepo to v2.4.20 (#3917) 2026-09-09 22:36:04 +00:00
Darkphoenix 35bb84705e Fix GPU texture leak when a decoded page is no longer usable (#3872) 2026-09-09 22:22:36 +00:00
Mend Renovate e32231eeaa Update dependency com.google.firebase:firebase-bom to v34.19.0 (#3915) 2026-09-09 21:55:02 +00:00
Mend Renovate d0ee514044 Update GitHub Actions (#3892) 2026-09-09 21:54:27 +00:00
Mend Renovate 44a9d96e90 Update dependency de.stefan-oltmann:kim to v0.39.1 (#3890) 2026-09-09 21:51:24 +00:00
Mend Renovate 3f845c12c8 Update android.gradle to v9.4.0 (#3893) 2026-09-10 03:44:43 +06:00
Mend Renovate 6c0fa3a043 Update spotless to v8.10.2 (#3895) 2026-09-10 03:43:19 +06:00
Mend Renovate 2810dd14c4 Update dependency com.mohamedrejeb.richeditor:richeditor-compose to v1.2.0 (#3896) 2026-09-10 03:41:54 +06:00
MajorTanya aebf11a749 Make tracker utils package-internal (#3908)
It gets really annoying to use any of them when they have name
collisions. Especially extensions on Track or basic public functions.

Also make some same-file extension function in the MangaUpdates
package method on the class they extended.

I would have done the same for the DTOs themselves but any that are
used on method signatures have to be public and then all their members
also have to be public. We'd end up with a confusing mess of some
internal and some public DTOs, even at the top level (since generics
can be internal to the `dto` package (e.g. with parseAs<...>) but
return annotations cannot be).
2026-09-08 11:26:21 +06:00
Mend Renovate 3a64c8d65c Update dependency com.squareup.okio:okio to v3.18.2 (#3894) 2026-09-06 21:38:09 +06:00
Mend Renovate f7cd820f2f Update dependency org.conscrypt:conscrypt-android to v2.7.0 (#3897) 2026-09-06 21:33:17 +06:00
Secozzi 5b69dbad81 Fix default category and manga sometimes not having their category restored (#3891) 2026-09-06 21:32:38 +06:00
Secozzi a82baac3ef Fixed crash caused by incorrect handling of kitsu score type from login (#3887)
* track/kitsu: Fixed crash caused by incorrect handling of score type from login

* revert changelog

* turn into lowercase when accessing map
2026-09-06 21:30:38 +06:00
MajorTanya 5e99306e5f Minor tracking refactors (#3900)
* Make tracker Api classes take their tracker's ID

Also made the name consistently `trackerId` since `trackId` can be
confusing in the context of Tracks that also carry several IDs.

Also made the public constants in TrackerManager entirely redundant,
so trackers are all equally getting their ID defined in their
constructor call now.

* Explicitly mark unused Exceptions as such

* Make isExpired method of BGMOAuth data class

As opposed to an extension defined in the same file

* Kavita: thumbnail_url -> thumbnailUrl

With a SerialName annotation of course

* Suwayomi: Remove redundant with(json)

Both of these requests don't use parseAs so this not required.

* Bangumi: Don't recreate OAuth object for storing

* Remove unused attribute from tracker OAuth classes

Mostly `token_type`.
Also removed `user_id` from BGMOAuth and `scope` & `expiresIn` from
MangaBakaOAuth (which already provides `expiresAt`).

* Use kotlin.time durations for token expiry math

Something like `Clock.System.now().plus(1.hours)` is much easier to
read than `System.getEpochMillis() + 3600`.

Also lets us use the `epochSeconds` attribute where the given
timestamps are seconds-resolution.

* Bangumi: Remove redundant apply block

* Kavita: Misc simplifications

* Use parseAs in tracker interceptors

* MAL: Use existing setAuth to store refresh token
2026-09-06 21:26:33 +06:00
Mend Renovate 3acd7eaca9 Update coil to v3.6.2 (#3889) 2026-09-04 15:18:23 +00:00
w f3125ab897 Bump webgpuviewer (#3886)
* Add continuous min width

* Add dual page flip transition, separate some dual config

* Fix progress on sides for dual

* re-organize and minor fixes

* Reverse pan when vertical and zoom start right

* add flip to single

* Simple page size heuristics for dual selection

* zoom minimum wideness

* Fix continuous page progress

* continuous dynamic cache size

* Update libs.versions.toml
2026-09-04 21:18:18 +06:00
MajorTanya 21af65b100 Fix unhelpful generic 401 error on AniList expiry (#3888)
A leftover of what I assume was the v1 API behaviour handling manually
multiplied the `expires` values by 1,000, supposedly to make it a
millisecond value. However, AL tokens have been saved as milliseconds
since at least the v2 API implementation in 2018, so this has made
every expiry comparison ludicrously impossible.

Example:
millisecond timestamp:
1788529931115 (2026-09-04T13:52:11.115Z)
*1,000
1788529931115000 (+58646-04-04T21:45:15Z)

So any expiry comparisons would say "yes this token is still totally
valid", causing Mihon to send expired credentials and AL to respond
with a 401.

With these changes (which include some loosely associated clean-up),
we now correctly identify expired credentials before we attempt any AL
requests & actually show a toast with the "Token expired." error
message for the first time in 8 years or so?

I was able to keep the new ALOAuth shape compatible with
already-serialized data, though whenever a user (re-)links AL from now
on, both the `token_type` and `expiresIn` fields won't exist any more.
Since they had no use in the current code anyway, I don't consider
this a problem.

I took the liberty of adding basic instructions to the error message
but these can't be i18n'd properly so I kept it short and sweet.

---

Side effect of expired credentials is Mihon erasing the token in
storage, meaning AL disappears from the tracker sheet until re-linked.
I would say this is acceptable, but we might see panicked users in
support saying "Mihon deleted my AL links" or something.
2026-09-04 21:07:05 +06:00
천재웅 056d9baeeb Migrate composeGrid to new group ID (#3877) 2026-08-30 17:45:42 +00:00
MajorTanya baad5c59bb Clean up some missed unused imports (#3876) 2026-08-30 23:43:36 +06:00
AntsyLich 34a33ed4f8 Use filled icon for library continue reading button 2026-08-30 23:30:28 +06:00
AntsyLich 7f342ca076 Use built-in DelegateLastClassLoader for extensions (#3874)
Assisted-by: Claude:claude-opus-5
2026-08-29 16:07:51 +00:00
AntsyLich b695940114 Switch to Material Symbols and use Valkyrie for ImageVector generation (#3873)
* Add material symbols icon module

Assisted-by: Claude:claude-opus-5

* Replace material icons with material symbols

Assisted-by: Claude:claude-opus-5

* Add simple icons module and migrate CustomIcons

Assisted-by: Claude:claude-opus-5
2026-08-29 21:39:55 +06:00
w bb24e904a9 Bump webgpuviewer, fix navigation directions and long strip bounds (#3870)
* Keep previous page when jumping pages

* Fix navigation directions

* fix continuous jump after navigate

* webgpuviewer config

* Fade in loaded pages

* async onPageChange

* Update libs.versions.toml
2026-08-28 17:42:37 +00:00
AntsyLich 5fadea61e7 Make the source manager surface suspend (#3869)
Assisted-by: Claude:claude-opus-5
2026-08-28 23:36:28 +06:00
Mend Renovate c1d1f6b161 Update aboutLibraries to v15.2.0 (#3866) 2026-08-28 13:17:32 +00:00
Mend Renovate ff3dedb6d8 Update dependency androidx.glance:glance-appwidget to v1.2.0 (#3867) 2026-08-28 13:14:56 +00:00
Mend Renovate 7b41ebf8fe Update spotless to v8.10.1 (#3865) 2026-08-28 13:08:34 +00:00
Mend Renovate 161617b95d Update dependency de.stefan-oltmann:kim to v0.38.1 (#3862) 2026-08-28 13:06:57 +00:00
Mend Renovate 1512ca63d7 Update dependency com.materialkolor:material-kolor to v5.0.1 (#3864) 2026-08-28 13:06:44 +00:00
Mend Renovate 6cfce8d425 Update actions/setup-java action to v6 (#3861) 2026-08-28 18:55:10 +06:00
Mend Renovate 2776e3edda Update dependency androidx.baselineprofile to v1.5.0-rc02 (#3856) 2026-08-28 18:54:10 +06:00
Mend Renovate 7847cad0f4 Update coil to v3.6.0 (#3860) 2026-08-28 18:53:21 +06:00
Mend Renovate deb7b33118 Update dependency org.jsoup:jsoup to v1.23.2 (#3854) 2026-08-26 13:37:50 +00:00
Mend Renovate 3f56685e0c Update android.gradle to v9.3.2 (#3853) 2026-08-26 13:37:43 +00:00
w 0854bde12e Bump webgpuviewer, imagedecoder, fixes (#3852)
* Bump webgpuviewer, imagedecoder, fixes

Render transition page using text renderer
Fix progress page in dual
Fix animations in dual
Re-do crop bounds

* Fix navigation buttons and zoom start

* Update libs.versions.toml
2026-08-26 19:24:32 +06:00
tigeryu8900 ac249e3668 Exit early in CloudflareInterceptor when cloudflare challenge is interactive (#3842) 2026-08-23 10:50:31 +00:00
w e3813028bd Bump webgpuviewer, fix animated images background color (#3843) 2026-08-23 14:06:12 +06:00
AntsyLich 270b78ba95 Wait for extensions to load before the list is propagated (#3841) 2026-08-22 20:37:01 +00:00
AntsyLich 46c8f07c12 Limit vertical divider height in global search toolbar (#3839) 2026-08-22 19:56:26 +00:00
AntsyLich a2c24ff042 Use upstream scaffold (#3834) 2026-08-22 02:22:45 +00:00
Mend Renovate 9ec479266b Update aboutLibraries to v15.1.1 (#3831) 2026-08-21 22:58:06 +00:00
Mend Renovate 6458246180 Update dependency org.conscrypt:conscrypt-android to v2.6.3 (#3832) 2026-08-21 22:56:42 +00:00
MajorTanya 31d3c23717 Migrate to Kitsu's GraphQL API (#3792)
While there are still some nasty corners (multiple shapes of error
response, unhandled error types on their end, etc.), this is a
functional, feature-parity replacement for the JSON:API API we were
using before.

According to the GraphQL docs, searching by title still goes via
Algolia.
2026-08-22 04:46:35 +06:00
w 497e266256 Fix page loading for webgpuviewer and bump version (#3823) 2026-08-20 18:15:18 +00:00
MajorTanya 0974e787ad Use Shikimori's update endpoint (#3810)
No idea why it was originally going via the
addition endpoint but Shikimori's v1 and v2 APIs
have a dedicated endpoint to update a list entry
via PATCH or PUT (interchangeable, both allow
partial payloads).

Splitting off the update path revealed that
findLibManga would return a non-null track, which
in turn causes the update call to fail with a 404
due to `library_id` being null.

After further investigation, I realised that
findLibManga should always return null if the
title is not in the user's library, not just in
refreshes.
2026-08-21 00:12:48 +06:00
MajorTanya 01bfaa99ad Add support for using the user's chosen Kitsu rating scales (#3818)
Add support for different Kitsu rating scales

Includes a database migration because we have been scaling Kitsu's
2-20 `ratingTwenty` integer value to a 1-10 (step 0.5) value and
stored that in the database.

I'm also "rounding" the values to the next lowest valid one in the
current rating system to mirror Kitsu's behaviour for this. Both Kitsu
and the app keep the misfit value around until the score is otherwise
edited, at which point the interface constrains the user selection to
only valid values (for the current system).

Maybe the RatingSystem data class is overkill, but a previous version
of mine had three constants for each system that had to be manually
associated at each corner. Encapsulating those in a little map of data
classes seemed the more ergonomic solution.
2026-08-21 00:11:27 +06:00
Mend Renovate 4b5a0539e5 Update dependency com.mikepenz:aboutlibraries-compose-m3 to v15.1.0 (#3822) 2026-08-21 00:09:49 +06:00
Mend RenovateandAntsyLich 598f634afb Update dependency com.google.firebase:firebase-bom to v34.18.0 (#3820)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-08-21 00:08:38 +06:00
Mend Renovate dee3daf145 Update dependency com.google.firebase.crashlytics to v3.0.8 (#3819) 2026-08-21 00:07:52 +06:00
Mend Renovate 9fe2c2e106 Update Gradle to v9.7.1 (#3814) 2026-08-21 00:06:47 +06:00
MajorTanya 3cc0d2c324 Trim MAL & MB id: query before lookup (#3793)
This was included for all other trackers in #3776 but these two had
prefix search before.

It's a small change, but it can go a long way when using `id:` with
copy-pasted IDs from elsewhere which come with starting or trailing
whitespace.
2026-08-17 23:43:50 +06:00
w f75f2598a3 Fix fit height to in new renderer and bump webgpuviewer (#3801) 2026-08-17 23:08:09 +06:00
MajorTanya c613b52503 Add score info to MangaUpdates search results (#3795)
Also added author info for `id:` prefix search results since those hit
the single-series endpoint instead of `/search`, which does not
include author information (I wish it did).

Maybe unintuitive but the info is nice to have when available.
2026-08-17 16:28:25 +06:00
Mend Renovate 8586d81e63 Update spotless to v8.10.0 (#3798) 2026-08-17 16:27:25 +06:00
AntsyLich 3e98c15b74 Remove duplicate in strings.xml 2026-08-17 05:09:13 +06:00
+1 2b532ea0c4 Translations update from Hosted Weblate (#3701)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ms/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hant/
Translation: Mihon/Mihon

Co-authored-by: CyberMageIL <CyberMageIL@Gmail.com>
Co-authored-by: Daniil Paschenko <daniil_paschenko@mail.ru>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Frosted <frosted@users.noreply.hosted.weblate.org>
Co-authored-by: Infy Milliaria <ced.paltep10@gmail.com>
Co-authored-by: Lucas Correia <anicetoclucas@gmail.com>
Co-authored-by: Megat Al Zhahir Daniel <megatalzhahir@gmail.com>
Co-authored-by: Szafranek13 <jakubfabijan@tuta.io>
Co-authored-by: abc0922001 <abc0922001@hotmail.com>
Co-authored-by: on9686 <on9686@users.noreply.hosted.weblate.org>
2026-08-17 04:50:27 +06:00
AntsyLich b2015d1ef3 Migrate to Metro DI (#3608)
Assisted-by: Claude:claude-opus-5
2026-08-16 18:47:48 +00:00
Mend Renovate 1e5b1dc5e7 Update okhttp to v5.5.0 (#3789) 2026-08-16 16:44:16 +00:00
AntsyLich 5fa5f7e159 Load extensions off the main thread (#3788)
Assisted-by: Claude:claude-opus-5
2026-08-16 16:35:38 +00:00
w 00fb597ae9 Drop legacy decoder (#3786) 2026-08-16 15:48:58 +00:00
Mend Renovate 7e78849ed0 Update dependency de.stefan-oltmann:kim to v0.37.0 (#3774) 2026-08-16 21:21:37 +06:00
Mend Renovate 4d5b0ea906 Update dependency ca.mpreg:imagedecoder to v9 (#3777) 2026-08-16 21:21:23 +06:00
MajorTanyaandBrutuZ a81b7bce9a Add id: prefix search for rest of third-party trackers (#3776)
* Add id: prefix search to AniList

* Add id: prefix search to Bangumi

* Add id: prefix search to Kitsu

* Add id: prefix search to MangaUpdates

* Add id: prefix search to Shikimori

* Add id: prefix search to Hikka

Since Hikka doesn't use integer IDs and instead relies solely on a slug system,
users have to supply the slug to the `id:` search (so not `id:123` but
`id:sousou-no-frieren-97e05f` to get the Frieren manga specifically)

It's asymmetrical to the other trackers, but I thought keeping the prefix
consistent was more important than to be true to the tracker's internal
workings.

* Parse MU string IDs as base36 Longs

Turns out that's what the random strings in the URL are.

Co-authored-by: BrutuZ <7104931+BrutuZ@users.noreply.github.com>

* [skip ci] Add Changelog

---------

Co-authored-by: BrutuZ <7104931+BrutuZ@users.noreply.github.com>
2026-08-16 03:51:54 +06:00
Secozzi abdecb3cb4 Show updates and upcoming filter icon as active for categories (#3772) 2026-08-15 21:19:05 +06:00
AntsyLich ed30766a9f Match WebGPU reader background and transition colors to the old reader (#3765)
Assisted-by: Claude:claude-opus-5
2026-08-14 20:50:56 +00:00
AntsyLich b1efee47f5 Replace StateViewModel with explicit backing fields (#3763)
Assisted-by: Claude:claude-opus-5
2026-08-14 19:53:06 +00:00
AntsyLich d00efa4bfc Make LibraryViewModel collect library only while subscribed (#3762)
Assisted-by: Claude:claude-opus-5
2026-08-14 19:39:22 +00:00
AntsyLich b1a9a05926 Make UpdatesViewModel collect updates only while subscribed (#3761)
Assisted-by: Claude:claude-opus-5
2026-08-14 19:39:04 +00:00
Mend Renovate 55675e7f80 Update dependency de.stefan-oltmann:kim to v0.36.0 (#3758) 2026-08-15 01:21:12 +06:00
AntsyLich b393088cfa Rename preview build type to nightly and label FOSS builds (#3760)
Assisted-by: Claude:claude-opus-5
2026-08-15 01:20:55 +06:00
Mend Renovate 77e88a2159 Update dependency de.stefan-oltmann:kim to v0.35.0 (#3757) 2026-08-14 17:13:02 +00:00
Mend Renovate ecbec8f501 Update dependency androidx.webkit:webkit to v1.17.0 (#3756) 2026-08-14 17:12:31 +00:00
w 5c3ae37d52 Add high quality WebGPU renderer (#3388) 2026-08-14 23:01:00 +06:00
Mend Renovate 581a89b7b0 Update dependency androidx.appcompat:appcompat to v1.8.0 (#3751) 2026-08-13 16:53:28 +00:00
Mend Renovate 6197768a01 Update dependency androidx.paging:paging-runtime to v3.5.1 (#3750) 2026-08-13 10:12:00 +00:00
Mend Renovate d1f9a1fdaf Update dependency androidx.baselineprofile to v1.5.0-rc01 (#3749) 2026-08-13 10:11:17 +00:00
Mend Renovate db7f1663b7 Update dependency org.conscrypt:conscrypt-android to v2.6.2 (#3745) 2026-08-12 14:49:25 +00:00
Mend Renovate a0a3adf864 Update dependency io.kotest:kotest-assertions-core to v6.2.4 (#3744) 2026-08-12 14:48:39 +00:00
MajorTanya 437dd87225 [skip ci] Fix PR reference in Changelog (#3741) 2026-08-12 20:39:45 +06:00
MajorTanya cd1f426945 Fix wrong MangaBaka scores for step sizes > 1 (#3740)
* Fix wrong MangaBaka scores for step sizes > 1

We're actually sending the index of the score type in the list, not
the score itself.

Overriding indexToScore solves that issue.

Also refactored the ranges to be constants for consistency.

* Changelog
2026-08-12 20:38:49 +06:00
Mend Renovate 2506b04964 Update xmlutil to v1.0.2 (#3730) 2026-08-09 04:32:18 +06:00
AntsyLich 77a1a5afbd Make ExtensionsViewModel collect extensions only while subscribed (#3729)
Assisted-by: Claude:claude-opus-5
2026-08-08 20:05:11 +06:00
AntsyLich a494ebd791 Make HistoryViewModel collect history only while subscribed (#3728)
Assisted-by: Claude:claude-opus-5
2026-08-08 20:04:41 +06:00
AntsyLich c68efd0e86 Make DownloadQueueViewModel collect downloads only while subscribed (#3727)
Assisted-by: Claude:claude-opus-5
2026-08-08 20:04:29 +06:00
AntsyLich ae37c1651a Make ExtensionDetailsViewModel collect sources only while subscribed (#3726)
Assisted-by: Claude:claude-opus-5
2026-08-08 20:04:17 +06:00
AntsyLich 62288c08fb Make UpcomingViewModel collect manga only while subscribed (#3725)
Assisted-by: Claude:claude-opus-5
2026-08-08 20:04:05 +06:00
AntsyLich 3cb9883d62 Make MigrateSourceViewModel collect sources only while subscribed (#3723)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:59:17 +06:00
AntsyLich fab4cbd279 Make MigrateMangaViewModel collect favorites only while subscribed (#3722)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:59:04 +06:00
AntsyLich 6c0058d230 Make SourcesViewModel collect sources only while subscribed (#3721)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:58:52 +06:00
AntsyLich 2aec7d19c0 Make CategoryViewModel collect categories only while subscribed (#3720)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:58:41 +06:00
AntsyLich bb9767c9df Make SourcesFilterViewModel collect sources only while subscribed (#3719)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:58:30 +06:00
AntsyLich 864281af7d Make ExtensionFilterViewModel collect languages only while subscribed (#3718)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:58:18 +06:00
AntsyLich f6aad7497e Make ExtensionStoresViewModel collect stores only while subscribed (#3717)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:58:06 +06:00
AntsyLich 0834884335 Make MangaCoverViewModel collect manga only while subscribed (#3716)
Assisted-by: Claude:claude-opus-5
2026-08-08 11:57:55 +06:00
Mend Renovate ed274e26fd Update dependency org.junit.jupiter:junit-jupiter to v6.1.3 (#3715) 2026-08-07 14:02:14 +00:00
MajorTanya f9156aa17a Fix Mangabaka dates drifting in negative timezones (#3711)
* Fix Mangabaka dates drifting in negative timezones

This was only partially handled in #3047, but MB returns full datetime
strings with a truncated time component that's always midnight UTC.
So when Mihon then parses the returned dates, it gets the day wrong in
any negative offset timezones.

With this, Mihon now discards the time component and instead takes the
date component + start-of-day in the device timezone.

* Add Changelog
2026-08-07 19:49:39 +06:00
Mend Renovate b6aa40a849 Update Gradle to v9.7.0 (#3709) 2026-08-07 03:49:18 +06:00
AntsyLich 68aa4b003f Don't recheck for updates on configuration change (#3708) 2026-08-06 21:38:28 +06:00
AntsyLich aa25b3a14c Download app update without WorkManager (#3707) 2026-08-06 21:38:07 +06:00
AntsyLich 869fa1a4b2 Suppress R8 warnings for missing androidx.window extension classes 2026-08-05 23:14:47 +06:00
AntsyLich df6507256a Release v0.20.4 2026-08-05 22:27:07 +06:00
+3 b765531b82 Translations update from Hosted Weblate (#3677)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ms/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ms/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: CyberMageIL <CyberMageIL@Gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Frosted <frosted@users.noreply.hosted.weblate.org>
Co-authored-by: Infy Milliaria <ced.paltep10@gmail.com>
Co-authored-by: Lyfja <45209212+lyfja@users.noreply.github.com>
Co-authored-by: Megat Al Zhahir Daniel <megatalzhahir@gmail.com>
Co-authored-by: Michał Marszałek <1aam2am1@gmail.com>
Co-authored-by: Nguyễn Trung Đức <vaicato16@gmail.com>
Co-authored-by: ZerOriSama <godarms2010@live.com>
Co-authored-by: karigane <169052233+karigane-cha@users.noreply.github.com>
Co-authored-by: on9686 <on9686@users.noreply.hosted.weblate.org>
2026-08-05 22:22:05 +06:00
AntsyLich 21c6357967 Replace CategoryUpdate with dedicated update queries (#3693)
Assisted-by: Claude:claude-opus-5
2026-08-05 00:40:08 +06:00
MajorTanya 3d20bcc6b6 Fix relative date display (#3696)
* Fix relative date display

DatePeriod.days provides the number of days in the DatePeriod specifically, not the total number.
LocalDate.daysUntil provides what we were looking for.

* Add Changelog
2026-08-05 00:39:49 +06:00
Soitora 71deefb6fd Update broken repo images (#3692) [skip ci] 2026-08-04 20:01:17 +06:00
NGB-Was-Taken 8fceb737a4 Respect verbose logging preference in crash log dumps (#3682) 2026-08-04 18:37:04 +06:00
AntsyLich 81e0754c0d Release v0.20.3 2026-08-04 16:58:34 +06:00
MajorTanyaandAntsyLich e287f08789 Fix MAL error when list entries have partial dates (#3573)
This has the side effect of forcing the date to something concrete.

For Year-only: 1st of January that year
Ex: 2025 -> 2025-01-01

For Year+Month: 1st of said month
Ex: 2024-11 -> 2024-11-01

MAL allows setting Day+Month and Day+Year, but both of those are sent
as `null` in the API, which means Mihon will not show a date at all.
This has the side effect of Mihon sending up the date as `null` the
next time info is sent to MAL, which will clear the date fields
completely.

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-08-04 16:48:08 +06:00
MajorTanya a73271aefa Add category filters to Upcoming calendar (#3607) 2026-08-04 16:30:23 +06:00
AntsyLich f7a1ecd251 Fix reader loading indefinitely in some scenarios (#3686)
Init the reader from the view model instead of the activity so it isn't
cancelled by a configuration change mid init, which left the retained
view model half initialized and needsInit() returning false.

Assisted-by: Claude Code:claude-opus-5
2026-08-03 23:51:17 +06:00
Mend Renovate f80c91081f Update gradle/actions action to v6.3.0 (#3681) 2026-08-03 16:06:15 +06:00
AntsyLich 55be95dd5d Improve WebView spoofing (#3678)
- Spoof `Sec-CH-UA` client hints to match the user agent
- Fix `X-Requested-With` spoofing leaking to unrelated callers
- Update default user agent to Chrome 149
2026-08-02 20:05:21 +06:00
NGB-Was-Taken d7f3ceef5c Ensure R8 keeps methods called externally by Shizuku (#3676)
* Ensure R8 keeps methods called externally by Shizuku

* Changelog
2026-08-02 11:53:49 +00:00
MajorTanya 1d8a2b05dd Add category filters for Updates tab (#3589)
* Add category filters for Updates tab

Works just like Library Updates.

Provides a tab in the Updates tab filter dialog to allow for including
& excluding of updates belonging to a title from a given category.

Excludes overpower Includes, as with Library Updates.

A little helpful text informs users about this.

* Changelog

* [skip ci] Remove unused string

Leftover from before I realized the Default category will always be
available for in-/exclusion.

* Make :includeEmpty/:excludeEmpty true Boolean params

* "include" -> "included"

Consistency with #3607.

* Remove DISTINCT from getRecentUpdatesWithFilters

Apparently not needed anymore (though it was required at some point).

* [skip ci] Fix Changelog
2026-08-02 16:59:58 +06:00
MajorTanya 6d69903a56 Replace java.time APIs with kotlin(x).(date)time (#3001)
* Replace java.time APIs with kotlin(x).(date)time

kotlinx-datetime explicitly says in its README that it does not cover
i18n, so we have to stick with using their toJavaX converters wherever
we localise dates and times.

Yes, some of these replacements are... questionable. But I wanted to
try and maximise the replacement for now.

* Bump kotlinx-datetime to 0.8.0

* More kotlin.time/kotlinx-datetime replacements

* Remove redundant init block & make attributes val

* Replace new use of java.time.Instant
2026-08-02 16:58:25 +06:00
AntsyLich 0648e2eaaf Release v0.20.2 2026-08-01 21:32:00 +06:00
Mend Renovate 7d4e1476ba Update dependency com.google.firebase:firebase-bom to v34.17.0 (#3670) 2026-08-01 21:28:01 +06:00
+9 46a2471abb Translations update from Hosted Weblate (#3563)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/he/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/it/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ne/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Acelith <joel.jon@moix.me>
Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: Cuong Nguyen Viet <vietcuong0501@gmail.com>
Co-authored-by: CyberMageIL <CyberMageIL@Gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Doministo <doministo@seznam.cz>
Co-authored-by: FateXBlood <fatexblood@gmail.com>
Co-authored-by: Frosted <frosted@users.noreply.hosted.weblate.org>
Co-authored-by: Hualiang <642615676@qq.com>
Co-authored-by: Infy Milliaria <ced.paltep10@gmail.com>
Co-authored-by: Lucas Correia <anicetoclucas@gmail.com>
Co-authored-by: Luiz Paulo Dias <luizpauloandrade@gmail.com>
Co-authored-by: Lyfja <45209212+lyfja@users.noreply.github.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: ZerOriSama <godarms2010@live.com>
Co-authored-by: karigane <169052233+karigane-cha@users.noreply.github.com>
Co-authored-by: on9686 <on9686@gmail.com>
Co-authored-by: on9686 <on9686@users.noreply.hosted.weblate.org>
2026-08-01 21:27:45 +06:00
Mend Renovate f63dc799f0 Update actions/setup-java action to v5.7.0 (#3673) 2026-08-01 21:26:51 +06:00
Naji AstierandNaji Astier c114028a33 Fix backup restore dropping library entries (#3667)
* Fix backup restore dropping library entries

History restore resolved chapters by URL alone, so a backup holding the
same entry twice under one source matched multiple chapter rows and threw
`ResultSet returned more than 1 row`. Scope the lookups to the entry.

Entries are restored in chunks of 100 sharing one transaction. SQLDelight
fails the enclosing transaction when a nested one fails, so catching the
per-entry exception did not contain it and the whole chunk rolled back,
losing up to 100 entries per bad one. Retry entry by entry on failure.

Refs #647

* Update changelog

---------

Co-authored-by: Naji Astier <na-ji@users.noreply.github.com>
2026-08-01 21:26:24 +06:00
AntsyLich 4296d056b5 Regenerate baseline profiles 2026-07-30 20:47:17 +06:00
AntsyLich 7aaa891aef Improve app update prompt flow experience (#3669) 2026-07-30 20:36:19 +06:00
Mend Renovate 2ccb0ca163 Update dependency org.jsoup:jsoup to v1.23.1 (#3664) 2026-07-30 18:22:31 +06:00
Mend Renovate 44cd9a55d1 Update dependency androidx.constraintlayout:constraintlayout to v2.2.2 (#3662) 2026-07-29 20:49:55 +00:00
Mend Renovate 2a92f0b46a Update dependency androidx.compose:compose-bom-alpha to v2026.07.01 (#3660) 2026-07-30 02:39:52 +06:00
Mend Renovate f37e81991e Update dependency androidx.baselineprofile to v1.5.0-beta01 (#3659) 2026-07-30 02:38:45 +06:00
AntsyLich d15a05602a Check for app and extension update on every cold start (#3658) 2026-07-30 01:17:10 +06:00
Mend Renovate fbf5ae82f7 Update dependency com.squareup.okio:okio to v3.18.1 (#3654) 2026-07-29 09:48:36 +06:00
Mend Renovate fdb223d657 Update spotless to v8.9.0 (#3652) 2026-07-28 13:39:33 +00:00
NGB-Was-Taken 54ae69eaa2 Remove workarounds for patched compose bugs (#3651) 2026-07-28 19:27:26 +06:00
Mohannad 45b1e781eb Add Tokyo Night theme (#3502) 2026-07-25 20:43:04 +06:00
AntsyLich 069e5c91ac Collect data on device preferred abi
Mainly to analyze if it's worth making binaries for x86 and 32Bit devices
2026-07-25 20:32:23 +06:00
NGB-Was-Taken 4ac9f3474b Fix extension installation with shizuku (#3630)
* Fix extension installation with shizuku

* Changelog

* Move changelog to end
2026-07-25 18:51:11 +06:00
AntsyLich 9c3cc1ca5f Convert :source-api and :source-local to android library module (#3636)
- There's really no plan to support other platforms on this code base
- The "KMP" modules only had android target which is rather pointless
- `i18n` involves more work but given it has no actual code keeping it as is
2026-07-23 16:47:24 +00:00
NGB-Was-Taken 47d7c0f2ea Optimize imports across all modules (#3635)
* Run optimize imports across all modules since spotless doesn't catch unused imports

* Remove import by adding qualifier in KDoc
2026-07-23 22:46:58 +06:00
Mend Renovate 0b5e9bb815 Update android.gradle to v9.3.1 (#3634) 2026-07-23 22:42:29 +06:00
Mend Renovate d72ae365cb Update dependency com.squareup.okio:okio to v3.18.0 (#3628) 2026-07-22 13:28:10 +00:00
NGB-Was-Taken e7ec672c8b Rework library search to use an AST-based approach (#3554)
* Rework library search to use an AST-based approach

* Spotless apply

* Move the filtering logic to the database

* Spotless apply

* Cleanup and separation of concerns

* Add `notes` to field and general search, and chapter read, total chapters to comparison search

* Handle searching for empty fields

* Add `language` as a field-only query option

* Clean up SQL clause generations

* Spotless apply

* Do not parse `-` as a negation when followed by a separator

* Revert moving filtering logic to database

* Changelog

* Use contains for genre instead of equals

* Add special handling for source name

* Add field-only query for source id

* Apply suggestions
2026-07-22 19:20:27 +06:00
Mend Renovate 628cb58862 Update dependency io.kotest:kotest-assertions-core to v6.2.3 (#3622) 2026-07-21 12:09:56 +00:00
MajorTanyaandAntsyLich e454cf8e9d Always use Private installer to update Private extensions (#3614)
* Use Private installer to update Private extensions

This forces the Private installer for any extension which was
installed privately, bypassing whichever setting the user selected in
Settings > Advanced > Installer.

* [skip ci] Changelog entry

* [skip ci] Update CHANGELOG.md

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-21 12:02:33 +00:00
Mend Renovate baa0fb7ecb Update dependency androidx.compose:compose-bom-alpha to v2026.07.00 (#3597) 2026-07-21 18:01:02 +06:00
Mend Renovate 2d2cf0879f Update actions/checkout action to v7.0.1 (#3620) 2026-07-21 17:56:46 +06:00
Mohannad 6981185f4b Fix incorrect progress when resuming resumable image downloads (#3616) 2026-07-21 17:46:57 +06:00
MajorTanya 47aa9190d4 Add MangaBaka to README list of trackers (#3615) [skip ci] 2026-07-21 17:44:17 +06:00
AntsyLich 98705910e7 Fix crash caused by inaccessible view model classes during creation (#3609) 2026-07-19 14:06:01 +00:00
Mend Renovate 5ce7d00eb8 Update actions/setup-java action to v5.6.0 (#3602) 2026-07-19 10:45:16 +06:00
Mend Renovate 03229a3807 Update aboutLibraries to v15.0.4 (#3604) 2026-07-18 03:04:07 +06:00
Small_KuandAntsyLich 493140c7ff Detect Shizuku with permission check (#3565)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-16 19:52:09 +06:00
AntsyLich 98bb731b4d Remove non cancellable call when trying to init reader 2026-07-16 18:23:43 +06:00
AntsyLich c3b99aea07 Migrate to AndroidX ViewModel from Voyager ScreenModel (#3594) 2026-07-15 21:19:11 +06:00
Mend RenovateandAntsyLich ef1c529672 Update android.gradle to v9.3.0 (#3593)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-14 18:32:47 +00:00
Mend Renovate 633eea4ced Update kotlin monorepo to v2.4.10 (#3592) 2026-07-14 18:03:24 +00:00
Mend Renovate 31a4d6ba39 Update softprops/action-gh-release action to v3.0.2 (#3588) 2026-07-14 23:51:37 +06:00
Mend Renovate e9b7c760a1 Update dependency org.conscrypt:conscrypt-android to v2.6.1 (#3587) 2026-07-14 23:51:18 +06:00
Mend Renovate ef1e7ba907 Update dependency org.junit.jupiter:junit-jupiter to v6.1.2 (#3582) 2026-07-12 20:27:17 +06:00
MajorTanya 526d79a975 Fix MangaBaka User-Agent using raw StringResource (#3578)
* Fix MangaBaka User-Agent using raw StringResource

Using the hardcoded app name for the time being until a better
solution can be found.

* Changelog
2026-07-12 06:46:10 +06:00
Mend Renovate b9ac9a0422 Update dependency com.materialkolor:material-kolor to v5.0.0 (#3580) 2026-07-12 06:45:37 +06:00
Draken d171768cff Add Vietnamese translation for fastlane metadata (#3576) 2026-07-11 22:12:39 +06:00
AntsyLich cb2617dee0 Add fastlane metadata (#3564) 2026-07-11 20:01:33 +06:00
AntsyLich b4635c41a8 Fixed app bars remaining visible after changing pages by tapping in the paged reader after using the chapter navigator slider (#3567) 2026-07-10 13:35:16 +00:00
Mend Renovate 217b20123c Update dependency com.google.firebase:firebase-bom to v34.16.0 (#3562) 2026-07-10 00:09:34 +06:00
AntsyLich b2ca6bc5f3 Revert "Disable resumable image downloads"
This reverts commit 3d3bd49d1c.
2026-07-10 00:08:26 +06:00
AntsyLich a8d3e39779 Release v0.20.1 2026-07-10 00:07:57 +06:00
AntsyLich 3d3bd49d1c Disable resumable image downloads 2026-07-10 00:06:59 +06:00
AntsyLich 4a66b8b5df Fix HTTP Error 416 not being handled properly for resumable downloads 2026-07-10 00:03:07 +06:00
52f827c6ff Translations update from Hosted Weblate (#3477)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/id/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/nl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/zh_Hant/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/eo/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/id/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hant/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Juang <juangegiambon@gmail.com>
Co-authored-by: NecRaul <necraul@kuroneko.dev>
Co-authored-by: Nguyễn Trung Đức <vaicato16@gmail.com>
Co-authored-by: Siebrenvde <siebren@siebrenvde.dev>
Co-authored-by: Szafranek13 <jakubfabijan@tuta.io>
Co-authored-by: TheKingTermux <50316075+TheKingTermux@users.noreply.github.com>
Co-authored-by: abc0922001 <abc0922001@hotmail.com>
2026-07-09 23:26:32 +06:00
AntsyLich aa434285b2 Remove flag to disable code shrinking
androidx.benchmark plugin adds non minified versions of the release variants. we can just reuse that.
2026-07-09 23:22:30 +06:00
AntsyLich 91e967128d Regenerate baseline profiles 2026-07-09 23:06:33 +06:00
AntsyLich abef1cb8c5 Add proguard rule for com.squareup.zstd 2026-07-09 22:46:40 +06:00
MajorTanya 1d8e5d7eb1 Fix underscore in Hikka media types (#3560)
Currently, media types like "one_shot" will turn into "One_shot" in
the search display due to Mihon capitalising the `publishing_type`
attribute of `Track` for display.

It is common for other tracker implementations to replace the
underscore with a space which results in "One shot".

This makes Hikka more consistent with other trackers.

I added the nullability check since the docs do say `string | null`
but that's neither here nor there.
2026-07-09 22:30:50 +06:00
AntsyLich 75f506836c Fix app not reading tachiyomix.extensionLib extension metadata 2 (#3559) 2026-07-09 08:31:34 +00:00
AntsyLich 44780e74b5 Add vertical chapter navigator for paged reader with height adjustment option (#3531) 2026-07-09 08:11:56 +00:00
Mend Renovate 8407439b8a Update xmlutil to v1.0.1 (#3555) 2026-07-09 12:04:43 +06:00
MajorTanya ab58a9952e Fix Hikka search failing due to unclosed response & show toast on remote-removed titles (#3548)
* Fix Hikka search failing due to unclosed response

This closes #3547.

I have also included a precautionary refactor of the `getRead` method
in HikkaApi.kt, which by the looks of it _could_ leak an unclosed
response as well.

The try/catch with awaitSuccess pattern has been used in this same way
in the Bangumi and MangaBaka implementations as well. The benefit here
is that `awaitSuccess()` closes the response on error before throwing
an `HttpException`.

* Show toast on remote-removed list entries
2026-07-08 17:41:23 +00:00
AntsyLich 0ff654205f Update aboutLibraries to v15 (#3553) 2026-07-08 17:13:18 +00:00
Mend Renovate 1d8789d800 Update dependency org.conscrypt:conscrypt-android to v2.6.0 (#3552) 2026-07-08 17:08:08 +00:00
AntsyLich a313c747f3 Fix reader navigator slider steps not updating after changing chapter (#3549) 2026-07-08 16:58:45 +00:00
AntsyLich 66b390c62a Fix app not reading tachiyomix.extensionLib extension metadata (#3545)
Android was interpreting the field as a float and failing (which is nuts imo)

Also cleaned up the lib validation logic
2026-07-08 07:43:17 +00:00
Mend Renovate 26abad0be0 Update dependency io.kotest:kotest-assertions-core to v6.2.2 (#3544) 2026-07-08 13:38:52 +06:00
Mend Renovate 68f293be45 Update actions/setup-java action to v5.5.0 (#3543) 2026-07-08 13:38:29 +06:00
41f4579c74 Add MangaBaka tracker support (#3047)
* Add support for MangaBaka

Note: missing a client ID which should be added by the project owner.

* Fix typo causing token refresh to fail

The field is called `refresh_token` not `refreshToken`, so all
token refreshes would fail with a 401.

* Use user-preferred score type

Currently, this only set once on login. When selecting a different
score type on MangaBaka, users (currently) will have to log out and
log in again in order for Mihon to refetch the score setting.

This appears to be what Mihon's AniList implementation does as well,
so I followed that.

* Fix score preference

Didn't get caught during the rebase.

* Fix finish_date

* Fix dates appearing offset

Timezone shenanigans meant Mihon was sending an ISO 8601 string for
the UTC timezone which lead to issues in non-UTC timezones.

For example:
1. User in UTC+1 selects 2026-03-22
2. Date picker returns 2026-03-22T00:00:00+01:00
3. MangaBakaApi converts that to an instant, converting it to UTC:
  2026-03-21T23:00:00Z
4. MangaBaka receives that and sets all time components to 0
5. Mihon (when opening the track sheet next) receives:
  2026-03-21T00:00:00Z
6. Mihon renders that as 2026-03-21

I figured out that MangaBaka accepts date-only strings as well, so we
just send those now.

* Remove fetching of total_chapters from MangaBaka

Currently, this information is not what Mihon needs for automatic
marking as COMPLETED since MangaBaka considers this an ongoing tally
of volume-published chapters rather than the final chapter number of a
title.

If anyone other than me used this code: Probably will have to unlink
& relink MB entries to get rid of the total_chapters data, not sure.

MangaBaka is currently considering a request from me to potentially
change this, but currently it's not what we need.

* Fix start date being reset on each read chapter

Admittedly a silly oversight. The other date-supporting trackers (AL,
MAL, Kitsu) use this check as opposed to `>= 0.0`.

* Add id: prefix search for MangaBaka

* Use new /v1/my/profile endpoint

Kindly added by the developers after my request <3.

* Change tracker ID to 11

* Remove unused import

* Identify Mihon in UA on all requests

* Use new `published.start_date` field for search

* Change Mihon's User Agent string for MangaBaka

- use MR.strings.app_name to avoid manual work for forks
- include app ID & commit sha for further distinction

* Add Changelog entry

* Add Mihon client ID

* Add OAuth state query param

This is?/will be? required by MangaBaka's auth provider and caused
linking issues for anyone who tried to link with MB in the past two
weeks or so.

* Update MangaBaka API URL

Changed as per MB announcement from 2026-05-27

* Use `titles` instead of old `title`

* Make title selection a method on MangaBakaItem

* Include ID in fallback title for easier reporting

Makes it a lot more intuitive for users.
Also reworded the message to more clearly direct users to the
Mangabaka Discord server instead of sounding like an instruction to
contact some "mangabaka" user in the Mihon Discord.

* `titles` is nullable

At least I noticed this before it was merged...

* Fix MangaBaka brand name

Co-authored-by: BrutuZ <7104931+BrutuZ@users.noreply.github.com>

* Remove Hikka comment

* Put MangaBaka at the top of the tracker list

AntsyLich decreed it to be like this.

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>

* Add display name support from #3533

* Fix changelog

* Rename MB icon to brand_mangabaka.webp

---------

Co-authored-by: BrutuZ <7104931+BrutuZ@users.noreply.github.com>
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-07 20:58:50 +06:00
Leodyver SemillaandAntsyLich 0787678c12 Don't use GMS to detect if GMS is available (#3525)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-07 10:43:14 +00:00
MajorTanya d0c79399b9 Show usernames for each tracker in settings (#3533) 2026-07-07 16:31:22 +06:00
MajorTanya 17aed02e56 Hikka: Set PLAN_TO_READ for manga with no progress (#3534)
Currently, every title will be added as READING, even if no chapter
has been read.

For consistency with every other tracker, I added the hasReadChapters
check as seen in other tracker implementations.
2026-07-07 16:29:04 +06:00
Cuong-Tran 88a9d44bb7 Fix chapter's memo field not being updated for existing chapters (#3538) 2026-07-07 16:25:31 +06:00
LorgOnandAntsyLich aa46039e6c Add Hikka tracker support (#1386)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-06 21:18:06 +00:00
AntsyLich 3b078331a0 Fix support for non-system SAF providers (#3530) 2026-07-06 23:14:24 +06:00
AntsyLich b8e5f22c01 Add proguard rules to keep Serializable writeReplace and readResolve 2026-07-05 22:21:04 +06:00
AntsyLich c3bf7a78c0 Fix crash when putting app in background (#3523) 2026-07-05 11:51:10 +06:00
AntsyLich 94b3b5eaa2 Revert "Fix crash when putting app in background while on notes screen (#3515)"
This reverts commit 76cc04c8f4.
2026-07-04 15:18:40 +06:00
AntsyLich 27284a40ab Fix crash trying to select text in notes screen (#3516) 2026-07-03 23:32:03 +06:00
AntsyLich 76cc04c8f4 Fix crash when putting app in background while on notes screen (#3515) 2026-07-03 23:25:29 +06:00
Leodyver SemillaandAntsyLich 77580cd55f Invalidate download cache after backup restore (#3096)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-03 23:21:38 +06:00
MajorTanya db095c87aa Use Shikimori's GraphQL API where possible (#3499)
User list mutation aren't available via GraphQL, so that will still be
done with the v2 API.

Shikimori API docs say to prefer the GraphQL API when possible:
https://shikimori.io/api/doc

Allows adding some additional data in the search results, namely:
- Authors & Artists
- Description

As a nice bonus, this reduces the number of requests to Shikimori
because the findLibManga method no longer needs to do 2 calls to fetch
both list and title data.
2026-07-03 22:21:22 +06:00
MajorTanya f3c6789dfb Fix downloads not working due to wrong file check (#3514)
The code as-is accepts _any_ non-.tmp file as a match for the given
page file.
Changing the condition to "not .tmp" AND (either page prefix pattern)
results in the correct behaviour and chapters download again.
2026-07-03 22:20:56 +06:00
Mend Renovate 0772f72021 Update dependency androidx.test.uiautomator:uiautomator to v2.4.0 (#3509) 2026-07-03 13:02:04 +06:00
Mend Renovate 1623c188df Update dependency androidx.sqlite:sqlite-bundled to v2.7.0 (#3508) 2026-07-03 13:01:55 +06:00
AntsyLich dfed97edc8 Address compose and xmlutil deprecations (#3507) 2026-07-02 19:15:42 +00:00
MohannadandAntsyLich f6632940fa Fix duplicate images after resuming paused downloads (#3504)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-02 18:44:30 +00:00
Mend Renovate ca2e8cf4de Update dependency androidx.compose:compose-bom-alpha to v2026.06.01 (#3506) 2026-07-03 00:19:35 +06:00
Mend Renovate 000e2d091b Update dependency androidx.baselineprofile to v1.5.0-alpha07 (#3505) 2026-07-02 18:13:54 +00:00
Mend Renovate 40f782e10c Update spotless to v8.8.0 (#3493) 2026-07-03 00:09:36 +06:00
Mend Renovate f306e65b25 Update xmlutil to v1 (#3494) 2026-07-03 00:08:26 +06:00
Mend Renovate d0f373df22 Update dependency org.junit.jupiter:junit-jupiter to v6.1.1 (#3492) 2026-07-03 00:08:06 +06:00
MajorTanya 3fd76e4f93 Fix Shikimori URL (#3497)
There is a redirect from the .one domain to the .io domain but it uses
code 301 for redirecting on the token POST request, meaning the
followup request tries to use GET which returns a 404.
2026-07-03 00:03:24 +06:00
d8c3440d37 Support resumable image downloads if supported by source (#3167)
Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com>
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-07-01 00:20:43 +06:00
AntsyLich a82ccea6f5 Update voyager to 2.2.21-1.10.3 (#3466) 2026-06-27 08:53:33 +06:00
AntsyLich 19f1d00fcb Release v0.20.0 2026-06-27 05:58:04 +06:00
Mend Renovate 8c099aca90 Update Gradle to v9.6.1 (#3475) 2026-06-26 23:29:54 +06:00
AntsyLich 6c6a07c0c0 Ensure app shortcuts use correct color scheme on preview builds (#3473) 2026-06-26 14:25:19 +06:00
AntsyLich 8e323e30de Update store decoding to account for new CONTENT_WARNING_UNSPECIFIED (#3472) 2026-06-26 07:24:53 +00:00
Mend Renovate 91ccc0ca40 Update actions/setup-java action to v5.4.0 (#3470) 2026-06-26 08:48:57 +06:00
AntsyLich 735cea35f9 Ensure all tachiyomix required dependencies are present (#3465) 2026-06-23 18:19:27 +00:00
AntsyLich 41265cce32 Query for new tachiyomix metadata from extensions (#3464) 2026-06-23 18:04:44 +00:00
J. FronnyandAntsyLich 176a5409b2 Add option to open app settings from system settings (#3180)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 23:24:43 +06:00
NGB-Was-TakenandAntsyLich f23170bfaa Update app shortcuts to use app icon color scheme (#2835)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 23:12:57 +06:00
Leodyver SemillaandAntsyLich bc7f7e70a1 Prevent random FileNotFoundException when reading chapters (#3154)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 16:44:27 +00:00
xenitaneandAntsyLich a1b5ea811a Tweak Catppuccin color scheme for clarity (#3436)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 16:40:02 +00:00
+21 9d8d70dc61 Translations update from Hosted Weblate (#3227)
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ar/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/as/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/fr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/hr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ro/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/sv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon-plurals/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ar/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/as/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/bn/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/cs/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/de/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/el/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/es/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fil/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/fr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/hr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ja/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/kmr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ko/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ml/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/nl/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ro/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/ru/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/sv/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/tr/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/uk/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/vi/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/mihon/mihon/zh_Hant/
Translation: Mihon/Mihon
Translation: Mihon/Mihon Plurals

Co-authored-by: Abdullah Al-Shamiry (Ace) <its.shamiry@gmail.com>
Co-authored-by: Adam Havránek <adamhavra@seznam.cz>
Co-authored-by: Davi Oliveira <davikson13@gmail.com>
Co-authored-by: Dexroneum <Rozhenkov69@gmail.com>
Co-authored-by: Frosted <frosted@users.noreply.hosted.weblate.org>
Co-authored-by: Hasanur Rahman Biplob <iam.biplob@users.noreply.hosted.weblate.org>
Co-authored-by: Infy's Tagalog Translations <ced.paltep10@gmail.com>
Co-authored-by: Itsmechinmoy <167056923+itsmechinmoy@users.noreply.github.com>
Co-authored-by: Jon C. <picujon@users.noreply.hosted.weblate.org>
Co-authored-by: Lucas Correia <anicetoclucas@gmail.com>
Co-authored-by: Lyfja <45209212+lyfja@users.noreply.github.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Ngo Lam Bao An <onionandsalad@gmail.com>
Co-authored-by: Nguyễn Trung Đức <vaicato16@gmail.com>
Co-authored-by: Pitpe11 <giorgos2550@gmail.com>
Co-authored-by: Romb38 <r.barbier38@standouda.fr>
Co-authored-by: Sahal <sahaltp369@gmail.com>
Co-authored-by: ScratchBuild <foobarbuzz@gmail.com>
Co-authored-by: Sebastian Mihai Crap <sebastiancrap@gmail.com>
Co-authored-by: Siebrenvde <siebren@siebrenvde.dev>
Co-authored-by: Sixten Lund <arbitraryindices@users.noreply.hosted.weblate.org>
Co-authored-by: Swyter <swyterzone@gmail.com>
Co-authored-by: Teashrock <kajitsu22@gmail.com>
Co-authored-by: ZerOriSama <godarms2010@live.com>
Co-authored-by: abc0922001 <abc0922001@hotmail.com>
Co-authored-by: icarus suraci <mhmtylmz112000@gmail.com>
Co-authored-by: on9686 <on9686@gmail.com>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: uaevuon <newget64@gmail.com>
Co-authored-by: ابْنُ السَدِيمِ <amarlubs2@gmail.com>
2026-06-23 22:22:31 +06:00
Luca AuerandAntsyLich 06497622f6 Batch database operations during backup restore for improved performance (#3267)
* perf(backup): batch database operations during restore

Reduce overhead by chunking manga and repo restoration into
transactions of 100 entries. Categories now restored in a single
transaction. Optimized DatabaseHandler to reuse existing transaction
contexts instead of creating redundant nested ones.

Changed TransactionElement to internal to allow AndroidDatabaseHandler
to check transaction state from the same package.

* fix(backup): make restore progress and errors thread-safe

Use AtomicInteger for progress and synchronizedList for errors to
prevent race conditions during concurrent restoration coroutines.

* perf(backup): update progress notification only once per chunk

Reduce UI/IPC overhead by moving notification updates out of the inner
loop, triggering them only after each 100-item transaction chunk.

Reduced on my emulator from 46 seconds to 27

* fix: remove invalid awaitAsOne() call on insert() return type

categoriesQueries.insert() returns Long (the inserted row ID), not an
ExecutableQuery<T>, so awaitAsOne() is not applicable.

* fix(feedback): Use `CopyOnWriteArrayList` and kotlin `AtomicInt`, add a changelog entry

Note that using kotlin `AtomicInt` instead of java `AtomicInteger` requires opting into an experimental API.

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 19:45:25 +06:00
AntsyLich c397d657d1 Remove BrotliInterceptor from default client (#3458) 2026-06-23 19:40:02 +06:00
Mend Renovate 6f99c7b970 Update markdown to v0.43.0 (#3462) 2026-06-23 19:39:13 +06:00
AntsyLich 1cb38a1c33 Bump version code 2026-06-22 00:51:22 +06:00
AntsyLich b3e190c627 Refactor baseline profiles generation and regenerate (#3434) 2026-06-22 00:50:24 +06:00
AntsyLich 3bb734dde7 Swap store content rating for warning and move to extension level 2026-06-22 00:37:39 +06:00
AntsyLich 5f5a034112 Allow extension stores to have separate extension list file (#3454) 2026-06-21 18:26:38 +00:00
AntsyLich eb5f57a48c Simplify extension store decoding and add gzip compression support (#3453) 2026-06-21 15:08:52 +00:00
AntsyLich 903add50c9 Address gradle 9.6 deprecations (#3452) 2026-06-21 12:42:26 +00:00
Mend Renovate c7e782c179 Update markdown to v0.42.0 (#3447) 2026-06-20 23:42:08 +06:00
Mend Renovate 53724fd561 Update softprops/action-gh-release action to v3.0.1 (#3444) 2026-06-20 23:40:32 +06:00
Mend Renovate 5f80403c5d Update GitHub Actions to v7 (#3438) 2026-06-19 13:09:41 +06:00
Mend Renovate d4ad76d576 Update kotest.assertions to v6.2.1 (#3437) 2026-06-19 13:08:42 +06:00
Mend Renovate 46b5cce007 Update Gradle to v9.6.0 (#3439) 2026-06-19 13:08:20 +06:00
AntsyLich 80541831bb Revert "Use app scoped CoroutineScope (#3403)"
This reverts commit 509eee5dfb.

Fixes #3429
2026-06-18 17:40:01 +06:00
AntsyLich ee6a9876ec Fix uploaded apk reference in build workflow (#3435) 2026-06-18 01:20:43 +06:00
Mend RenovateandAntsyLich df37d81dfb Update androidx.lifecycle to v2.11.0 (#3433)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-17 19:11:07 +00:00
Mend Renovate e99a50f612 Update androidx.compose.bom to v2026.06.00 (#3432) 2026-06-18 01:04:06 +06:00
AntsyLich 50d0e8ae0a Only try to read signing data in release workflow (#3431) 2026-06-17 18:34:00 +00:00
AntsyLich 6552ffe315 Sign APK with AGP 2026-06-17 02:40:35 +06:00
Mend Renovate 381eb07ec9 Update google.services to v4.5.0 (#3422) 2026-06-16 19:40:09 +00:00
Mend Renovate 3eafa16c64 Update firebase.bom to v34.15.0 (#3419) 2026-06-17 01:23:55 +06:00
Mend Renovate 672ff416c5 Update actions/setup-java to v5.3.0 (#3420) 2026-06-16 17:40:59 +00:00
Mend Renovate 16376f509c Update GitHub Actions (major) (#3004) 2026-06-16 23:33:21 +06:00
Mend Renovate 56fde24532 Update spotless to v8.7.0 (#3416) 2026-06-16 23:25:28 +06:00
Mend Renovate 518d2ab7df Update kotest.assertions to v6.2.0 (#3415) 2026-06-16 23:24:55 +06:00
AntsyLich 082bd66673 Remove redundant call to updateMangaFromRemote in manga screen 2026-06-16 20:03:07 +06:00
AntsyLich 5880f4b0bd Ensure chapter order is retained when passed to source.getMangaUpdate 2026-06-16 20:01:47 +06:00
AntsyLich d156496cfa Update num_repos string to use store 2026-06-16 19:38:10 +06:00
AntsyLich eb80ab410e Ensure memo is correctly passed around when transforming classes 2026-06-16 19:05:52 +06:00
AntsyLich 5896d2c939 Fix compatibility with older backups
Fixes #3413
2026-06-16 03:18:12 +06:00
AntsyLich e3610cbe2c Allow app to load TachiyomiX 1.6 extensions 2026-06-16 00:13:10 +06:00
AntsyLich 94cab02c1e Adapt model implementation for TachiyomiX 1.6 (#3412) 2026-06-15 17:32:39 +00:00
AntsyLich f00cac265f Remove text limit of manga notes (#3410) 2026-06-14 14:55:04 +00:00
MajorTanya aa6742bf3e Suppress more tachiyomix-related deprecations (#3409) 2026-06-14 20:47:11 +06:00
AntsyLich 4c37f4c764 Adapt source implementation for TachiyomiX 1.6 (#3243) 2026-06-13 20:34:31 +00:00
AntsyLich 430b13bb81 Adapt network implementation for TachiyomiX 1.6 (#3248) 2026-06-14 02:10:55 +06:00
AntsyLich c15f7bee85 Ensure old extension store is removed if index url changes (#3408) 2026-06-13 18:14:16 +00:00
AntsyLich 1a030420b1 Supress UnstableApiUsage in settings.gradle.kts 2026-06-13 23:57:35 +06:00
AntsyLich a6f0cec083 Use . toDrawable extension function in ImageUtil 2026-06-13 23:57:35 +06:00
AntsyLich 6ae79d255d Address various redundant constructs 2026-06-13 23:57:35 +06:00
AntsyLich 4b9974e20a Use duration overload for time related methods 2026-06-13 23:57:35 +06:00
AntsyLich 509eee5dfb Use app scoped CoroutineScope (#3403) 2026-06-12 17:14:29 +06:00
Mend Renovate 63a71fa447 Update coil to v3.5.0 (#3399) 2026-06-10 16:46:39 +00:00
AntsyLich d4327c8d48 Add auto migration support from legacy extension store index (#3398) 2026-06-10 22:29:27 +06:00
AntsyLich 5f1d76a73a Change the term "Obsolete" to "Orphaned" for extensions (#3383) 2026-06-10 13:53:01 +00:00
AntsyLich 35f6a607b8 Use our fork of sqldelight-androidx-driver (#3396) 2026-06-10 13:49:27 +00:00
Mend Renovate 378518c0fd Update firebase.bom to v34.14.1 (#3391) 2026-06-10 17:26:44 +06:00
Mend Renovate 69fb33887f Update okhttp monorepo to v5.4.0 (#3393) 2026-06-10 17:24:51 +06:00
AntsyLich f87c4d55e3 Use more sqldelight coroutines extensions 2026-06-07 18:01:17 +06:00
AntsyLich c612a6ca8d Extract badge data separately when forming LibraryItem (#3382) 2026-06-04 18:25:42 +00:00
AntsyLich a1ad33baef Remove redundant compiler argument for annotation default target 2026-06-05 00:08:21 +06:00
Mend RenovateandAntsyLich 8c27bc07fc Update androidx.core to v1.19.0 (#3379)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-04 16:27:41 +00:00
AntsyLich 95bc599ac0 Add paddings to vertical chapter navigator 2026-06-04 10:07:35 +06:00
AntsyLich cd27b10750 Drop kotlinx-collections-immutable usage (#3380) 2026-06-03 20:45:24 +00:00
Mend Renovate 7f8851de6a Update androidx.compose.bom to v2026.05.02 (#3378) 2026-06-03 20:05:01 +00:00
AntsyLich a330258f6a Add vertical chapter navigator for long strip mode (#3377) 2026-06-03 19:54:52 +00:00
AntsyLich d28c605a89 Remove redundant compiler argument for context parameter 2026-06-04 00:12:30 +06:00
Mend Renovate 87c1675882 Update kotlin monorepo to v2.4.0 (#3375) 2026-06-03 22:20:18 +06:00
AntsyLich b446d2a6b1 Change extension repo to extension store and add support for newer extension index format (#3349) 2026-06-03 06:35:44 +06:00
YohanesandAntsyLich 748211c19b Add missing outlineVariant color to Nord theme (#3184)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-02 22:57:59 +00:00
IDika31 1fd02d0c82 Use RECEIVER_NOT_EXPORTED for ShizukuInstaller broadcast receiver (#3356) 2026-06-02 20:43:42 +00:00
Mend RenovateandAntsyLich 4951f0bddd Update markdown to v0.41.0 (#3194)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-02 20:38:53 +00:00
Mend Renovate d391566832 Update GitHub Actions to v6.0.3 (#3374) 2026-06-03 02:21:44 +06:00
Mend Renovate 0b564f1f20 Update androidx.paging to v3.5.0 (#3301) 2026-05-30 16:10:05 +06:00
Mend Renovate b639e44a03 Update dependency io.mockk:mockk to v1.14.11 (#3363) 2026-05-30 16:08:14 +06:00
Mend Renovate f68c1bcc9e Update dependency com.google.firebase:firebase-bom to v34.14.0 (#3362) 2026-05-30 16:07:50 +06:00
Mend Renovate 4fabe9b405 Update spotless to v8.6.0 (#3357) 2026-05-30 16:07:10 +06:00
Mend Renovate ae3aa7926a Update aboutLibraries to v14.2.1 (#3343) 2026-05-25 14:15:12 +06:00
Mend Renovate 82338d7d64 Update dependency androidx.compose:compose-bom-alpha to v2026.05.01 (#3334) 2026-05-22 14:50:44 +06:00
Mend Renovate 3b94df6108 Update dependency org.junit.jupiter:junit-jupiter to v6.1.0 (#3335) 2026-05-22 14:49:38 +06:00
Mend Renovate 5bb92a75c7 Update spotless to v8.5.1 (#3322) 2026-05-22 14:49:15 +06:00
Mend Renovate 48179083f1 Update Gradle to v9.5.1 (#3315) 2026-05-14 22:33:12 +06:00
AntsyLich b4a3ec0b32 Fix chapters and categories not being added to database
Closes #3278
Fixes #3291
2026-05-12 02:04:58 +06:00
Mend Renovate cb2a0ea570 Update dependency com.mohamedrejeb.richeditor:richeditor-compose to v1.0.0-rc14 (#3271) 2026-05-12 01:29:31 +06:00
AntsyLich 9c3519046f Remove redundant KGP classpath in :app 2026-05-08 22:54:02 +06:00
Mend Renovate da9b5d9b9d Update dependency com.eygraber:sqldelight-androidx-driver to v0.2.0 (#3292) 2026-05-08 22:53:11 +06:00
Mend Renovate 09d3e16183 Update aboutLibraries to v14.2.0 (#3283) 2026-05-08 22:52:17 +06:00
Mend Renovate cfefa51296 Update dependency com.google.firebase:firebase-bom to v34.13.0 (#3303) 2026-05-08 22:49:00 +06:00
Mend Renovate b65825b3ca Update dependency androidx.compose:compose-bom-alpha to v2026.05.00 (#3302) 2026-05-08 22:48:08 +06:00
Mend Renovate 981b16094a Update kotlinx-coroutines monorepo to v1.11.0 (#3305) 2026-05-08 22:39:25 +06:00
Mend Renovate bb877e4b26 Update moko.resources to v0.26.4 (#3297) 2026-05-06 18:01:53 +06:00
Mend Renovate 5b8adfbdb0 Update android.gradle to v9.2.1 (#3294) 2026-05-06 17:50:41 +06:00
Mend Renovate 9678b8fd79 Update Gradle to v9.5.0 (#3274) 2026-04-28 23:30:39 +06:00
AntsyLich 8e0c911f93 Update sqldelight-androidx-driver and remove transaction management (#3270)
`sqldelight-androidx-driver` has it's own transaction management
2026-04-27 18:24:30 +06:00
AntsyLich a2f3ec94aa Reapply "Update android.gradle to v9 (major) (#3105)" (#3148) 2026-04-25 12:06:41 +06:00
AntsyLich 38ccd7d5fc Update dependency image-decoder to e03b81e18a (#3262) 2026-04-25 01:17:32 +00:00
Mend Renovate 4faf89fc6f Update dependency androidx.compose:compose-bom-beta to v2026.04.01 (#3256) 2026-04-24 19:38:45 +06:00
Mend Renovate 5b32a990a2 Update dependency sh.calvin.reorderable:reorderable to v3.1.0 (#3251) 2026-04-24 00:54:21 +06:00
Mend Renovate cb6daa5e4c Update kotlin monorepo to v2.3.21 (#3258) 2026-04-24 00:53:40 +06:00
Mend Renovate d68347f5fb Update softprops/action-gh-release action to v2.6.2 (#3230) 2026-04-20 17:55:44 +06:00
Mend Renovate e676c8e6e1 Update dependency com.gradleup.tapmoc:tapmoc-gradle-plugin to v0.4.2 (#3232) 2026-04-20 17:55:23 +06:00
Mend Renovate 34fa9138d9 Update dependency org.jsoup:jsoup to v1.22.2 (#3245) 2026-04-20 17:49:30 +06:00
AntsyLich 7a917968e3 Release v0.19.9 2026-04-11 14:17:30 +06:00
AntsyLich 5f548243e1 Revert "Remove usage of deprecated LocalBroadcastManager (#3215)"
This reverts commit b201ed163e.
2026-04-11 14:13:15 +06:00
AntsyLich 34d22e9495 Revert "Update dependency com.google.android.material:material to v1.13.0 (#3104)"
This reverts commit 1712b9cdc5.
2026-04-11 14:13:10 +06:00
1176 changed files with 113409 additions and 60242 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ body:
required: true
- label: I have written a short but informative title.
required: true
- label: I have updated the app to version **[0.19.8](https://github.com/mihonapp/mihon/releases/latest)**.
- label: I have updated the app to version **[0.21.2](https://github.com/mihonapp/mihon/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
+2 -2
View File
@@ -52,7 +52,7 @@ body:
label: Mihon version
description: You can find your Mihon version in **More → About**.
placeholder: |
Example: "0.19.8"
Example: "0.21.2"
validations:
required: true
@@ -95,7 +95,7 @@ body:
required: true
- label: I have gone through the [FAQ](https://mihon.app/docs/faq/general) and [troubleshooting guide](https://mihon.app/docs/guides/troubleshooting/).
required: true
- label: I have updated the app to version **[0.19.8](https://github.com/mihonapp/mihon/releases/latest)**.
- label: I have updated the app to version **[0.21.2](https://github.com/mihonapp/mihon/releases/latest)**.
required: true
- label: I have filled out all of the requested information in this form, including specific version numbers.
required: true
+15 -12
View File
@@ -4,6 +4,7 @@ on:
paths:
- '**'
- '!**.md'
- '!fastlane/**'
- '!i18n/src/commonMain/moko-resources/**/strings.xml'
- '!i18n/src/commonMain/moko-resources/**/plurals.xml'
- 'i18n/src/commonMain/moko-resources/base/strings.xml'
@@ -22,53 +23,55 @@ permissions:
jobs:
build:
name: Build & Test App
runs-on: 'ubuntu-24.04'
runs-on: 'ubuntu-26.04'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Dependency Review
if: github.event_name == 'pull_request'
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version-file: .github/.java-version
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Check code format
run: ./gradlew spotlessCheck
- name: Run unit tests
id: unit_tests
run: ./gradlew testReleaseUnitTest
run: ./gradlew testDebugUnitTest
- name: Verify SQLDelight migrations
run: ./gradlew verifySqlDelightMigration
- name: Upload test report
if: steps.unit_tests.outcome == 'failure'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-report-${{ github.sha }}
path: app/build/reports/tests/testReleaseUnitTest
path: app/build/reports/tests/testDebugUnitTest
- name: Build app
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
run: ./gradlew assembleRelease -Pdist=ci
- name: Upload APK
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: arm64-v8a-${{ github.sha }}
path: app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk
path: app/build/outputs/apk/release/app-arm64-v8a-release.apk
- name: Upload mapping
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: mapping-${{ github.sha }}
path: app/build/outputs/mapping/release
+50 -45
View File
@@ -4,6 +4,9 @@ on:
tags:
- v*
env:
MIHON_GITHUB_RELEASE: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -12,7 +15,7 @@ jobs:
get_tag:
if: github.repository == 'mihonapp/mihon'
name: Extract tag name
runs-on: 'ubuntu-24.04'
runs-on: 'ubuntu-26.04'
outputs:
tag: ${{ steps.extract.outputs.tag }}
@@ -24,48 +27,49 @@ jobs:
build:
if: github.repository == 'mihonapp/mihon'
name: Build
runs-on: 'ubuntu-24.04'
runs-on: 'ubuntu-26.04'
needs: get_tag
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version-file: .github/.java-version
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Decode signing keystore
run: echo "$SIGNING_KEY" | base64 -d > "${{ runner.temp }}/antsy.keystore"
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Build
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
- name: Sign APK
uses: r0adkll/sign-android-release@a391126403df92c6a0a3988a829dd47f79b89ed7
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
run: ./gradlew assembleRelease -Pdist=github
env:
BUILD_TOOLS_VERSION: '35.0.1'
storeFile: ${{ runner.temp }}/antsy.keystore
storePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyAlias: ${{ secrets.ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Rename APK
run: |
set -e
mv app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk mihon-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-arm64-v8a-release-unsigned-signed.apk mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-armeabi-v7a-release-unsigned-signed.apk mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-x86-release-unsigned-signed.apk mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-universal-release.apk mihon-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-arm64-v8a-release.apk mihon-arm64-v8a-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-armeabi-v7a-release.apk mihon-armeabi-v7a-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-x86-release.apk mihon-x86-${{ needs.get_tag.outputs.tag }}.apk
mv app/build/outputs/apk/release/app-x86_64-release.apk mihon-x86_64-${{ needs.get_tag.outputs.tag }}.apk
- name: Upload APK
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: mihon
path: |
@@ -78,46 +82,45 @@ jobs:
build_foss:
if: github.repository == 'mihonapp/mihon'
name: Build (FOSS)
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
needs: get_tag
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version-file: .github/.java-version
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-disabled: true
- name: Build
run: ./gradlew assembleFoss -Penable-updater
- name: Sign APK
uses: r0adkll/sign-android-release@a391126403df92c6a0a3988a829dd47f79b89ed7
with:
releaseDirectory: app/build/outputs/apk/foss
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Decode signing keystore
run: echo "$SIGNING_KEY" | base64 -d > "${{ runner.temp }}/antsy.keystore"
env:
BUILD_TOOLS_VERSION: '35.0.1'
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Build
run: ./gradlew assembleFoss -Pdist=foss
env:
storeFile: ${{ runner.temp }}/antsy.keystore
storePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyAlias: ${{ secrets.ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Rename APK
run: |
set -e
mv app/build/outputs/apk/foss/app-universal-foss-unsigned-signed.apk mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
mv app/build/outputs/apk/foss/app-universal-foss.apk mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
- name: Upload APK
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: mihon-foss
path: mihon-${{ needs.get_tag.outputs.tag }}-foss.apk
@@ -125,17 +128,17 @@ jobs:
release:
if: github.repository == 'mihonapp/mihon'
name: Create GitHub Release
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
needs: [get_tag, build, build_foss]
steps:
- name: Download all artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
merge-multiple: true
- name: Delete all artifacts
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0
with:
failOnError: false
name: |
@@ -143,12 +146,14 @@ jobs:
mihon-foss
- name: Create GitHub Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ needs.get_tag.outputs.tag }}
name: Mihon ${{ needs.get_tag.outputs.tag }}
body: |
Check out the [past release notes](https://github.com/mihonapp/mihon/releases) if you're upgrading from an earlier version. Consider [becoming a patron](https://www.patreon.com/mihon/membership) to help keep Mihon improving!
Consider supporting the development on [Patreon](https://www.patreon.com/mihon/membership) or [OpenCollective](https://opencollective.com/mihon/contribute) to keep Mihon improving!
Check out the [past release notes](https://github.com/mihonapp/mihon/releases) if you're upgrading from an earlier version.
<!-->
+1 -1
View File
@@ -9,7 +9,7 @@ on:
jobs:
update_website:
runs-on: 'ubuntu-24.04'
runs-on: 'ubuntu-26.04'
steps:
- name: Update website
+1
View File
@@ -10,6 +10,7 @@ build
/captures
# Configuration files
keystore.properties
local.properties
# macOS specific files
+299 -2
View File
@@ -11,6 +11,294 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
- `Other` - for technical stuff.
## [Unreleased]
### Added
- Add experimental high quality reader renderer (Settings → Advanced → Use high quality renderer) with better image scaling, page transition animations, dual page view and display cutout handling ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3388](https://github.com/mihonapp/mihon/pull/3388))
- Match background and transition page colors to the old reader ([@AntsyLich](https://github.com/AntsyLich)) ([#3765](https://github.com/mihonapp/mihon/pull/3765))
- Support the Fit width, Fit height and Original size scale types and the zoom start position ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3801](https://github.com/mihonapp/mihon/pull/3801))
- Fix preloading and navigation across chapters, and right-to-left navigation ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3823](https://github.com/mihonapp/mihon/pull/3823))
- Add a "None" page transition and fix the background color of animated images ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3843](https://github.com/mihonapp/mihon/pull/3843))
- Improve transition and error pages, dual page animations and border cropping ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3852](https://github.com/mihonapp/mihon/pull/3852))
- Fix navigation directions and long strip bounds, and fade in loaded pages ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3870](https://github.com/mihonapp/mihon/pull/3870))
- Add a "Page flip" transition, a long strip minimum width setting and separate dual page settings, and show wide pages on their own in dual page view ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3886](https://github.com/mihonapp/mihon/pull/3886))
- Fix freezes and running out of memory when jumping between pages with the slider ([@Danidukiyu](https://github.com/Danidukiyu)) ([#3872](https://github.com/mihonapp/mihon/pull/3872))
- Add HDR, ICC color profile and EXIF orientation support ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3933](https://github.com/mihonapp/mihon/pull/3933))
- Add a page gap setting for long strip with gaps and a "Disable zoom out" setting for long strip modes ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3933](https://github.com/mihonapp/mihon/pull/3933))
- Fix a crash on Android 15 and long strip progress and background color ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3949](https://github.com/mihonapp/mihon/pull/3949))
- Keep the reader menu open while moving through pages with the slider ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3956](https://github.com/mihonapp/mihon/pull/3956))
- Show pages progressively while they download ([@wwww-wwww](https://github.com/wwww-wwww)) ([#4023](https://github.com/mihonapp/mihon/pull/4023))
- Lower memory use for animated images and support cropping borders in long strip ([@wwww-wwww](https://github.com/wwww-wwww)) ([#4029](https://github.com/mihonapp/mihon/pull/4029))
- Pair more wide pages in dual page view by comparing them with neighbouring pages ([@wwww-wwww](https://github.com/wwww-wwww)) ([#4051](https://github.com/mihonapp/mihon/pull/4051))
### Changed
- Use a new decoder for images Android can't decode itself, like AVIF, JPEG XL and HEIF, and support JPEG 2000 images ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3786](https://github.com/mihonapp/mihon/pull/3786))
### Improved
- Create and restore backups faster and with less memory ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken), [@AntsyLich](https://github.com/AntsyLich))
### Removed
- Remove "Custom hardware bitmap threshold" and "Custom display profile" advanced settings ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3786](https://github.com/mihonapp/mihon/pull/3786))
## [v0.21.2] - 2026-10-13
### Fixed
- Fix long floating point numbers showing up in Comick progress ([@MajorTanya](https://github.com/MajorTanya)) ([#4090](https://github.com/mihonapp/mihon/pull/4090))
- Fixed updating from v0.20.x failing when the database had duplicate history or tracking entries, or damaged indexes ([@AntsyLich](https://github.com/AntsyLich)) ([`ea2b73a`](https://github.com/mihonapp/mihon/commit/ea2b73a))
- Fixed a crash when a back gesture was still in progress as the reader or a dialog closed ([@AntsyLich](https://github.com/AntsyLich)) ([`43de88c`](https://github.com/mihonapp/mihon/commit/43de88c))
- Fixed Kitsu login and other requests that send data failing with "Failed to bypass Cloudflare" ([@AntsyLich](https://github.com/AntsyLich)) ([`7ae858e`](https://github.com/mihonapp/mihon/commit/7ae858e))
- Fixed tracker start date being off by a day when adding tracking to an entry with read history in some timezones ([@hazptr](https://github.com/hazptr)) ([#4049](https://github.com/mihonapp/mihon/pull/4049))
- Fixed the paged reader crashing when moving to another chapter after a wide page of a neighbouring chapter was split ([@AntsyLich](https://github.com/AntsyLich)) ([`3156b4a`](https://github.com/mihonapp/mihon/commit/3156b4a))
- Fixed a crash when opening the filters of a source with an invalid filter ([@AntsyLich](https://github.com/AntsyLich)) ([`c9e1b6e`](https://github.com/mihonapp/mihon/commit/c9e1b6e))
- Fixed a crash when installing an extension on a device where the system installer can't ask for confirmation ([@AntsyLich](https://github.com/AntsyLich)) ([`2df48e1`](https://github.com/mihonapp/mihon/commit/2df48e1))
- Fixed a crash when tapping in the long strip reader as it closed ([@AntsyLich](https://github.com/AntsyLich)) ([`c371d63`](https://github.com/mihonapp/mihon/commit/c371d63))
- Fixed chapters downloaded before v0.21.0 showing as not downloaded when their name started with a space or dot, was long, or had a non-ASCII scanlator ([@AntsyLich](https://github.com/AntsyLich)) ([`f0f1e4d`](https://github.com/mihonapp/mihon/commit/f0f1e4d))
- Fixed slowdowns and running out of memory when many requests to a site hit a Cloudflare challenge at once ([@tigeryu8900](https://github.com/tigeryu8900), [@AntsyLich](https://github.com/AntsyLich)) ([`5a5ff22`](https://github.com/mihonapp/mihon/commit/5a5ff22))
## [v0.21.1] - 2026-10-12
### Fixed
- Fixed refreshing chapters failing with the app language set to Arabic or another language with its own digits ([@AntsyLich](https://github.com/AntsyLich)) ([`8457fb9`](https://github.com/mihonapp/mihon/commit/8457fb9))
- Fixed a crash on launch on some Samsung devices running Android 9 to 11 ([@AntsyLich](https://github.com/AntsyLich)) ([`abb126a`](https://github.com/mihonapp/mihon/commit/abb126a))
- Fixed the start and resume button going under the taskbar on tablets ([@AntsyLich](https://github.com/AntsyLich)) ([`c279291`](https://github.com/mihonapp/mihon/commit/c279291))
- Fixed a crash when updating an extension while others were installing ([@AntsyLich](https://github.com/AntsyLich)) ([`07b9fb6`](https://github.com/mihonapp/mihon/commit/07b9fb6))
- Fixed library entries without a date added getting their last update time as date added when updating from v0.20.x ([@AntsyLich](https://github.com/AntsyLich)) ([`6dffca1`](https://github.com/mihonapp/mihon/commit/6dffca1))
- Fixed the app closing when WebView's page process crashed ([@AntsyLich](https://github.com/AntsyLich)) ([`649fc83`](https://github.com/mihonapp/mihon/commit/649fc83))
- Fixed installing or updating an extension sometimes cancelling the install of another one ([@AntsyLich](https://github.com/AntsyLich)) ([`ae749bb`](https://github.com/mihonapp/mihon/commit/ae749bb))
- Fixed updating from v0.20.x taking up to hours on libraries with many duplicate entries ([@AntsyLich](https://github.com/AntsyLich)) ([`a999e49`](https://github.com/mihonapp/mihon/commit/a999e49))
- Fixed the app staying on the updating screen for good when updating its data failed, it now shows what went wrong, and updating failing on leftover data of deleted entries ([@AntsyLich](https://github.com/AntsyLich)) ([`9dbb714`](https://github.com/mihonapp/mihon/commit/9dbb714))
- Fixed library updates ignoring the smart update restrictions for entries whose details were never fetched ([@AntsyLich](https://github.com/AntsyLich)) ([`010ac71`](https://github.com/mihonapp/mihon/commit/010ac71))
- Fixed resuming a chapter sometimes opening the next chapter partway through, and saving progress to it, in the right to left reader ([@AntsyLich](https://github.com/AntsyLich)) ([`51b61a3`](https://github.com/mihonapp/mihon/commit/51b61a3))
## [v0.21.0] - 2026-10-12
### Added
- Add `id:` prefix search to remaining trackers (AniList, Bangumi, Kitsu, MangaUpdates, Shikimori, and Hikka) ([@MajorTanya](https://github.com/MajorTanya), [@BrutuZ](https://github.com/BrutuZ)) ([#3776](https://github.com/mihonapp/mihon/pull/3776))
- Allow `id:` to search for slugs on Kitsu ([@MajorTanya](https://github.com/MajorTanya)) ([#3792](https://github.com/mihonapp/mihon/pull/3792))
- Add support for using the user's chosen rating system for Kitsu ([@MajorTanya](https://github.com/MajorTanya)) ([#3818](https://github.com/mihonapp/mihon/pull/3818))
- Fix a crash after logging in to Kitsu caused by the rating system's letter case ([@Secozzi](https://github.com/Secozzi)) ([#3887](https://github.com/mihonapp/mihon/pull/3887))
- Add option to keep loading installed extensions regardless of the allowed content warnings ([@AntsyLich](https://github.com/AntsyLich)) ([#3952](https://github.com/mihonapp/mihon/pull/3952))
- Read chapter dates from the Year, Month, and Day fields of ComicInfo.xml in local source, and write them when downloading chapters ([@MajorTanya](https://github.com/MajorTanya)) ([#3967](https://github.com/mihonapp/mihon/pull/3967))
- Fix wrongly padded years and months above 12 in local source dates ([@MajorTanya](https://github.com/MajorTanya)) ([#3970](https://github.com/mihonapp/mihon/pull/3970))
- Add refresh buttons to trackers in Settings to update displayed usernames & rating systems (where supported) ([@MajorTanya](https://github.com/MajorTanya)) ([#3828](https://github.com/mihonapp/mihon/pull/3828))
- Add option to turn off the hash suffix in downloaded chapter folder names (Settings → Advanced). It stays on for existing installs ([@choppeh](https://github.com/choppeh), [@AntsyLich](https://github.com/AntsyLich)) ([#3966](https://github.com/mihonapp/mihon/pull/3966))
- Fixed downloads not being found when the scanlator name contains a "/" ([@AntsyLich](https://github.com/AntsyLich)) ([`a5d584e`](https://github.com/mihonapp/mihon/commit/a5d584e))
- Show a screen while the app migrates its data after an update ([@AntsyLich](https://github.com/AntsyLich)) ([`fd4f73c`](https://github.com/mihonapp/mihon/commit/fd4f73c))
- Keep the screen up for at least a second so it doesn't just flash by ([@AntsyLich](https://github.com/AntsyLich)) ([`b454c1b`](https://github.com/mihonapp/mihon/commit/b454c1b))
- Add option to skip an app update version ([@AntsyLich](https://github.com/AntsyLich)) ([`fc20410`](https://github.com/mihonapp/mihon/commit/fc20410))
- Add support for [Comick](https://comick.dev) tracker ([@MajorTanya](https://github.com/MajorTanya)) ([#4056](https://github.com/mihonapp/mihon/pull/4056))
### Changed
- Download app updates from the update screen instead of a background job, and remove the "App updates" notification channel ([@AntsyLich](https://github.com/AntsyLich)) ([#3707](https://github.com/mihonapp/mihon/pull/3707))
- Switch app icons to Material Symbols ([@AntsyLich](https://github.com/AntsyLich)) ([#3873](https://github.com/mihonapp/mihon/pull/3873))
- Use the filled icon for the library continue reading button ([@AntsyLich](https://github.com/AntsyLich)) ([`34a33ed`](https://github.com/mihonapp/mihon/commit/34a33ed))
- Move notification, launcher shortcut, bottom navigation and reading mode icons to Material Symbols, bring back filled icons where the switch dropped them, and show a compact grid icon for the compact display modes ([@AntsyLich](https://github.com/AntsyLich)) ([#4057](https://github.com/mihonapp/mihon/pull/4057))
- Replace the NSFW sources toggle with allowed content warnings (Safe, Mixed, 18+) for extensions ([@AntsyLich](https://github.com/AntsyLich)) ([#3951](https://github.com/mihonapp/mihon/pull/3951))
- Restoring a backup over an existing library now keeps existing entry details, the furthest read progress and the earliest date added ([@AntsyLich](https://github.com/AntsyLich)) ([`c67a33f`](https://github.com/mihonapp/mihon/commit/c67a33f))
- Install and update extensions only from a repo whose signing key matches the extension, and reject downloaded extensions not signed with their repo's key ([@AntsyLich](https://github.com/AntsyLich)) ([`0938411`](https://github.com/mihonapp/mihon/commit/0938411))
- Keep the repo shown for an installed extension current when repos are renamed or removed ([@AntsyLich](https://github.com/AntsyLich)) ([`09edf7d`](https://github.com/mihonapp/mihon/commit/09edf7d))
- Show the repo name in extension details, opening the repo's website, instead of the "Open source repo" button ([@AntsyLich](https://github.com/AntsyLich)) ([#3955](https://github.com/mihonapp/mihon/pull/3955))
- Rework the database schema, merging duplicate entries and chapters left by older versions. The merge can't be undone, so create a backup before updating ([@AntsyLich](https://github.com/AntsyLich)) ([#3805](https://github.com/mihonapp/mihon/pull/3805))
- Fixed restoring a backup failing on entries that list a category or excluded scanlator twice ([@AntsyLich](https://github.com/AntsyLich)) ([#4022](https://github.com/mihonapp/mihon/pull/4022))
- List MangaBaka first among trackers ([@AntsyLich](https://github.com/AntsyLich)) ([`dd46413`](https://github.com/mihonapp/mihon/commit/dd46413))
- Show a wavy progress ring while a chapter downloads ([@AntsyLich](https://github.com/AntsyLich)) ([`e562a9b`](https://github.com/mihonapp/mihon/commit/e562a9b))
- Show a confirmation dialog when unfavoriting manga from the manga screen ([@WizaHX](https://github.com/WizaHX)) ([#4073](https://github.com/mihonapp/mihon/pull/4073))
### Improved
- Show the updates and upcoming filter icon as active when filtering by category, or by hidden excluded scanlators in updates ([@Secozzi](https://github.com/Secozzi)) ([#3772](https://github.com/mihonapp/mihon/pull/3772))
- Load extensions in the background to speed up app startup ([@AntsyLich](https://github.com/AntsyLich)) ([#3788](https://github.com/mihonapp/mihon/pull/3788))
- Wait for extensions to load before listing sources, so lists and global search aren't empty right after launch ([@AntsyLich](https://github.com/AntsyLich)) ([#3841](https://github.com/mihonapp/mihon/pull/3841))
- Show scores in MangaUpdates search results (and authors for `id:` prefix searches) ([@MajorTanya](https://github.com/MajorTanya)) ([#3795](https://github.com/mihonapp/mihon/pull/3795))
- Remove whitespace from MAL and MB `id:` prefix search inputs before searching ([@MajorTanya](https://github.com/MajorTanya)) ([#3793](https://github.com/mihonapp/mihon/pull/3793))
- Detect Cloudflare challenges with Cloudflare's `cf-mitigated` header, and fail sooner when a challenge needs user interaction instead of waiting for the timeout ([@tigeryu8900](https://github.com/tigeryu8900)) ([#3842](https://github.com/mihonapp/mihon/pull/3842))
- Show a helpful error message for expired AniList credentials ([@MajorTanya](https://github.com/MajorTanya)) ([#3888](https://github.com/mihonapp/mihon/pull/3888))
- Show installed extensions that couldn't be loaded, with the reason and a copyable stack trace ([@AntsyLich](https://github.com/AntsyLich)) ([#3953](https://github.com/mihonapp/mihon/pull/3953))
- Apply extension trust, repo and content warning changes without restarting the app ([@AntsyLich](https://github.com/AntsyLich)) ([#3954](https://github.com/mihonapp/mihon/pull/3954))
- Use the system document picker when selecting a backup to restore ([@MajorTanya](https://github.com/MajorTanya)) ([#3948](https://github.com/mihonapp/mihon/pull/3948))
- Offer updates for installed extensions that aren't loaded ([@AntsyLich](https://github.com/AntsyLich)) ([`2d86a70`](https://github.com/mihonapp/mihon/commit/2d86a70))
- Show available extension updates on the Browse badge and in the Extensions tab right after launch ([@AntsyLich](https://github.com/AntsyLich)) ([`4f33486`](https://github.com/mihonapp/mihon/commit/4f33486))
- Show which repo an extension comes from in the extensions list, and list an extension once for each repo signing key offering it ([@AntsyLich](https://github.com/AntsyLich)) ([#3955](https://github.com/mihonapp/mihon/pull/3955))
- Speed up loading the library on large libraries ([@AntsyLich](https://github.com/AntsyLich)) ([#3805](https://github.com/mihonapp/mihon/pull/3805))
- Speed up history, updates, the updates widget and browse on large libraries ([@AntsyLich](https://github.com/AntsyLich)) ([#4022](https://github.com/mihonapp/mihon/pull/4022))
- Reduce lag when dragging sliders in settings ([@AntsyLich](https://github.com/AntsyLich)) ([`9409740`](https://github.com/mihonapp/mihon/commit/9409740))
- Speed up refreshing the library when returning to it ([@AntsyLich](https://github.com/AntsyLich)) ([`f027de8`](https://github.com/mihonapp/mihon/commit/f027de8))
- Download a source's chapters faster by starting the next one while the current one finishes ([@AntsyLich](https://github.com/AntsyLich)) ([`730e43f`](https://github.com/mihonapp/mihon/commit/730e43f))
- Load an entry's cover once when several updates show it ([@AntsyLich](https://github.com/AntsyLich)) ([`1f85a5a`](https://github.com/mihonapp/mihon/commit/1f85a5a))
- Speed up the entry details chapter list on entries with many chapters, and the updates list when many chapters are queued for download ([@AntsyLich](https://github.com/AntsyLich)) ([`fb8e640`](https://github.com/mihonapp/mihon/commit/fb8e640))
- Speed up checking which chapters are downloaded ([@AntsyLich](https://github.com/AntsyLich)) ([`6a32938`](https://github.com/mihonapp/mihon/commit/6a32938))
- Stop the entry details screen from refreshing its chapter list in the background while reading ([@AntsyLich](https://github.com/AntsyLich)) ([`7ff9776`](https://github.com/mihonapp/mihon/commit/7ff9776))
- Speed up opening the library on large libraries by loading tracker entries only for tracker filters and sorting ([@AntsyLich](https://github.com/AntsyLich)) ([`940272f`](https://github.com/mihonapp/mihon/commit/940272f))
- Speed up the library query on large libraries ([@AntsyLich](https://github.com/AntsyLich)) ([`5df78e3`](https://github.com/mihonapp/mihon/commit/5df78e3))
- Speed up the statistics screen on large libraries ([@AntsyLich](https://github.com/AntsyLich)) ([`179bfac`](https://github.com/mihonapp/mihon/commit/179bfac))
- Find settings by their group heading in settings search ([@kaosjammo](https://github.com/kaosjammo), [@AntsyLich](https://github.com/AntsyLich)) ([#4044](https://github.com/mihonapp/mihon/pull/4044))
- Predict the next library update from release patterns such as fixed weekdays or a day of the month, ignore chapters dated in the future, and include the predicted date in backups ([@AntsyLich](https://github.com/AntsyLich)) ([`2923816`](https://github.com/mihonapp/mihon/commit/2923816))
- Also follow two days of the month, a weekday of the month, releases in batches and breaks between seasons, and never wait more than 28 days between checks ([@AntsyLich](https://github.com/AntsyLich)) ([`ba44815`](https://github.com/mihonapp/mihon/commit/ba44815))
- Recognize chapter numbers more accurately by looking at neighbouring chapters, and stop taking volume numbers or numbers every chapter name shares as the chapter number ([@AntsyLich](https://github.com/AntsyLich)) ([`e42e010`](https://github.com/mihonapp/mihon/commit/e42e010))
- Move blocking work off the main thread across the app for fewer freezes and stutters ([@AntsyLich](https://github.com/AntsyLich)) ([#4068](https://github.com/mihonapp/mihon/pull/4068))
- Load reader pages in parallel and preload the rest of the chapter and the next chapter, with a "Load ahead only on Wi-Fi" setting to save mobile data ([@AntsyLich](https://github.com/AntsyLich)) ([#2986](https://github.com/mihonapp/mihon/pull/2986))
- Cache extension and source icons so lists show them faster ([@AntsyLich](https://github.com/AntsyLich)) ([`b15af71`](https://github.com/mihonapp/mihon/commit/b15af71))
- Keep screens loaded while they're hidden so switching back to them is faster ([@AntsyLich](https://github.com/AntsyLich)) ([#4071](https://github.com/mihonapp/mihon/pull/4071))
- Speed up the migration list, the extensions list and settings search ([@AntsyLich](https://github.com/AntsyLich)) ([#4071](https://github.com/mihonapp/mihon/pull/4071))
- Cancel the previous tracker search when searching again ([@AntsyLich](https://github.com/AntsyLich)) ([#4071](https://github.com/mihonapp/mihon/pull/4071))
- Do less background work while reading, downloading and updating the library, and when no updates widget is placed ([@AntsyLich](https://github.com/AntsyLich)) ([#4071](https://github.com/mihonapp/mihon/pull/4071))
- Speed up loading extension repos at startup ([@AntsyLich](https://github.com/AntsyLich)) ([`8066b8d`](https://github.com/mihonapp/mihon/commit/8066b8d))
- Speed up opening the entry details screen and showing download progress there and in updates ([@AntsyLich](https://github.com/AntsyLich)) ([`ba16158`](https://github.com/mihonapp/mihon/commit/ba16158))
- Speed up queueing many chapters for download at once ([@AntsyLich](https://github.com/AntsyLich)) ([`f02bf5b`](https://github.com/mihonapp/mihon/commit/f02bf5b))
### Removed
- Remove "Use legacy decoder for long strip reader" advanced setting, since long strip pages no longer load as one big image ([@AntsyLich](https://github.com/AntsyLich))
### Fixed
- Fixed app and extension update check running again on configuration change ([@AntsyLich](https://github.com/AntsyLich)) ([#3708](https://github.com/mihonapp/mihon/pull/3708))
- Fixed MangaBaka user start/finish dates drifting in negative offset timezones ([@MajorTanya](https://github.com/MajorTanya)) ([#3711](https://github.com/mihonapp/mihon/pull/3711))
- Fixed MangaBaka scores being wrong when score step size was set to > 1, and being counted 10 times too high in library sorting by tracker score and in statistics ([@MajorTanya](https://github.com/MajorTanya)) ([#3740](https://github.com/mihonapp/mihon/pull/3740))
- Fixed tracking an entry on Shikimori failing with "Unknown status: 0" when it isn't in your Shikimori list ([@MajorTanya](https://github.com/MajorTanya)) ([#3810](https://github.com/mihonapp/mihon/pull/3810))
- Fixed default category and manga sometimes not getting their category set when restoring a backup ([@Secozzi](https://github.com/Secozzi)) ([#3891](https://github.com/mihonapp/mihon/pull/3891))
- Fixed text between dollar signs disappearing from descriptions and notes ([@renovate](https://github.com/apps/renovate)) ([#3806](https://github.com/mihonapp/mihon/pull/3806))
- Fixed AniList requests failing with rate limit errors by lowering the request rate to AniList's current limit ([@MajorTanya](https://github.com/MajorTanya)) ([#3942](https://github.com/mihonapp/mihon/pull/3942))
- Fixed library search when clicking source name in manga info screen ([@choppeh](https://github.com/choppeh)) ([#4002](https://github.com/mihonapp/mihon/pull/4002))
- Fixed entries being incorrectly marked as duplicates when tracked with some trackers ([@Secozzi](https://github.com/Secozzi)) ([#4008](https://github.com/mihonapp/mihon/pull/4008))
- Fixed the default chapter settings not being applied to entries added to the library from a source by long pressing them ([@AntsyLich](https://github.com/AntsyLich)) ([`f8fff31`](https://github.com/mihonapp/mihon/commit/f8fff31))
- Fixed chapter list updates being partially applied when a refresh fails, and sources that list a chapter twice adding it twice ([@AntsyLich](https://github.com/AntsyLich)) ([`6ee529c`](https://github.com/mihonapp/mihon/commit/6ee529c))
- Fixed downloads of entries from uninstalled extensions sometimes not being recognized ([@AntsyLich](https://github.com/AntsyLich)) ([`0044cc7`](https://github.com/mihonapp/mihon/commit/0044cc7))
- Fixed a removed extension repo coming back when it was removed while repos were refreshing ([@AntsyLich](https://github.com/AntsyLich)) ([`fc5592f`](https://github.com/mihonapp/mihon/commit/fc5592f))
- Fixed being able to rename a category to an empty name ([@AntsyLich](https://github.com/AntsyLich)) ([`8bfa495`](https://github.com/mihonapp/mihon/commit/8bfa495))
- Fixed reading time sometimes being counted twice, and tracker start dates being set to 1970 after removing history ([@AntsyLich](https://github.com/AntsyLich)) ([`553762f`](https://github.com/mihonapp/mihon/commit/553762f))
- Fixed chapters from excluded scanlators failing to open from notifications or links ([@AntsyLich](https://github.com/AntsyLich)) ([`2b4b847`](https://github.com/mihonapp/mihon/commit/2b4b847))
- Fixed queued offline tracker updates being lost when the track was refreshed ([@AntsyLich](https://github.com/AntsyLich)) ([`9a77bae`](https://github.com/mihonapp/mihon/commit/9a77bae))
- Fixed restoring a backup mixing up tracker entries of an entry that was already tracked ([@AntsyLich](https://github.com/AntsyLich)) ([`4b48a84`](https://github.com/mihonapp/mihon/commit/4b48a84))
- Fixed crashes from APIs extensions use being removed from release builds ([@AntsyLich](https://github.com/AntsyLich)) ([`6dfa10f`](https://github.com/mihonapp/mihon/commit/6dfa10f))
- Fixed the download service staying alive after downloads stopped for a network change ([@AntsyLich](https://github.com/AntsyLich)) ([`01d302f`](https://github.com/mihonapp/mihon/commit/01d302f))
- Fixed "database is locked" crashes ([@AntsyLich](https://github.com/AntsyLich)) ([`38e9308`](https://github.com/mihonapp/mihon/commit/38e9308))
- Use WAL journaling on every device ([@AntsyLich](https://github.com/AntsyLich)) ([`61cd786`](https://github.com/mihonapp/mihon/commit/61cd786))
- Fixed global search leaking threads each time it was opened ([@choppeh](https://github.com/choppeh)) ([#4036](https://github.com/mihonapp/mihon/pull/4036))
- Fixed sources getting stuck loading in global and migration search ([@choppeh](https://github.com/choppeh)) ([#4037](https://github.com/mihonapp/mihon/pull/4037))
- Fixed webtoon reader leaving a gap after zooming in split screen or a resized window ([@AntsyLich](https://github.com/AntsyLich)) ([`d1c5c12`](https://github.com/mihonapp/mihon/commit/d1c5c12))
- Fixed download error notifications showing an old time and the previous warning's text ([@AntsyLich](https://github.com/AntsyLich)) ([`f82a7a6`](https://github.com/mihonapp/mihon/commit/f82a7a6))
- Fixed the paused downloads notification not appearing ([@AntsyLich](https://github.com/AntsyLich)) ([`7aacaa3`](https://github.com/mihonapp/mihon/commit/7aacaa3))
- Fixed duplicate page files and failed downloads after pausing and resuming downloads ([@AntsyLich](https://github.com/AntsyLich)) ([`6490c41`](https://github.com/mihonapp/mihon/commit/6490c41))
- Fixed high CPU use on the entry details and updates screens while many chapters are queued for download ([@AntsyLich](https://github.com/AntsyLich)) ([`9a6dea8`](https://github.com/mihonapp/mihon/commit/9a6dea8))
- Fixed backups dropping the names of sources whose extension isn't installed, which left them blank under missing sources when restoring ([@AntsyLich](https://github.com/AntsyLich)) ([`5910a51`](https://github.com/mihonapp/mihon/commit/5910a51))
- Fixed the updates widget showing "Can't show content" when there are no recent updates or app lock is on ([@AntsyLich](https://github.com/AntsyLich)) ([`76b146f`](https://github.com/mihonapp/mihon/commit/76b146f))
- Fixed a crash when range selecting library entries across categories ([@AntsyLich](https://github.com/AntsyLich)) ([`a6ee4bc`](https://github.com/mihonapp/mihon/commit/a6ee4bc))
- Fixed reader tap navigation not responding after a button press turned into a scroll ([@mujina3](https://github.com/mujina3)) ([#3655](https://github.com/mihonapp/mihon/pull/3655))
- Fixed editing the cover of an entry that isn't in the library saying the cover was updated without changing it, and say to add it to the library first instead ([@quickdesh](https://github.com/quickdesh), [@AntsyLich](https://github.com/AntsyLich)) ([#2265](https://github.com/mihonapp/mihon/pull/2265))
- Fixed downloads of duplicate chapters not being deleted when they were marked as read along with a chapter ([@leodyversemilla07](https://github.com/leodyversemilla07), [@AntsyLich](https://github.com/AntsyLich)) ([#3030](https://github.com/mihonapp/mihon/pull/3030))
- Fixed library updates skipping entries whose details were never fetched ([@NarwhalHorns](https://github.com/NarwhalHorns), [@AntsyLich](https://github.com/AntsyLich)) ([#3179](https://github.com/mihonapp/mihon/pull/3179))
- Fixed every library entry being matched as a duplicate of an entry with a blank title ([@NarwhalHorns](https://github.com/NarwhalHorns), [@AntsyLich](https://github.com/AntsyLich)) ([#3308](https://github.com/mihonapp/mihon/pull/3308))
- Fixed marking chapters as read deleting their downloads in categories excluded from "Delete after reading" ([@mliem2k](https://github.com/mliem2k)) ([#3558](https://github.com/mihonapp/mihon/pull/3558))
- Fixed local source entries missing from global search ([@mugetau](https://github.com/mugetau)) ([#3784](https://github.com/mihonapp/mihon/pull/3784))
- Fixed the Updates screen hiding the last update time and pull to refresh when it has no chapters, and saying there are no recent updates when filters hide them all ([@AMendoza180890](https://github.com/AMendoza180890), [@AntsyLich](https://github.com/AntsyLich)) ([#3790](https://github.com/mihonapp/mihon/pull/3790))
- Fixed downloads of chapters removed by the source getting stuck in the download queue ([@JoJoKorok](https://github.com/JoJoKorok), [@AntsyLich](https://github.com/AntsyLich)) ([#3845](https://github.com/mihonapp/mihon/pull/3845))
- Fixed the stored download index overwriting the startup rescan, which could show downloaded chapters as not downloaded ([@choppeh](https://github.com/choppeh), [@AntsyLich](https://github.com/AntsyLich)) ([#3968](https://github.com/mihonapp/mihon/pull/3968))
- Fixed local chapters no longer being listed after one archive couldn't be read ([@a-biad](https://github.com/a-biad), [@AntsyLich](https://github.com/AntsyLich)) ([#3997](https://github.com/mihonapp/mihon/pull/3997))
- Fixed "Hide missing chapter indicators" not hiding the indicator in chapter headers ([@kaosjammo](https://github.com/kaosjammo)) ([#4039](https://github.com/mihonapp/mihon/pull/4039))
- Fixed a chapter being downloaded a second time when downloads were stopped right as it finished ([@AntsyLich](https://github.com/AntsyLich)) ([`6115783`](https://github.com/mihonapp/mihon/commit/6115783))
- Fixed the chapter selection being cleared when new chapters were downloaded automatically after a refresh ([@AntsyLich](https://github.com/AntsyLich)) ([`a82d27c`](https://github.com/mihonapp/mihon/commit/a82d27c))
- Fixed actions started from a dialog sometimes not running when the dialog closed right away, Kitsu, Shikimori, MangaBaka, Bangumi and Hikka sometimes refreshing their login twice at once, adding an extension repo served over HTTP failing, and cancelling an extension install not stopping its download ([@AntsyLich](https://github.com/AntsyLich)) ([#4068](https://github.com/mihonapp/mihon/pull/4068))
- Fixed the next library update staying "Soon" after new chapters were found, and chapters that came out early, late or were dated earlier by the source pushing the next check back ([@AntsyLich](https://github.com/AntsyLich)) ([`ba44815`](https://github.com/mihonapp/mihon/commit/ba44815))
- Fixed long strip side padding being counted in zoom bounds ([@WizaHX](https://github.com/WizaHX)) ([#4072](https://github.com/mihonapp/mihon/pull/4072))
- Fixed long strip stuttering between pages and using a lot of memory with very tall pages ([@AntsyLich](https://github.com/AntsyLich), [@matheuswr89](https://github.com/matheuswr89))
### Other
- Show "Nightly" instead of "Beta" for preview builds and "FOSS" for FOSS builds in About ([@AntsyLich](https://github.com/AntsyLich)) ([#3760](https://github.com/mihonapp/mihon/pull/3760))
- Migrate Kitsu tracker to Kitsu's GraphQL API ([@MajorTanya](https://github.com/MajorTanya)) ([#3792](https://github.com/mihonapp/mihon/pull/3792))
- Fixed Kitsu search showing novel results ([@MajorTanya](https://github.com/MajorTanya)) ([#4069](https://github.com/mihonapp/mihon/pull/4069))
- Extensions can only get Application, Context, Json, ProtoBuf, XML, NetworkHelper and JavaScriptEngine from Injekt ([@AntsyLich](https://github.com/AntsyLich)) ([#3965](https://github.com/mihonapp/mihon/pull/3965))
- Use Apollo GraphQL for AniList, Kitsu, Shikimori and Suwayomi tracker APIs ([@MajorTanya](https://github.com/MajorTanya), [@Syer10](https://github.com/Syer10)) ([#3827](https://github.com/mihonapp/mihon/pull/3827))
## [v0.20.4] - 2026-08-05
### Fixed
- Fixed some dates being wrongly shown as "Today" or otherwise closer in time ([@MajorTanya](https://github.com/MajorTanya)) ([#3696](https://github.com/mihonapp/mihon/pull/3696))
## [v0.20.3] - 2026-08-04
### Added
- Add Category filtering for the Updates tab ([@MajorTanya](https://github.com/MajorTanya)) ([#3589](https://github.com/mihonapp/mihon/pull/3589))
- Add Category filtering for the Upcoming calendar ([@MajorTanya](https://github.com/MajorTanya)) ([#3607](https://github.com/mihonapp/mihon/pull/3607))
### Changed
- Update default user agent to Chrome 149 ([@AntsyLich](https://github.com/AntsyLich)) ([#3678](https://github.com/mihonapp/mihon/pull/3678))
### Improved
- Spoof `Sec-CH-UA` client hints in WebView to match the user agent ([@AntsyLich](https://github.com/AntsyLich)) ([#3678](https://github.com/mihonapp/mihon/pull/3678))
### Fixed
- Fixed extension installation with shizuku installer ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#3676](https://github.com/mihonapp/mihon/pull/3676))
- Fixed `X-Requested-With` spoofing leaking to unrelated callers ([@AntsyLich](https://github.com/AntsyLich)) ([#3678](https://github.com/mihonapp/mihon/pull/3678))
- Fixed reader loading indefinitely in some scenarios ([@AntsyLich](https://github.com/AntsyLich)) ([#3686](https://github.com/mihonapp/mihon/pull/3686))
- Fix MyAnimeList error for list entries with partial start/finish reading dates by setting those dates to either Jan 1st or 1st of the month ([@MajorTanya](https://github.com/MajorTanya)) ([#3573](https://github.com/mihonapp/mihon/pull/3573))
## [v0.20.2] - 2026-08-01
### Added
- Support resumable image downloads if supported by source ([@xMohnad](https://github.com/xMohnad)) ([#3167](https://github.com/mihonapp/mihon/pull/3167))
- Fix HTTP Error 416 not being handled properly ([@AntsyLich](https://github.com/AntsyLich)) ([#3563](https://github.com/mihonapp/mihon/pull/3563))
- Fix incorrect progress when resuming downloads ([@xMohnad](https://github.com/xMohnad)) ([#3616](https://github.com/mihonapp/mihon/pull/3616))
- Add Tokyo Night Theme ([@xMohnad](https://github.com/xMohnad)) ([#3502](https://github.com/mihonapp/mihon/pull/3502))
### Changed
- Detect Shizuku with permission check ([@Small-Ku](https://github.com/Small-Ku)) ([#3565](https://github.com/mihonapp/mihon/pull/3565))
- Check for app and extension update on every cold start ([@AntsyLich](https://github.com/AntsyLich)) ([#3658](https://github.com/mihonapp/mihon/pull/3658))
### Improved
- Library search ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#3554](https://github.com/mihonapp/mihon/pull/3554))
- Support logical operators (`&&`, `||`, `-`), implicit `AND` separators, and nested expressions with `()`
- Add comparison operators (`>`, `>=`, `<`, `<=`, `=`) for `id`, `added`, `fetchinterval` / `fi`, `nextupdate` / `nu`, `unread`, `read`, and `total` (Uses `yyyy-MM-dd` dates for `added` and `nextupdate`)
- Support field-specific prefixes (`title`, `author`, `artist`, `description` / `desc`, `genre` / `tag`, `source` / `src`, `source_id` / `src_id`, `notes` / `note`, `language` / `lang`) and empty field matching (`""`, `''`)
- Always use Private installer to update privately installed extensions ([@MajorTanya](https://github.com/MajorTanya)) ([#3614](https://github.com/mihonapp/mihon/pull/3614))
- App update prompt flow experience ([@AntsyLich](https://github.com/AntsyLich)) ([#3669](https://github.com/mihonapp/mihon/pull/3669))
### Fixed
- Fixed app bars remaining visible after changing pages by tapping in the paged reader after using the chapter navigator slider ([@AntsyLich](https://github.com/AntsyLich)) ([#3567](https://github.com/mihonapp/mihon/pull/3567))
- Fixed MangaBaka User Agent string ([@MajorTanya](https://github.com/MajorTanya)) ([#3578](https://github.com/mihonapp/mihon/pull/3578))
- Fixed extension installation with shizuku installer ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#3630](https://github.com/mihonapp/mihon/pull/3630))
- Fixed backup restore dropping library entries when the backup contains duplicate chapters ([@na-ji](https://github.com/na-ji)) ([#3667](https://github.com/mihonapp/mihon/pull/3667))
## [v0.20.1] - 2026-07-09
### Added
- [Hikka](https://hikka.io/) tracker support ([@Lorg0n](https://github.com/Lorg0n)) ([#1386](https://github.com/mihonapp/mihon/pull/1386))
- Fix Hikka not defaulting to "Plan to Read" for unread titles ([@MajorTanya](https://github.com/MajorTanya)) ([#3534](https://github.com/mihonapp/mihon/pull/3534))
- Fix Hikka search throwing error due to unclosed response ([@MajorTanya](https://github.com/MajorTanya)) ([#3548](https://github.com/mihonapp/mihon/pull/3548))
- Add support for [MangaBaka](https://mangabaka.org) tracker ([@MajorTanya](https://github.com/MajorTanya)) ([#3047](https://github.com/mihonapp/mihon/pull/3047))
- Display authors and description in Shikimori search results ([@MajorTanya](https://github.com/MajorTanya)) ([#3499](https://github.com/mihonapp/mihon/pull/3499))
- Invalidate download cache after backup restore ([@leodyversemilla07](https://github.com/leodyversemilla07)) ([#3096](https://github.com/mihonapp/mihon/pull/3096))
- Add setting to control vertical chapter navigator height ([@AntsyLich](https://github.com/AntsyLich)) ([#3528](https://github.com/mihonapp/mihon/pull/3528))
- Add option to set which readers use vertical chapter navigator ([@AntsyLich](https://github.com/AntsyLich)) ([#3528](https://github.com/mihonapp/mihon/pull/3528))
### Changed
- Don't use GMS to detect if GMS is available ([@leodyversemilla07](https://github.com/leodyversemilla07)) ([#3525](https://github.com/mihonapp/mihon/pull/3525))
### Improved
- Show usernames in Tracking settings ([@MajorTanya](https://github.com/MajorTanya)) ([#3533](https://github.com/mihonapp/mihon/pull/3533))
### Fixed
- Fix Shikimori tracking not working ([@MajorTanya](https://github.com/MajorTanya)) ([#3497](https://github.com/mihonapp/mihon/pull/3497))
- Fix crash trying to select text in notes screen ([@AntsyLich](https://github.com/AntsyLich)) ([#3516](https://github.com/mihonapp/mihon/pull/3516))
- Fix crash when putting app in background ([@AntsyLich](https://github.com/AntsyLich)) ([#3523](https://github.com/mihonapp/mihon/pull/3523))
- Fix support for non-system SAF providers ([@AntsyLich](https://github.com/AntsyLich)) ([#3530](https://github.com/mihonapp/mihon/pull/3530))
- Fix chapter's `memo` field not being updated for existing chapters ([@cuong-tran](https://github.com/cuong-tran)) ([#3538](https://github.com/mihonapp/mihon/pull/3538))
- Fix app not reading `tachiyomix.extensionLib` extension metadata ([@AntsyLich](https://github.com/AntsyLich)) ([#3545](https://github.com/mihonapp/mihon/pull/3545), [#3559](https://github.com/mihonapp/mihon/pull/3559))
- Fix reader navigator slider steps not updating after changing chapter ([@AntsyLich](https://github.com/AntsyLich)) ([#3549](https://github.com/mihonapp/mihon/pull/3549))
## [v0.20.0] - 2026-06-27
### Added
- Add support for `tachiyomix` 1.6 extensions ([@AntsyLich](https://github.com/AntsyLich))
- Add support for `tachiyomix` extension index format ([@AntsyLich](https://github.com/AntsyLich)) ([#3349](https://github.com/mihonapp/mihon/pull/3349))
- Add vertical chapter navigator for long strip mode ([@AntsyLich](https://github.com/AntsyLich)) ([#3377](https://github.com/mihonapp/mihon/pull/3377))
- Add option to open app settings from system settings ([@JFronny](https://github.com/JFronny)) ([#3180](https://github.com/mihonapp/mihon/pull/3180))
### Changed
- Change the term "extension repo" to "extension store" ([@AntsyLich](https://github.com/AntsyLich)) ([#3349](https://github.com/mihonapp/mihon/pull/3349))
- Change the term "Obsolete" to "Orphaned" for extensions ([@AntsyLich](https://github.com/AntsyLich)) ([#3383](https://github.com/mihonapp/mihon/pull/3383))
- Remove text limit of manga notes ([@AntsyLich](https://github.com/AntsyLich)) ([#3410](https://github.com/mihonapp/mihon/pull/3410))
- Tweak Catppuccin color scheme for clarity ([@xenitane](https://github.com/xenitane)) ([#3436](https://github.com/mihonapp/mihon/pull/3436))
- Update app shortcuts to use app icon color scheme ([@NGB-Was-Taken](https://github.com/NGB-Was-Taken)) ([#2835](https://github.com/mihonapp/mihon/pull/2835))
### Improved
- Batch database operations during backup restore for improved performance ([@Lolle2000la](https://github.com/Lolle2000la)) ([#3267](https://github.com/mihonapp/mihon/pull/3267))
### Fixed
- Add missing `outlineVariant` color to Nord theme ([@CompileConnected](https://github.com/CompileConnected)) ([#3184](https://github.com/mihonapp/mihon/pull/3184))
- Continue reading button missing when unread filter is off ([@AntsyLich](https://github.com/AntsyLich)) ([#3382](https://github.com/mihonapp/mihon/pull/3382))
- Fix random `FileNotFoundException` when reading chapters ([@leodyversemilla07](https://github.com/leodyversemilla07)) ([#3154](https://github.com/mihonapp/mihon/pull/3154))
## [v0.19.9] - 2026-04-11
### Fixed
- Regression with installing/updating extension ([@AntsyLich](https://github.com/AntsyLich))
## [v0.19.8] - 2026-04-11
### Added
@@ -412,7 +700,7 @@ Same as v0.19.6
- Fix MigratorTest after updating to Kotlin 2 ([@cuong-tran](https://github.com/cuong-tran)) ([#896](https://github.com/mihonapp/mihon/pull/896))
- Add MigratorTest to build script ([@cuong-tran](https://github.com/cuong-tran)) ([#896](https://github.com/mihonapp/mihon/pull/896))
- Fix UI freeze after migration ([@AntsyLich](https://github.com/AntsyLich)) ([`3f1d28c`](https://github.com/mihonapp/mihon/commit/3f1d28c3833e6b868152149ed02b3fb8c54eccef))
- Fix some migrations never running ([@MajorTanya](https://github.com/MajorTanya), [@AntsyLich](https://github.com/AntsyLich)) ([#1030](https://github.com/mihonapp/mihon/pull/1030))
- Fix some migrations never running ([@MajorTanya](https://github.com/MajorTanya), [@AntsyLich](https://github.com/AntsyLich)) ([#1114](https://github.com/mihonapp/mihon/pull/1114))
- Add ProGuard rule to keep `mihon` namespace classes ([@MajorTanya](https://github.com/MajorTanya)) ([#605](https://github.com/mihonapp/mihon/pull/605))
- Use gradle plugins to share build configuration instead of subprojects ([@AntsyLich](https://github.com/AntsyLich)) ([`e448e40`](https://github.com/mihonapp/mihon/commit/e448e40406e8d9916120a278e42829a6f1b25a7a))
- Remove dependency on compose material 2 components ([@AntsyLich](https://github.com/AntsyLich)) ([`fb94230`](https://github.com/mihonapp/mihon/commit/fb9423028eb017c110cb805f2d0601e5b02e50f9))
@@ -524,7 +812,16 @@ Same as v0.19.6
- Branding to Mihon ([@AntsyLich](https://github.com/AntsyLich))
- Minimum supported Android version to 8 ([@AntsyLich](https://github.com/AntsyLich)) ([`dfb3091`](https://github.com/mihonapp/mihon/commit/dfb3091e380dda3e9bfb64bf5c9a685cf3a03d0e))
[unreleased]: https://github.com/mihonapp/mihon/compare/v0.19.8...main
[unreleased]: https://github.com/mihonapp/mihon/compare/v0.21.2...main
[v0.21.2]: https://github.com/mihonapp/mihon/compare/v0.21.1...v0.21.2
[v0.21.1]: https://github.com/mihonapp/mihon/compare/v0.21.0...v0.21.1
[v0.21.0]: https://github.com/mihonapp/mihon/compare/v0.20.4...v0.21.0
[v0.20.4]: https://github.com/mihonapp/mihon/compare/v0.20.3...v0.20.4
[v0.20.3]: https://github.com/mihonapp/mihon/compare/v0.20.2...v0.20.3
[v0.20.2]: https://github.com/mihonapp/mihon/compare/v0.20.1...v0.20.2
[v0.20.1]: https://github.com/mihonapp/mihon/compare/v0.20.0...v0.20.1
[v0.20.0]: https://github.com/mihonapp/mihon/compare/v0.19.9...v0.20.0
[v0.19.9]: https://github.com/mihonapp/mihon/compare/v0.19.8...v0.19.9
[v0.19.8]: https://github.com/mihonapp/mihon/compare/v0.19.7...v0.19.8
[v0.19.7]: https://github.com/mihonapp/mihon/compare/v0.19.6...v0.19.7
[v0.19.6]: https://github.com/mihonapp/mihon/compare/v0.19.5...v0.19.6
+3 -3
View File
@@ -29,7 +29,7 @@ Discover and read manga, webtoons, comics, and more – easier than ever on your
* Local reading of content.
* A configurable reader with multiple viewers, reading directions and other settings.
* Tracker support: [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.app/), [MangaUpdates](https://mangaupdates.com), [Shikimori](https://shikimori.one), and [Bangumi](https://bgm.tv/) support.
* Tracker support: [MangaBaka](https://mangabaka.org), [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.app/), [MangaUpdates](https://mangaupdates.com), [Shikimori](https://shikimori.one), [Bangumi](https://bgm.tv/), and [Hikka](https://hikka.io/) support.
* Categories to organize your library.
* Light and dark themes.
* Schedule updating your library for new chapters.
@@ -49,8 +49,8 @@ Before reporting a new issue, take a look at the [FAQ](https://mihon.app/docs/fa
### Repositories
[![mihonapp/website - GitHub](https://github-readme-stats.vercel.app/api/pin/?username=mihonapp&repo=website&bg_color=161B22&text_color=c9d1d9&title_color=0877d2&icon_color=0877d2&border_radius=8&hide_border=true&description_lines_count=2)](https://github.com/mihonapp/website/)
[![mihonapp/bitmap.kt - GitHub](https://github-readme-stats.vercel.app/api/pin/?username=mihonapp&repo=bitmap.kt&bg_color=161B22&text_color=c9d1d9&title_color=0877d2&icon_color=0877d2&border_radius=8&hide_border=true&description_lines_count=2)](https://github.com/mihonapp/bitmap.kt/)
[![mihonapp/website - GitHub](https://github-stats-extended.vercel.app/api/pin/?username=mihonapp&repo=website&bg_color=161B22&text_color=c9d1d9&title_color=0877d2&icon_color=0877d2&border_radius=8&hide_border=true&description_lines_count=2)](https://github.com/mihonapp/website/)
[![mihonapp/bitmap.kt - GitHub](https://github-stats-extended.vercel.app/api/pin/?username=mihonapp&repo=bitmap.kt&bg_color=161B22&text_color=c9d1d9&title_color=0877d2&icon_color=0877d2&border_radius=8&hide_border=true&description_lines_count=2)](https://github.com/mihonapp/bitmap.kt/)
### Credits
+173 -40
View File
@@ -1,16 +1,25 @@
import com.android.build.api.variant.ApplicationVariant
import com.android.build.api.variant.BuildConfigField
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
import mihon.gradle.Config
import mihon.gradle.getBuildTime
import mihon.gradle.getCurrentTime
import mihon.gradle.getLatestCommitCount
import mihon.gradle.getLatestCommitSha
import mihon.gradle.getLatestCommitTime
import mihon.gradle.tasks.ReplaceShortcutsPlaceholderTask
import java.io.FileInputStream
import java.util.Properties
plugins {
alias(mihonx.plugins.android.application)
alias(mihonx.plugins.compose)
alias(mihonx.plugins.spotless)
alias(libs.plugins.metro)
alias(libs.plugins.aboutLibraries)
alias(libs.plugins.androidx.baselineProfile)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.apollo)
}
if (Config.includeTelemetry) {
@@ -20,37 +29,59 @@ if (Config.includeTelemetry) {
}
}
val keystorePropertiesFile = layout.settingsDirectory.file("keystore.properties").asFile
android {
namespace = "eu.kanade.tachiyomi"
defaultConfig {
applicationId = "app.mihon"
versionCode = 21
versionName = "0.19.8"
versionCode = 38
versionName = "0.21.2"
buildConfigField("String", "COMMIT_COUNT", "\"${getLatestCommitCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getLatestCommitSha()}\"")
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLatestCommitTime = false)}\"")
buildConfigField("boolean", "TELEMETRY_INCLUDED", "${Config.includeTelemetry}")
buildConfigField("boolean", "UPDATER_ENABLED", "${Config.enableUpdater}")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
if (System.getenv("MIHON_GITHUB_RELEASE").toBoolean()) {
signingConfigs {
named("debug") {
storeFile = file(System.getenv("storeFile"))
storePassword = System.getenv("storePassword")
keyAlias = System.getenv("keyAlias")
keyPassword = System.getenv("keyPassword")
}
}
} else if (keystorePropertiesFile.exists()) {
val keystoreProperties = FileInputStream(keystorePropertiesFile).use { Properties().apply { load(it) } }
signingConfigs {
named("debug") {
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
}
}
}
buildTypes {
val debug by getting {
val debug = getByName("debug") {
applicationIdSuffix = ".dev"
versionNameSuffix = "-${getLatestCommitCount()}"
isPseudoLocalesEnabled = true
}
val release by getting {
isMinifyEnabled = Config.enableCodeShrink
isShrinkResources = Config.enableCodeShrink
val release = getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = debug.signingConfig
isProfileable = true
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLatestCommitTime = true)}\"")
}
val commonMatchingFallbacks = listOf(release.name)
@@ -62,35 +93,34 @@ android {
matchingFallbacks.addAll(commonMatchingFallbacks)
}
create("preview") {
create("nightly") {
initWith(release)
applicationIdSuffix = ".debug"
versionNameSuffix = debug.versionNameSuffix
signingConfig = debug.signingConfig
matchingFallbacks.addAll(commonMatchingFallbacks)
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLatestCommitTime = false)}\"")
}
create("benchmark") {
initWith(release)
isDebuggable = false
isProfileable = true
versionNameSuffix = "-benchmark"
applicationIdSuffix = ".benchmark"
signingConfig = debug.signingConfig
matchingFallbacks.addAll(commonMatchingFallbacks)
}
if (Config.includeTelemetry) {
configureEach {
configure<CrashlyticsExtension> {
mappingFileUploadEnabled = Config.uploadCrashlyticsMapping
}
}
}
}
sourceSets {
getByName("preview").res.srcDirs("src/debug/res")
getByName("benchmark").res.srcDirs("src/debug/res")
getByName("nightly").res.directories.add("src/debug/res")
getByName("benchmark").res.directories.add("src/debug/res")
}
splits {
@@ -139,10 +169,6 @@ android {
viewBinding = true
buildConfig = true
aidl = true
// Disable some unused things
renderScript = false
shaders = false
}
lint {
@@ -166,15 +192,25 @@ kotlin {
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-Xannotation-default-target=param-property",
)
}
}
baselineProfile {
baselineProfileOutputDir = "baselineProfiles"
mergeIntoMain = true
}
dependencies {
baselineProfile(projects.baselineProfile)
implementation(projects.i18n)
implementation(projects.icons.customMaterialSymbols)
implementation(projects.icons.materialSymbols)
implementation(projects.icons.simpleIcons)
implementation(projects.core.archive)
implementation(projects.core.common)
implementation(projects.core.metro)
implementation(projects.coreMetadata)
implementation(projects.sourceApi)
implementation(projects.sourceLocal)
@@ -188,25 +224,24 @@ dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.materialIcons)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.animationGraphics)
debugImplementation(libs.androidx.compose.uiTooling)
implementation(libs.androidx.compose.uiToolingPreview)
implementation(libs.androidx.compose.uiUtil)
implementation(libs.androidx.navigationEvent)
implementation(libs.androidx.interpolator)
implementation(libs.androidx.paging.runtime)
implementation(libs.androidx.paging.compose)
implementation(libs.androidx.sqlite.bundled)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.collections.immutable)
implementation(libs.bundles.kotlinx.coroutines)
implementation(libs.kotlinx.datetime)
// AndroidX libraries
implementation(libs.androidx.annotation)
implementation(libs.androidx.appCompat)
@@ -246,6 +281,9 @@ dependencies {
// Dependency injection
implementation(libs.injekt)
implementation(libs.metro.runtime)
implementation(libs.metrox.viewmodel)
implementation(libs.metrox.viewmodel.compose)
// Image loading
implementation(libs.bundles.coil)
@@ -254,6 +292,8 @@ dependencies {
}
implementation(libs.image.decoder)
implementation(libs.webgpuviewer)
// UI libraries
implementation(libs.material)
implementation(libs.flexibleAdapter)
@@ -281,6 +321,10 @@ dependencies {
// String similarity
implementation(libs.stringSimilarity)
// GraphQL generation
implementation(libs.apollo)
implementation(libs.apollo.adapters)
// Tests
testImplementation(libs.bundles.test)
testRuntimeOnly(libs.junit.platform.launcher)
@@ -292,7 +336,102 @@ dependencies {
testImplementation(libs.kotlinx.coroutines.test)
}
apollo {
val schemaBasePath = "src/main/graphql/mihon/graphql"
service("anilist") {
packageName.set("mihon.graphql.anilist")
val srcDir = "$schemaBasePath/anilist"
srcDir(file(srcDir))
introspection {
endpointUrl.set("https://graphql.anilist.co")
schemaFile.set(file("$srcDir/anilist.graphqls"))
}
// ISO 3166-1 alpha-2 country code
mapScalarToKotlinString("CountryCode")
}
service("kitsu") {
packageName.set("mihon.graphql.kitsu")
val srcDir = "$schemaBasePath/kitsu"
srcDir(file(srcDir))
android.defaultConfig.versionCode
introspection {
// Kitsu doesn't like requests without a UA
headers.put(
"User-Agent",
"Mihon v${android.defaultConfig.versionName} (${android.defaultConfig.applicationId})",
)
endpointUrl.set("https://kitsu.app/api/graphql")
schemaFile.set(file("$srcDir/kitsu.graphqls"))
}
// A date, expressed as an ISO8601 string
mapScalarToKotlinString("Date")
// An ISO 8601-encoded datetime
mapScalar("ISO8601DateTime", "kotlin.time.Instant", "com.apollographql.adapter.core.KotlinInstantAdapter")
// A loose key-value map in GraphQL
mapScalar(
"Map",
"kotlin.collections.Map<String, Any?>",
"mihon.graphql.kitsu.adapter.KitsuMapAdapter",
)
}
service("shikimori") {
packageName.set("mihon.graphql.shikimori")
val srcDir = "$schemaBasePath/shikimori"
srcDir(file(srcDir))
introspection {
endpointUrl.set("https://shikimori.io/api/graphql")
schemaFile.set(file("$srcDir/shikimori.graphqls"))
}
// An ISO 8601-encoded date
mapScalarToKotlinString("ISO8601Date")
}
service("suwayomi") {
packageName.set("mihon.graphql.suwayomi")
val srcDir = "$schemaBasePath/suwayomi"
srcDir(file(srcDir))
introspection {
endpointUrl.set("http://localhost:4567/api/graphql")
schemaFile.set(file("$srcDir/suwayomi.graphqls"))
}
}
}
val latestCommitCount = getLatestCommitCount()
val latestCommitSha = getLatestCommitSha()
val latestCommitTime = getLatestCommitTime()
val currentTime = getCurrentTime()
fun ApplicationVariant.buildConfigField(type: String, name: String, value: Provider<String>) {
buildConfigFields?.put(name, value.map { BuildConfigField(type, it, null) })
}
androidComponents {
onVariants { variant ->
val isUnstableBuild = variant.buildType == "debug" || variant.buildType == "nightly"
val buildTime = if (isUnstableBuild) currentTime else latestCommitTime
variant.buildConfigField("String", "COMMIT_COUNT", latestCommitCount.map { "\"$it\"" })
variant.buildConfigField("String", "COMMIT_SHA", latestCommitSha.map { "\"$it\"" })
variant.buildConfigField("String", "BUILD_TIME", buildTime.map { "\"$it\"" })
if (isUnstableBuild) {
variant.outputs.forEach { output ->
val versionName = output.versionName.get()
output.versionName.set(latestCommitCount.map { "$versionName-$it" })
}
}
}
onVariants { variant ->
val resSource = variant.sources.res ?: return@onVariants
@@ -312,9 +451,3 @@ androidComponents {
it.packaging.resources.excludes.add("META-INF/*.version")
}
}
buildscript {
dependencies {
classpath(libs.kotlin.gradle)
}
}
+21 -10
View File
@@ -1,8 +1,8 @@
-dontobfuscate
-keep,allowoptimization class eu.kanade.**
-keep,allowoptimization class tachiyomi.**
-keep,allowoptimization class mihon.**
# Injekt reads the injected type from the generic superclass of its type tokens
-keepattributes Signature
-keep,allowshrinking class * extends uy.kohesive.injekt.api.FullTypeReference
# Keep common dependencies used in extensions
-keep,allowoptimization class androidx.preference.** { public protected *; }
@@ -16,14 +16,16 @@
-keep,allowoptimization class rx.** { public protected *; }
-keep,allowoptimization class app.cash.quickjs.** { public protected *; }
-keep,allowoptimization class uy.kohesive.injekt.** { public protected *; }
-keep,allowoptimization class com.squareup.zstd.** { public protected *; }
# From extensions-lib
-keep,allowoptimization class eu.kanade.tachiyomi.network.interceptor.RateLimitInterceptorKt { public protected *; }
-keep,allowoptimization class eu.kanade.tachiyomi.network.interceptor.SpecificHostRateLimitInterceptorKt { public protected *; }
-keep,allowoptimization class eu.kanade.tachiyomi.network.NetworkHelper { public protected *; }
-keep,allowoptimization class eu.kanade.tachiyomi.network.OkHttpExtensionsKt { public protected *; }
-keep,allowoptimization class eu.kanade.tachiyomi.network.RequestsKt { public protected *; }
-keep,allowoptimization class eu.kanade.tachiyomi.AppInfo { public protected *; }
-keepclassmembers class * implements java.io.Serializable {
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# Provided by the OEM at runtime when supported
-dontwarn androidx.window.extensions.**
-dontwarn androidx.window.sidecar.**
##---------------Begin: proguard configuration for RxJava 1.x ----------
-dontwarn sun.misc.**
@@ -80,3 +82,12 @@
# Firebase
-keep class com.google.firebase.installations.** { *; }
-keep interface com.google.firebase.installations.** { *; }
# KotlinX Datetime
-keep,allowoptimization class kotlinx.datetime.** { public protected *; }
# Methods called by Shizuku only
-keepclassmembers class mihon.app.shizuku.ShellInterface {
public <init>();
public void destroy();
}
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="accent_blue">#7EBBED</color>
<color name="icon_background">#2E3943</color>
</resources>
+30 -2
View File
@@ -60,8 +60,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Deep link to add repos -->
<intent-filter android:label="@string/action_add_repo">
<!-- Legacy deeplink to add extension store -->
<intent-filter android:label="@string/action_addExtensionStore">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
@@ -71,6 +71,17 @@
<data android:host="add-repo" />
</intent-filter>
<!-- Deeplink to add extension store -->
<intent-filter android:label="@string/action_addExtensionStore">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="mihon" />
<data android:host="extension-store" />
</intent-filter>
<!-- Open backup files -->
<intent-filter android:label="@string/pref_restore_backup">
<action android:name="android.intent.action.VIEW" />
@@ -130,6 +141,10 @@
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter android:label="@string/app_settings">
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
@@ -178,8 +193,21 @@
<data android:host="anilist-auth" />
<data android:host="bangumi-auth" />
<data android:host="mangabaka-auth" />
<data android:host="myanimelist-auth" />
<data android:host="shikimori-auth" />
<data android:host="hikka-auth" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Comick requires native reverse-domain schemes -->
<data android:scheme="app.mihon" />
<data android:host="comick-auth" />
</intent-filter>
</activity>
@@ -1,7 +1,7 @@
package mihon.app.shizuku;
interface IShellInterface {
void install(in AssetFileDescriptor apk) = 1;
void install(in AssetFileDescriptor apk, in IntentSender intentSender) = 1;
void destroy() = 16777114;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
mutation AniListAddManga(
$manga_id: Int!,
$progress: Int!,
$status: MediaListStatus!,
$private: Boolean!,
) {
SaveMediaListEntry (
mediaId: $manga_id,
progress: $progress,
status: $status,
private: $private,
) {
id
}
}
@@ -0,0 +1,9 @@
mutation AniListDeleteManga(
$library_id: Int!,
) {
DeleteMediaListEntry(
id: $library_id,
) {
deleted
}
}
@@ -0,0 +1,9 @@
query AniListGetCurrentUser {
Viewer {
id
name
mediaListOptions {
scoreFormat
}
}
}
@@ -0,0 +1,31 @@
query AniListGetLibManga(
$user_id: Int!,
$manga_id: Int!,
) {
Page {
mediaList(
userId: $user_id,
type: MANGA,
mediaId: $manga_id,
) {
id
status
scoreRaw: score(format: POINT_100)
progress
private
startedAt {
year
month
day
}
completedAt {
year
month
day
}
media {
...MangaFragment
}
}
}
}
@@ -0,0 +1,13 @@
query AniListGetMangaDetails(
$manga_id: Int!,
) {
Page (perPage: 1) {
media(
id: $manga_id,
type: MANGA,
format_not_in: [NOVEL],
) {
...MangaFragment
}
}
}
@@ -0,0 +1,13 @@
query AniListSearchManga(
$search: String!,
) {
Page (perPage: 50) {
media(
search: $search,
type: MANGA,
format_not_in: [NOVEL],
) {
...MangaFragment
}
}
}
@@ -0,0 +1,21 @@
mutation AniListUpdateManga(
$library_id: Int!,
$progress: Int!,
$status: MediaListStatus!,
$private: Boolean!,
$score: Int!,
$startedAt: FuzzyDateInput!,
$completedAt: FuzzyDateInput!,
) {
SaveMediaListEntry(
id: $library_id,
progress: $progress,
status: $status,
private: $private,
scoreRaw: $score,
startedAt: $startedAt,
completedAt: $completedAt,
) {
id
}
}
@@ -0,0 +1,30 @@
fragment MangaFragment on Media {
id
staff {
edges {
role
node {
name {
userPreferred
}
}
}
}
title {
userPreferred
}
coverImage {
large
}
format
countryOfOrigin
status
chapters
description
startDate {
year
month
day
}
averageScore
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
mutation KitsuAddLibManga(
$media_id: ID!,
$status: LibraryEntryStatusEnum!,
$progress: Int!,
$private: Boolean!,
$rating: Int,
) {
libraryEntry {
create(
input: {
mediaId: $media_id,
mediaType: MANGA,
status: $status,
progress: $progress,
private: $private,
rating: $rating,
}
) {
errors {
message
}
libraryEntry {
id
}
}
}
}
@@ -0,0 +1,18 @@
mutation KitsuDeleteLibEntry(
$library_id: ID!,
) {
libraryEntry {
delete(
input: {
id: $library_id,
}
) {
errors {
message
}
libraryEntry {
id
}
}
}
}
@@ -0,0 +1,18 @@
query KitsuFindLibManga(
$remote_id: ID!,
) {
findMangaById(
id: $remote_id,
) {
...MangaFragment
myLibraryEntry {
id
private
progress
rating
status
startedAt
finishedAt
}
}
}
@@ -0,0 +1,9 @@
query KitsuGetCurrentAccount {
currentAccount {
id
ratingSystem
profile {
name
}
}
}
@@ -0,0 +1,9 @@
query KitsuGetMangaDetailsById(
$id: ID!,
) {
findMangaById(
id: $id,
) {
...MangaFragment
}
}
@@ -0,0 +1,9 @@
query KitsuGetMangaDetailsBySlug(
$slug: String!,
) {
findMangaBySlug(
slug: $slug,
) {
...MangaFragment
}
}
@@ -0,0 +1,12 @@
query KitsuSearchMangaByTitle(
$query: String!,
) {
searchMangaByTitle(
title: $query,
first: 20,
) {
nodes {
...MangaFragment
}
}
}
@@ -0,0 +1,30 @@
mutation KitsuUpdateLibManga(
$library_id: ID!,
$status: LibraryEntryStatusEnum!,
$progress: Int!,
$private: Boolean!,
$rating: Int,
$startedAt: ISO8601DateTime,
$finishedAt: ISO8601DateTime,
) {
libraryEntry {
update(
input: {
id: $library_id,
status: $status,
progress: $progress,
private: $private,
rating: $rating,
startedAt: $startedAt,
finishedAt: $finishedAt,
}
) {
errors {
message
}
libraryEntry {
id
}
}
}
}
@@ -0,0 +1,31 @@
fragment MangaFragment on Manga {
id
titles {
preferred
}
chapterCount
staff(first: 5) {
nodes {
role
person {
name
}
}
}
posterImage {
views(names: "small") {
name
url
}
original {
name
url
}
}
description(locales: "en")
status
subtype
startDate
slug
averageRating
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
fragment MangaFragment on Manga {
id
name
chapters
kind
poster {
mainUrl
}
score
url
status
airedOn {
date
}
description
personRoles {
person {
name
}
rolesEn
}
}
@@ -0,0 +1,6 @@
query ShikimoriGetCurrentUser {
currentUser {
id
nickname
}
}
@@ -0,0 +1,19 @@
query ShikimoriGetLibManga(
$remote_id: String!,
) {
mangas(
ids: $remote_id,
limit: 1,
) {
id
url
name
chapters
userRate {
id
chapters
status
score
}
}
}
@@ -0,0 +1,11 @@
query ShikimoriGetMangaDetails(
$query: String!,
) {
mangas(
ids: $query,
limit: 1,
kind: "!light_novel,!novel",
) {
...MangaFragment
}
}
@@ -0,0 +1,11 @@
query ShikimoriSearchManga(
$search: String!
) {
mangas(
search: $search,
limit: 20,
kind: "!light_novel,!novel",
) {
...MangaFragment
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
fragment MangaFragment on MangaType {
description
id
status
thumbnailUrl
title
url
chapters {
totalCount
}
latestReadChapter {
chapterNumber
}
unreadCount
}
@@ -0,0 +1,9 @@
query SuwayomiGetManga(
$mangaId: Int!,
) {
manga(
id: $mangaId,
) {
...MangaFragment
}
}
@@ -0,0 +1,30 @@
query SuwayomiGetMangaUnreadChapters(
$mangaId: Int!,
$chapterNumber: Float!,
) {
chapters(
condition: {
mangaId: $mangaId,
isRead: false,
},
filter: {
and: [
{
chapterNumber: {
lessThanOrEqualTo: $chapterNumber
}
},
{
chapterNumber: {
greaterThan: 0
}
},
]
},
){
nodes {
id
chapterNumber
}
}
}
@@ -0,0 +1,14 @@
mutation SuwayomiMarkChaptersRead(
$chapters: [Int!]!,
) {
updateChapters(
input: {
ids: $chapters,
patch: {
isRead: true,
},
},
) {
__typename
}
}
@@ -0,0 +1,22 @@
mutation SuwayomiMarkAndDeleteChapters(
$chapters: [Int!]!,
) {
updateChapters(
input: {
ids: $chapters,
patch: {
isRead: true,
},
},
) {
__typename
}
deleteDownloadedChapters(
input: {
ids: $chapters,
},
) {
__typename
}
}
@@ -0,0 +1,11 @@
mutation SuwayomiUpdateMangaProgress(
$mangaId: Int!,
) {
trackProgress(
input: {
mangaId: $mangaId,
},
) {
__typename
}
}
File diff suppressed because it is too large Load Diff
@@ -1,13 +0,0 @@
package eu.kanade.core.util
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
import tachiyomi.domain.source.service.SourceManager
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
@Composable
fun ifSourcesLoaded(): Boolean {
return remember { Injekt.get<SourceManager>().isInitialized }.collectAsState().value
}
@@ -1,209 +0,0 @@
package eu.kanade.domain
import eu.kanade.domain.chapter.interactor.GetAvailableScanlators
import eu.kanade.domain.chapter.interactor.SetReadStatus
import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource
import eu.kanade.domain.download.interactor.DeleteDownload
import eu.kanade.domain.extension.interactor.GetExtensionLanguages
import eu.kanade.domain.extension.interactor.GetExtensionSources
import eu.kanade.domain.extension.interactor.GetExtensionsByType
import eu.kanade.domain.extension.interactor.TrustExtension
import eu.kanade.domain.manga.interactor.GetExcludedScanlators
import eu.kanade.domain.manga.interactor.SetExcludedScanlators
import eu.kanade.domain.manga.interactor.SetMangaViewerFlags
import eu.kanade.domain.manga.interactor.UpdateManga
import eu.kanade.domain.source.interactor.GetEnabledSources
import eu.kanade.domain.source.interactor.GetIncognitoState
import eu.kanade.domain.source.interactor.GetLanguagesWithSources
import eu.kanade.domain.source.interactor.GetSourcesWithFavoriteCount
import eu.kanade.domain.source.interactor.SetMigrateSorting
import eu.kanade.domain.source.interactor.ToggleIncognito
import eu.kanade.domain.source.interactor.ToggleLanguage
import eu.kanade.domain.source.interactor.ToggleSource
import eu.kanade.domain.source.interactor.ToggleSourcePin
import eu.kanade.domain.track.interactor.AddTracks
import eu.kanade.domain.track.interactor.RefreshTracks
import eu.kanade.domain.track.interactor.SyncChapterProgressWithTrack
import eu.kanade.domain.track.interactor.TrackChapter
import mihon.data.repository.ExtensionRepoRepositoryImpl
import mihon.domain.chapter.interactor.FilterChaptersForDownload
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo
import mihon.domain.extensionrepo.interactor.DeleteExtensionRepo
import mihon.domain.extensionrepo.interactor.GetExtensionRepo
import mihon.domain.extensionrepo.interactor.GetExtensionRepoCount
import mihon.domain.extensionrepo.interactor.ReplaceExtensionRepo
import mihon.domain.extensionrepo.interactor.UpdateExtensionRepo
import mihon.domain.extensionrepo.repository.ExtensionRepoRepository
import mihon.domain.extensionrepo.service.ExtensionRepoService
import mihon.domain.migration.usecases.MigrateMangaUseCase
import mihon.domain.upcoming.interactor.GetUpcomingManga
import tachiyomi.data.category.CategoryRepositoryImpl
import tachiyomi.data.chapter.ChapterRepositoryImpl
import tachiyomi.data.history.HistoryRepositoryImpl
import tachiyomi.data.manga.MangaRepositoryImpl
import tachiyomi.data.release.ReleaseServiceImpl
import tachiyomi.data.source.SourceRepositoryImpl
import tachiyomi.data.source.StubSourceRepositoryImpl
import tachiyomi.data.track.TrackRepositoryImpl
import tachiyomi.data.updates.UpdatesRepositoryImpl
import tachiyomi.domain.category.interactor.CreateCategoryWithName
import tachiyomi.domain.category.interactor.DeleteCategory
import tachiyomi.domain.category.interactor.GetCategories
import tachiyomi.domain.category.interactor.RenameCategory
import tachiyomi.domain.category.interactor.ReorderCategory
import tachiyomi.domain.category.interactor.ResetCategoryFlags
import tachiyomi.domain.category.interactor.SetDisplayMode
import tachiyomi.domain.category.interactor.SetMangaCategories
import tachiyomi.domain.category.interactor.SetSortModeForCategory
import tachiyomi.domain.category.interactor.UpdateCategory
import tachiyomi.domain.category.repository.CategoryRepository
import tachiyomi.domain.chapter.interactor.GetBookmarkedChaptersByMangaId
import tachiyomi.domain.chapter.interactor.GetChapter
import tachiyomi.domain.chapter.interactor.GetChapterByUrlAndMangaId
import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.chapter.interactor.SetMangaDefaultChapterFlags
import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter
import tachiyomi.domain.chapter.interactor.UpdateChapter
import tachiyomi.domain.chapter.repository.ChapterRepository
import tachiyomi.domain.history.interactor.GetHistory
import tachiyomi.domain.history.interactor.GetNextChapters
import tachiyomi.domain.history.interactor.GetTotalReadDuration
import tachiyomi.domain.history.interactor.RemoveHistory
import tachiyomi.domain.history.interactor.UpsertHistory
import tachiyomi.domain.history.repository.HistoryRepository
import tachiyomi.domain.manga.interactor.FetchInterval
import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga
import tachiyomi.domain.manga.interactor.GetFavorites
import tachiyomi.domain.manga.interactor.GetLibraryManga
import tachiyomi.domain.manga.interactor.GetManga
import tachiyomi.domain.manga.interactor.GetMangaByUrlAndSourceId
import tachiyomi.domain.manga.interactor.GetMangaWithChapters
import tachiyomi.domain.manga.interactor.NetworkToLocalManga
import tachiyomi.domain.manga.interactor.ResetViewerFlags
import tachiyomi.domain.manga.interactor.SetMangaChapterFlags
import tachiyomi.domain.manga.interactor.UpdateMangaNotes
import tachiyomi.domain.manga.repository.MangaRepository
import tachiyomi.domain.release.interactor.GetApplicationRelease
import tachiyomi.domain.release.service.ReleaseService
import tachiyomi.domain.source.interactor.GetRemoteManga
import tachiyomi.domain.source.interactor.GetSourcesWithNonLibraryManga
import tachiyomi.domain.source.repository.SourceRepository
import tachiyomi.domain.source.repository.StubSourceRepository
import tachiyomi.domain.track.interactor.DeleteTrack
import tachiyomi.domain.track.interactor.GetTracks
import tachiyomi.domain.track.interactor.GetTracksPerManga
import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.domain.track.repository.TrackRepository
import tachiyomi.domain.updates.interactor.GetUpdates
import tachiyomi.domain.updates.repository.UpdatesRepository
import uy.kohesive.injekt.api.InjektModule
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.addFactory
import uy.kohesive.injekt.api.addSingletonFactory
import uy.kohesive.injekt.api.get
class DomainModule : InjektModule {
override fun InjektRegistrar.registerInjectables() {
addSingletonFactory<CategoryRepository> { CategoryRepositoryImpl(get()) }
addFactory { GetCategories(get()) }
addFactory { ResetCategoryFlags(get(), get()) }
addFactory { SetDisplayMode(get()) }
addFactory { SetSortModeForCategory(get(), get()) }
addFactory { CreateCategoryWithName(get(), get()) }
addFactory { RenameCategory(get()) }
addFactory { ReorderCategory(get()) }
addFactory { UpdateCategory(get()) }
addFactory { DeleteCategory(get(), get(), get()) }
addSingletonFactory<MangaRepository> { MangaRepositoryImpl(get()) }
addFactory { GetDuplicateLibraryManga(get()) }
addFactory { GetFavorites(get()) }
addFactory { GetLibraryManga(get()) }
addFactory { GetMangaWithChapters(get(), get()) }
addFactory { GetMangaByUrlAndSourceId(get()) }
addFactory { GetManga(get()) }
addFactory { GetNextChapters(get(), get(), get()) }
addFactory { GetUpcomingManga(get()) }
addFactory { ResetViewerFlags(get()) }
addFactory { SetMangaChapterFlags(get()) }
addFactory { FetchInterval(get()) }
addFactory { SetMangaDefaultChapterFlags(get(), get(), get()) }
addFactory { SetMangaViewerFlags(get()) }
addFactory { NetworkToLocalManga(get()) }
addFactory { UpdateManga(get(), get()) }
addFactory { UpdateMangaNotes(get()) }
addFactory { SetMangaCategories(get()) }
addFactory { GetExcludedScanlators(get()) }
addFactory { SetExcludedScanlators(get()) }
addFactory {
MigrateMangaUseCase(
get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(),
)
}
addSingletonFactory<ReleaseService> { ReleaseServiceImpl(get(), get()) }
addFactory { GetApplicationRelease(get(), get()) }
addSingletonFactory<TrackRepository> { TrackRepositoryImpl(get()) }
addFactory { TrackChapter(get(), get(), get(), get()) }
addFactory { AddTracks(get(), get(), get(), get()) }
addFactory { RefreshTracks(get(), get(), get(), get()) }
addFactory { DeleteTrack(get()) }
addFactory { GetTracksPerManga(get()) }
addFactory { GetTracks(get()) }
addFactory { InsertTrack(get()) }
addFactory { SyncChapterProgressWithTrack(get(), get(), get()) }
addSingletonFactory<ChapterRepository> { ChapterRepositoryImpl(get()) }
addFactory { GetChapter(get()) }
addFactory { GetChaptersByMangaId(get()) }
addFactory { GetBookmarkedChaptersByMangaId(get()) }
addFactory { GetChapterByUrlAndMangaId(get()) }
addFactory { UpdateChapter(get()) }
addFactory { SetReadStatus(get(), get(), get(), get()) }
addFactory { ShouldUpdateDbChapter() }
addFactory { SyncChaptersWithSource(get(), get(), get(), get(), get(), get(), get(), get(), get()) }
addFactory { GetAvailableScanlators(get()) }
addFactory { FilterChaptersForDownload(get(), get(), get()) }
addSingletonFactory<HistoryRepository> { HistoryRepositoryImpl(get()) }
addFactory { GetHistory(get()) }
addFactory { UpsertHistory(get()) }
addFactory { RemoveHistory(get()) }
addFactory { GetTotalReadDuration(get()) }
addFactory { DeleteDownload(get(), get()) }
addFactory { GetExtensionsByType(get(), get()) }
addFactory { GetExtensionSources(get()) }
addFactory { GetExtensionLanguages(get(), get()) }
addSingletonFactory<UpdatesRepository> { UpdatesRepositoryImpl(get()) }
addFactory { GetUpdates(get()) }
addSingletonFactory<SourceRepository> { SourceRepositoryImpl(get(), get()) }
addSingletonFactory<StubSourceRepository> { StubSourceRepositoryImpl(get()) }
addFactory { GetEnabledSources(get(), get()) }
addFactory { GetLanguagesWithSources(get(), get()) }
addFactory { GetRemoteManga(get()) }
addFactory { GetSourcesWithFavoriteCount(get(), get()) }
addFactory { GetSourcesWithNonLibraryManga(get()) }
addFactory { SetMigrateSorting(get()) }
addFactory { ToggleLanguage(get()) }
addFactory { ToggleSource(get()) }
addFactory { ToggleSourcePin(get()) }
addFactory { TrustExtension(get(), get()) }
addSingletonFactory<ExtensionRepoRepository> { ExtensionRepoRepositoryImpl(get()) }
addFactory { ExtensionRepoService(get(), get()) }
addFactory { GetExtensionRepo(get()) }
addFactory { GetExtensionRepoCount(get()) }
addFactory { CreateExtensionRepo(get(), get()) }
addFactory { DeleteExtensionRepo(get()) }
addFactory { ReplaceExtensionRepo(get()) }
addFactory { UpdateExtensionRepo(get(), get()) }
addFactory { ToggleIncognito(get()) }
addFactory { GetIncognitoState(get(), get(), get()) }
}
}
@@ -2,11 +2,15 @@ package eu.kanade.domain.base
import android.content.Context
import dev.icerock.moko.resources.StringResource
import eu.kanade.tachiyomi.util.system.GLUtil
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.Inject
import dev.zacsweers.metro.SingleIn
import tachiyomi.core.common.preference.Preference
import tachiyomi.core.common.preference.PreferenceStore
import tachiyomi.i18n.MR
@Inject
@SingleIn(AppScope::class)
class BasePreferences(
val context: Context,
preferenceStore: PreferenceStore,
@@ -33,17 +37,7 @@ class BasePreferences(
PRIVATE(MR.strings.ext_installer_private, false),
}
val displayProfile: Preference<String> = preferenceStore.getString("pref_display_profile_key", "")
val hardwareBitmapThreshold: Preference<Int> = preferenceStore.getInt(
"pref_hardware_bitmap_threshold",
GLUtil.SAFE_TEXTURE_LIMIT,
)
val alwaysDecodeLongStripWithSSIV: Preference<Boolean> = preferenceStore.getBoolean(
"pref_always_decode_long_strip_with_ssiv",
false,
)
val highQualityRenderer: Preference<Boolean> = preferenceStore.getBoolean("pref_high_quality_renderer_key", false)
val installationId: Preference<String> = preferenceStore.getString(Preference.appStateKey("installation_id"), "")
@@ -51,4 +45,9 @@ class BasePreferences(
Preference.appStateKey("donation_campaign_shown"),
false,
)
val skippedAppUpdate: Preference<String> = preferenceStore.getString(
Preference.appStateKey("skipped_app_update"),
"",
)
}
@@ -1,9 +1,11 @@
package eu.kanade.domain.chapter.interactor
import dev.zacsweers.metro.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import tachiyomi.domain.chapter.repository.ChapterRepository
@Inject
class GetAvailableScanlators(
private val repository: ChapterRepository,
) {
@@ -1,8 +1,8 @@
package eu.kanade.domain.chapter.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.download.interactor.DeleteDownload
import logcat.LogPriority
import tachiyomi.core.common.util.lang.withNonCancellableContext
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.chapter.model.ChapterUpdate
@@ -11,6 +11,7 @@ import tachiyomi.domain.download.service.DownloadPreferences
import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.manga.repository.MangaRepository
@Inject
class SetReadStatus(
private val downloadPreferences: DownloadPreferences,
private val deleteDownload: DeleteDownload,
@@ -19,14 +20,13 @@ class SetReadStatus(
) {
private val mapper = { chapter: Chapter, read: Boolean ->
ChapterUpdate(
read = read,
lastPageRead = if (!read) 0 else null,
id = chapter.id,
)
ChapterUpdate(chapter.id) {
this.read = read
if (!read) lastPageRead = 0
}
}
suspend fun await(read: Boolean, vararg chapters: Chapter): Result = withNonCancellableContext {
suspend fun await(read: Boolean, vararg chapters: Chapter): Result {
val chaptersToUpdate = chapters.filter {
when (read) {
true -> !it.read
@@ -34,7 +34,7 @@ class SetReadStatus(
}
}
if (chaptersToUpdate.isEmpty()) {
return@withNonCancellableContext Result.NoChapters
return Result.NoChapters
}
try {
@@ -43,11 +43,14 @@ class SetReadStatus(
)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
return@withNonCancellableContext Result.InternalError(e)
return Result.InternalError(e)
}
if (read && downloadPreferences.removeAfterMarkedAsRead.get()) {
chaptersToUpdate
// Chapters here still carry their pre-update read state; downstream
// deletion filtering (excluded categories) relies on the new state.
.map { it.copy(read = true) }
.groupBy { it.mangaId }
.forEach { (mangaId, chapters) ->
deleteDownload.awaitAll(
@@ -57,17 +60,16 @@ class SetReadStatus(
}
}
Result.Success
return Result.Success
}
suspend fun await(mangaId: Long, read: Boolean): Result = withNonCancellableContext {
suspend fun await(mangaId: Long, read: Boolean): Result =
await(
read = read,
chapters = chapterRepository
.getChapterByMangaId(mangaId)
.toTypedArray(),
)
}
suspend fun await(manga: Manga, read: Boolean) =
await(manga.id, read)
@@ -1,5 +1,6 @@
package eu.kanade.domain.chapter.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.chapter.model.copyFromSChapter
import eu.kanade.domain.chapter.model.toSChapter
import eu.kanade.domain.manga.interactor.GetExcludedScanlators
@@ -10,30 +11,32 @@ import eu.kanade.tachiyomi.data.download.DownloadProvider
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toInstant
import kotlinx.datetime.toLocalDateTime
import tachiyomi.data.chapter.ChapterSanitizer
import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter
import tachiyomi.domain.chapter.interactor.UpdateChapter
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.chapter.model.ChapterRemoteUpdate
import tachiyomi.domain.chapter.model.NoChaptersException
import tachiyomi.domain.chapter.model.toChapterUpdate
import tachiyomi.domain.chapter.repository.ChapterRepository
import tachiyomi.domain.chapter.service.ChapterRecognition
import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.domain.manga.model.Manga
import tachiyomi.source.local.isLocal
import java.lang.Long.max
import java.time.ZonedDateTime
import java.util.TreeSet
import kotlin.time.Clock
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Instant
@Inject
class SyncChaptersWithSource(
private val downloadManager: DownloadManager,
private val downloadProvider: DownloadProvider,
private val chapterRepository: ChapterRepository,
private val shouldUpdateDbChapter: ShouldUpdateDbChapter,
private val updateManga: UpdateManga,
private val updateChapter: UpdateChapter,
private val getChaptersByMangaId: GetChaptersByMangaId,
private val getExcludedScanlators: GetExcludedScanlators,
private val libraryPreferences: LibraryPreferences,
) {
@@ -51,14 +54,15 @@ class SyncChaptersWithSource(
manga: Manga,
source: Source,
manualFetch: Boolean = false,
fetchWindow: Pair<Long, Long> = Pair(0, 0),
fetchWindow: ClosedRange<Instant>? = null,
): List<Chapter> {
if (rawSourceChapters.isEmpty() && !source.isLocal()) {
throw NoChaptersException()
}
val now = ZonedDateTime.now()
val nowMillis = now.toInstant().toEpochMilli()
val timeZone = TimeZone.currentSystemDefault()
val now = Clock.System.now().toLocalDateTime(timeZone)
val nowInstant = now.toInstant(timeZone)
val sourceChapters = rawSourceChapters
.distinctBy { it.url }
@@ -69,42 +73,46 @@ class SyncChaptersWithSource(
.copy(mangaId = manga.id, sourceOrder = i.toLong())
}
val dbChapters = getChaptersByMangaId.await(manga.id)
val dbChapters = chapterRepository.getChapterByMangaId(manga.id)
val dbChaptersByUrl = dbChapters.associateBy { it.url }
val newChapters = mutableListOf<Chapter>()
val updatedChapters = mutableListOf<Chapter>()
val removedChapters = dbChapters.filterNot { dbChapter ->
sourceChapters.any { sourceChapter ->
dbChapter.url == sourceChapter.url
}
}
val updatedChapters = mutableListOf<ChapterRemoteUpdate>()
val sourceUrls = mutableSetOf<String>()
// Used to not set upload date of older chapters
// to a higher value than newer chapters
var maxSeenUploadDate = 0L
var maxSeenUploadDate: Instant? = null
for (sourceChapter in sourceChapters) {
var chapter = sourceChapter
// Update metadata from source if necessary.
if (source is HttpSource) {
// Update metadata from source if necessary.
val preparedChapters = if (source is HttpSource) {
val sManga = manga.toSManga()
sourceChapters.map { chapter ->
val sChapter = chapter.toSChapter()
source.prepareNewChapter(sChapter, manga.toSManga())
chapter = chapter.copyFromSChapter(sChapter)
@Suppress("DEPRECATION")
source.prepareNewChapter(sChapter, sManga)
chapter.copyFromSChapter(sChapter)
}
} else {
sourceChapters
}
// Recognize chapter numbers, from the whole list since names alone don't always tell.
val recognizedChapters = preparedChapters
.zip(ChapterRecognition.parseChapterNumbers(manga.title, preparedChapters)) { chapter, numbering ->
chapter.copy(chapterNumber = numbering.chapter?.let(ChapterRecognition::toDouble) ?: -1.0)
}
// Recognize chapter number for the chapter.
val chapterNumber = ChapterRecognition.parseChapterNumber(manga.title, chapter.name, chapter.chapterNumber)
chapter = chapter.copy(chapterNumber = chapterNumber)
for (chapter in recognizedChapters) {
if (!sourceUrls.add(chapter.url)) continue
val dbChapter = dbChapters.find { it.url == chapter.url }
val dbChapter = dbChaptersByUrl[chapter.url]
if (dbChapter == null) {
val toAddChapter = if (chapter.dateUpload == 0L) {
val altDateUpload = if (maxSeenUploadDate == 0L) nowMillis else maxSeenUploadDate
chapter.copy(dateUpload = altDateUpload)
val toAddChapter = if (chapter.dateUpload == null) {
chapter.copy(dateUpload = maxSeenUploadDate ?: nowInstant)
} else {
maxSeenUploadDate = max(maxSeenUploadDate, sourceChapter.dateUpload)
maxSeenUploadDate = listOfNotNull(maxSeenUploadDate, chapter.dateUpload).maxOrNull()
chapter
}
newChapters.add(toAddChapter)
@@ -123,26 +131,36 @@ class SyncChaptersWithSource(
downloadManager.renameChapter(source, manga, dbChapter, chapter)
}
var toChangeChapter = dbChapter.copy(
name = chapter.name,
chapterNumber = chapter.chapterNumber,
scanlator = chapter.scanlator,
sourceOrder = chapter.sourceOrder,
updatedChapters.add(
ChapterRemoteUpdate(
id = dbChapter.id,
name = chapter.name,
chapterNumber = chapter.chapterNumber,
scanlator = chapter.scanlator,
sourceOrder = chapter.sourceOrder,
dateUpload = chapter.dateUpload,
memo = chapter.memo,
),
)
if (chapter.dateUpload != 0L) {
toChangeChapter = toChangeChapter.copy(dateUpload = chapter.dateUpload)
}
updatedChapters.add(toChangeChapter)
}
}
}
val removedChapters = dbChapters.filterNot { it.url in sourceUrls }
// The source no longer lists these, so their queued downloads could only fail
removedChapters.mapNotNull { downloadManager.getQueuedDownloadOrNull(it.id) }
.takeIf { it.isNotEmpty() }
?.let { downloadManager.cancelQueuedDownloads(it) }
// Return if there's nothing to add, delete, or update to avoid unnecessary db transactions.
if (newChapters.isEmpty() && removedChapters.isEmpty() && updatedChapters.isEmpty()) {
if (manualFetch || manga.fetchInterval == 0 || manga.nextUpdate < fetchWindow.first) {
val isNextUpdateBeforeWindow = fetchWindow != null &&
manga.nextUpdate.let { it == null || it < fetchWindow.start }
if (manualFetch || manga.fetchInterval == 0 || isNextUpdateBeforeWindow) {
updateManga.awaitUpdateFetchInterval(
manga,
timeZone,
now,
fetchWindow,
)
@@ -177,8 +195,8 @@ class SyncChaptersWithSource(
// Date fetch is set in such a way that the upper ones will have bigger value than the lower ones
// Sources MUST return the chapters from most to less recent, which is common.
var itemCount = newChapters.size
var updatedToAdd = newChapters.map { toAddItem ->
var chapter = toAddItem.copy(dateFetch = nowMillis + itemCount--)
val toAdd = newChapters.map { toAddItem ->
var chapter = toAddItem.copy(dateFetch = nowInstant + (itemCount--).milliseconds)
if (chapter.chapterNumber in readChapterNumbers && markDuplicateAsRead) {
changedOrDuplicateReadUrls.add(chapter.url)
@@ -202,27 +220,25 @@ class SyncChaptersWithSource(
chapter
}
if (removedChapters.isNotEmpty()) {
val toDeleteIds = removedChapters.map { it.id }
chapterRepository.removeChaptersWithIds(toDeleteIds)
}
if (updatedToAdd.isNotEmpty()) {
updatedToAdd = chapterRepository.addAll(updatedToAdd)
}
if (updatedChapters.isNotEmpty()) {
val chapterUpdates = updatedChapters.map { it.toChapterUpdate() }
updateChapter.awaitAll(chapterUpdates)
}
updateManga.awaitUpdateFetchInterval(manga, now, fetchWindow)
// Set this manga as updated since chapters were changed
// Note that last_update actually represents last time the chapter list changed at all
updateManga.awaitUpdateLastUpdate(manga.id)
val added = chapterRepository.updateFromRemote(
removedIds = removedChapters.map { it.id },
added = toAdd,
updated = updatedChapters,
)
val excludedScanlators = getExcludedScanlators.await(manga.id).toHashSet()
return updatedToAdd.filterNot { it.url in changedOrDuplicateReadUrls || it.scanlator in excludedScanlators }
// A first fetch lists the back catalogue, and chapters coming back under a deleted number were out already
val foundRelease = dbChapters.isNotEmpty() &&
toAdd.any { chapter ->
chapter.scanlator !in excludedScanlators &&
!(chapter.isRecognizedNumber && chapter.chapterNumber in deletedChapterNumbers)
}
// Set this manga as updated since chapters were changed
// Note that last_update actually represents last time the chapter list changed at all
updateManga.awaitUpdateFetchIntervalAndLastUpdate(manga, timeZone, now, fetchWindow, foundRelease)
return added.filterNot { it.url in changedOrDuplicateReadUrls || it.scanlator in excludedScanlators }
}
}
@@ -1,18 +1,18 @@
package eu.kanade.domain.chapter.model
import eu.kanade.tachiyomi.data.database.models.ChapterImpl
import eu.kanade.tachiyomi.source.model.SChapter
import mihon.core.common.extensions.toEpochMillisOrZero
import mihon.core.common.extensions.toInstantOrNull
import tachiyomi.domain.chapter.model.Chapter
import eu.kanade.tachiyomi.data.database.models.Chapter as DbChapter
// TODO: Remove when all deps are migrated
fun Chapter.toSChapter(): SChapter {
return SChapter.create().also {
it.url = url
it.name = name
it.date_upload = dateUpload
it.date_upload = dateUpload.toEpochMillisOrZero()
it.chapter_number = chapterNumber.toFloat()
it.scanlator = scanlator
it.memo = memo
}
}
@@ -20,23 +20,9 @@ fun Chapter.copyFromSChapter(sChapter: SChapter): Chapter {
return this.copy(
name = sChapter.name,
url = sChapter.url,
dateUpload = sChapter.date_upload,
dateUpload = sChapter.date_upload.toInstantOrNull(),
chapterNumber = sChapter.chapter_number.toDouble(),
scanlator = sChapter.scanlator?.ifBlank { null }?.trim(),
memo = sChapter.memo,
)
}
fun Chapter.toDbChapter(): DbChapter = ChapterImpl().also {
it.id = id
it.manga_id = mangaId
it.url = url
it.name = name
it.scanlator = scanlator
it.read = read
it.bookmark = bookmark
it.last_page_read = lastPageRead.toInt()
it.date_fetch = dateFetch
it.date_upload = dateUpload
it.chapter_number = chapterNumber.toFloat()
it.source_order = sourceOrder.toInt()
}
@@ -1,17 +1,18 @@
package eu.kanade.domain.download.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.tachiyomi.data.download.DownloadManager
import tachiyomi.core.common.util.lang.withNonCancellableContext
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.service.SourceManager
@Inject
class DeleteDownload(
private val sourceManager: SourceManager,
private val downloadManager: DownloadManager,
) {
suspend fun awaitAll(manga: Manga, vararg chapters: Chapter) = withNonCancellableContext {
suspend fun awaitAll(manga: Manga, vararg chapters: Chapter) {
sourceManager.get(manga.source)?.let { source ->
downloadManager.deleteChapters(chapters.toList(), manga, source)
}
@@ -1,11 +1,13 @@
package eu.kanade.domain.extension.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@Inject
class GetExtensionLanguages(
private val preferences: SourcePreferences,
private val extensionManager: ExtensionManager,
@@ -17,11 +19,7 @@ class GetExtensionLanguages(
) { enabledLanguage, availableExtensions ->
availableExtensions
.flatMap { ext ->
if (ext.sources.isEmpty()) {
listOf(ext.lang)
} else {
ext.sources.map { it.lang }
}
ext.sources.map { it.lang }
}
.distinct()
.sortedWith(
@@ -1,16 +1,18 @@
package eu.kanade.domain.extension.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.source.Source
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
@Inject
class GetExtensionSources(
private val preferences: SourcePreferences,
) {
fun subscribe(extension: Extension.Installed): Flow<List<ExtensionSourceItem>> {
fun subscribe(extension: Extension.Loaded): Flow<List<ExtensionSourceItem>> {
val isMultiSource = extension.sources.size > 1
val isMultiLangSingleSource =
isMultiSource && extension.sources.map { it.name }.distinct().size == 1
@@ -1,5 +1,6 @@
package eu.kanade.domain.extension.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.extension.model.Extensions
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.extension.ExtensionManager
@@ -7,41 +8,35 @@ import eu.kanade.tachiyomi.extension.model.Extension
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@Inject
class GetExtensionsByType(
private val preferences: SourcePreferences,
private val extensionManager: ExtensionManager,
) {
fun subscribe(): Flow<Extensions> {
val showNsfwSources = preferences.showNsfwSource.get()
val enabledContentWarnings = preferences.enabledContentWarnings.get()
return combine(
preferences.enabledLanguages.changes(),
extensionManager.installedExtensionsFlow,
extensionManager.untrustedExtensionsFlow,
extensionManager.loadedExtensionsFlow,
extensionManager.notLoadedExtensionsFlow,
extensionManager.availableExtensionsFlow,
) { enabledLanguages, _installed, _untrusted, _available ->
val (updates, installed) = _installed
.filter { (showNsfwSources || !it.isNsfw) }
.sortedWith(
compareBy<Extension.Installed> { !it.isObsolete }
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name },
)
.partition { it.hasUpdate }
) { enabledLanguages, _loaded, _notLoaded, _available ->
val byName = compareBy<Extension, String>(String.CASE_INSENSITIVE_ORDER) { it.name }
val untrusted = _untrusted
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name })
val (loadedUpdates, loaded) = _loaded.partition { it.hasUpdate }
val (notLoadedUpdates, notLoaded) = _notLoaded.partition { it.hasUpdate }
val updates = (loadedUpdates + notLoadedUpdates).sortedWith(byName)
val installedSignatures = (_loaded + _notLoaded).groupBy({ it.pkgName }, { it.signatures })
val available = _available
.filter { extension ->
_installed.none { it.pkgName == extension.pkgName } &&
_untrusted.none { it.pkgName == extension.pkgName } &&
(showNsfwSources || !extension.isNsfw)
installedSignatures[extension.pkgName].orEmpty().none { extension.store.signingKey in it } &&
extension.contentWarning in enabledContentWarnings
}
.flatMap { ext ->
if (ext.sources.isEmpty()) {
return@flatMap if (ext.lang in enabledLanguages) listOf(ext) else emptyList()
}
ext.sources.filter { it.lang in enabledLanguages }
.map {
ext.copy(
@@ -52,9 +47,17 @@ class GetExtensionsByType(
)
}
}
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name })
.sortedWith(
compareBy<Extension.Available, String>(String.CASE_INSENSITIVE_ORDER) { it.name }
.thenBy { it.store.signingKey },
)
Extensions(updates, installed, available, untrusted)
Extensions(
updates = updates,
loaded = loaded.sortedWith(compareBy<Extension.Loaded> { !it.isObsolete }.then(byName)),
available = available,
notLoaded = notLoaded.sortedWith(byName),
)
}
}
}
@@ -2,17 +2,25 @@ package eu.kanade.domain.extension.interactor
import android.content.pm.PackageInfo
import androidx.core.content.pm.PackageInfoCompat
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import mihon.domain.extensionrepo.repository.ExtensionRepoRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
import mihon.domain.extension.model.ExtensionStore
import mihon.domain.extension.repository.ExtensionStoreRepository
import tachiyomi.core.common.preference.getAndSet
@Inject
class TrustExtension(
private val extensionRepoRepository: ExtensionRepoRepository,
private val repository: ExtensionStoreRepository,
private val preferences: SourcePreferences,
) {
suspend fun isTrusted(pkgInfo: PackageInfo, fingerprints: List<String>): Boolean {
val trustedFingerprints = extensionRepoRepository.getAll().map { it.signingKeyFingerprint }.toHashSet()
fun isTrusted(pkgInfo: PackageInfo, fingerprints: List<String>, stores: List<ExtensionStore>): Boolean {
val trustedFingerprints = stores.mapTo(HashSet()) { it.signingKey }
val key = "${pkgInfo.packageName}:${PackageInfoCompat.getLongVersionCode(pkgInfo)}:${fingerprints.last()}"
return trustedFingerprints.any { fingerprints.contains(it) } || key in preferences.trustedExtensions.get()
}
@@ -29,4 +37,23 @@ class TrustExtension(
fun revokeAll() {
preferences.trustedExtensions.delete()
}
/**
* Emits whenever what counts as trusted changes, either because a store was added or removed or
* because an extension was trusted or had its trust revoked. Both sources replay their current
* value, which is dropped.
*/
fun changes(): Flow<Unit> {
return merge(
// Stores are rewritten whenever their index is refreshed, so only their keys matter here
repository.getAllAsFlow()
.map { stores -> stores.mapTo(HashSet()) { it.signingKey } }
.distinctUntilChanged()
.drop(1),
preferences.trustedExtensions.changes()
.distinctUntilChanged()
.drop(1),
)
.map {}
}
}
@@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.extension.model.Extension
data class Extensions(
val updates: List<Extension.Installed>,
val installed: List<Extension.Installed>,
val loaded: List<Extension.Loaded>,
val available: List<Extension.Available>,
val untrusted: List<Extension.Untrusted>,
val notLoaded: List<Extension.NotLoaded>,
)
@@ -1,24 +1,19 @@
package eu.kanade.domain.manga.interactor
import dev.zacsweers.metro.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import tachiyomi.data.DatabaseHandler
import tachiyomi.domain.manga.repository.MangaRepository
@Inject
class GetExcludedScanlators(
private val handler: DatabaseHandler,
private val mangaRepository: MangaRepository,
) {
suspend fun await(mangaId: Long): Set<String> {
return handler.awaitList {
excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
}
.toSet()
return mangaRepository.getExcludedScanlators(mangaId)
}
fun subscribe(mangaId: Long): Flow<Set<String>> {
return handler.subscribeToList {
excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
}
.map { it.toSet() }
return mangaRepository.getExcludedScanlatorsAsFlow(mangaId)
}
}
@@ -1,22 +1,14 @@
package eu.kanade.domain.manga.interactor
import tachiyomi.data.DatabaseHandler
import dev.zacsweers.metro.Inject
import tachiyomi.domain.manga.repository.MangaRepository
@Inject
class SetExcludedScanlators(
private val handler: DatabaseHandler,
private val mangaRepository: MangaRepository,
) {
suspend fun await(mangaId: Long, excludedScanlators: Set<String>) {
handler.await(inTransaction = true) {
val currentExcluded = handler.awaitList {
excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
}.toSet()
val toAdd = excludedScanlators.minus(currentExcluded)
for (scanlator in toAdd) {
excluded_scanlatorsQueries.insert(mangaId, scanlator)
}
val toRemove = currentExcluded.minus(excludedScanlators)
excluded_scanlatorsQueries.remove(mangaId, toRemove)
}
mangaRepository.setExcludedScanlators(mangaId, excludedScanlators)
}
}
@@ -1,10 +1,12 @@
package eu.kanade.domain.manga.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import tachiyomi.domain.manga.model.MangaUpdate
import tachiyomi.domain.manga.repository.MangaRepository
@Inject
class SetMangaViewerFlags(
private val mangaRepository: MangaRepository,
) {
@@ -12,20 +14,18 @@ class SetMangaViewerFlags(
suspend fun awaitSetReadingMode(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update(
MangaUpdate(
id = id,
viewerFlags = manga.viewerFlags.setFlag(flag, ReadingMode.MASK.toLong()),
),
MangaUpdate(id) {
viewerFlags = manga.viewerFlags.setFlag(flag, ReadingMode.MASK.toLong())
},
)
}
suspend fun awaitSetOrientation(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update(
MangaUpdate(
id = id,
viewerFlags = manga.viewerFlags.setFlag(flag, ReaderOrientation.MASK.toLong()),
),
MangaUpdate(id) {
viewerFlags = manga.viewerFlags.setFlag(flag, ReaderOrientation.MASK.toLong())
},
)
}
@@ -1,20 +1,17 @@
package eu.kanade.domain.manga.interactor
import eu.kanade.domain.manga.model.hasCustomCover
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.download.DownloadManager
import eu.kanade.tachiyomi.source.model.SManga
import tachiyomi.domain.library.service.LibraryPreferences
import dev.zacsweers.metro.Inject
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
import tachiyomi.domain.manga.interactor.FetchInterval
import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.manga.model.MangaUpdate
import tachiyomi.domain.manga.repository.MangaRepository
import tachiyomi.source.local.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.time.Instant
import java.time.ZonedDateTime
import kotlin.time.Clock
import kotlin.time.Instant
@Inject
class UpdateManga(
private val mangaRepository: MangaRepository,
private val fetchInterval: FetchInterval,
@@ -28,92 +25,47 @@ class UpdateManga(
return mangaRepository.updateAll(mangaUpdates)
}
suspend fun awaitUpdateFromSource(
localManga: Manga,
remoteManga: SManga,
manualFetch: Boolean,
coverCache: CoverCache = Injekt.get(),
libraryPreferences: LibraryPreferences = Injekt.get(),
downloadManager: DownloadManager = Injekt.get(),
): Boolean {
val remoteTitle = try {
remoteManga.title
} catch (_: UninitializedPropertyAccessException) {
""
}
// if the manga isn't a favorite (or 'update titles' preference is enabled), set its title from source and update in db
val title =
if (remoteTitle.isNotEmpty() && (!localManga.favorite || libraryPreferences.updateMangaTitles.get())) {
remoteTitle
} else {
null
}
val coverLastModified =
when {
// Never refresh covers if the url is empty to avoid "losing" existing covers
remoteManga.thumbnail_url.isNullOrEmpty() -> null
!manualFetch && localManga.thumbnailUrl == remoteManga.thumbnail_url -> null
localManga.isLocal() -> Instant.now().toEpochMilli()
localManga.hasCustomCover(coverCache) -> {
coverCache.deleteFromCache(localManga, false)
null
}
else -> {
coverCache.deleteFromCache(localManga, false)
Instant.now().toEpochMilli()
}
}
val thumbnailUrl = remoteManga.thumbnail_url?.takeIf { it.isNotEmpty() }
val success = mangaRepository.update(
MangaUpdate(
id = localManga.id,
title = title,
coverLastModified = coverLastModified,
author = remoteManga.author,
artist = remoteManga.artist,
description = remoteManga.description,
genre = remoteManga.getGenres(),
thumbnailUrl = thumbnailUrl,
status = remoteManga.status.toLong(),
updateStrategy = remoteManga.update_strategy,
initialized = true,
),
)
if (success && title != null) {
downloadManager.renameManga(localManga, title)
}
return success
}
suspend fun awaitUpdateFetchInterval(
manga: Manga,
dateTime: ZonedDateTime = ZonedDateTime.now(),
window: Pair<Long, Long> = fetchInterval.getWindow(dateTime),
timeZone: TimeZone = TimeZone.currentSystemDefault(),
dateTime: LocalDateTime = Clock.System.now().toLocalDateTime(timeZone),
window: ClosedRange<Instant>? = fetchInterval.getWindow(dateTime.date, timeZone),
): Boolean {
return mangaRepository.update(
fetchInterval.toMangaUpdate(manga, dateTime, window),
fetchInterval.withFetchInterval(manga, dateTime, timeZone, window),
)
}
suspend fun awaitUpdateLastUpdate(mangaId: Long): Boolean {
return mangaRepository.update(MangaUpdate(id = mangaId, lastUpdate = Instant.now().toEpochMilli()))
/**
* Updates the fetch interval and marks the chapter list as changed in a single write.
*/
suspend fun awaitUpdateFetchIntervalAndLastUpdate(
manga: Manga,
timeZone: TimeZone,
dateTime: LocalDateTime,
window: ClosedRange<Instant>?,
foundRelease: Boolean,
): Boolean {
return mangaRepository.update(
fetchInterval.withFetchInterval(manga, dateTime, timeZone, window, foundRelease).apply {
lastUpdate = Clock.System.now()
},
)
}
suspend fun awaitUpdateCoverLastModified(mangaId: Long): Boolean {
return mangaRepository.update(MangaUpdate(id = mangaId, coverLastModified = Instant.now().toEpochMilli()))
return mangaRepository.update(
MangaUpdate(mangaId) {
coverLastModified = Clock.System.now()
},
)
}
suspend fun awaitUpdateFavorite(mangaId: Long, favorite: Boolean): Boolean {
val dateAdded = when (favorite) {
true -> Instant.now().toEpochMilli()
false -> 0
val update = when (favorite) {
true -> MangaUpdate(mangaId) { favoriteAt = Clock.System.now() }
false -> MangaUpdate(mangaId) { favoriteAt = null }
}
return mangaRepository.update(
MangaUpdate(id = mangaId, favorite = favorite, dateAdded = dateAdded),
)
return mangaRepository.update(update)
}
}
@@ -1,10 +1,14 @@
package eu.kanade.domain.manga.model
import eu.kanade.domain.base.BasePreferences
import android.content.Context
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import kotlinx.datetime.TimeZone
import kotlinx.datetime.number
import kotlinx.datetime.toLocalDateTime
import mihon.app.di.appGraph
import tachiyomi.core.common.preference.TriState
import tachiyomi.core.metadata.comicinfo.ComicInfo
import tachiyomi.core.metadata.comicinfo.ComicInfoPublishingStatus
@@ -22,7 +26,7 @@ val Manga.readerOrientation: Long
val Manga.downloadedFilter: TriState
get() {
if (Injekt.get<BasePreferences>().downloadedOnly.get()) return TriState.ENABLED_IS
if (Injekt.get<Context>().appGraph.basePreferences.downloadedOnly.get()) return TriState.ENABLED_IS
return when (downloadedFilterRaw) {
Manga.CHAPTER_SHOW_DOWNLOADED -> TriState.ENABLED_IS
Manga.CHAPTER_SHOW_NOT_DOWNLOADED -> TriState.ENABLED_NOT
@@ -45,6 +49,7 @@ fun Manga.toSManga(): SManga = SManga.create().also {
it.status = status.toInt()
it.thumbnail_url = thumbnailUrl
it.initialized = initialized
it.memo = memo
}
fun Manga.copyFrom(other: SManga): Manga {
@@ -66,11 +71,12 @@ fun Manga.copyFrom(other: SManga): Manga {
status = other.status.toLong(),
updateStrategy = other.update_strategy,
initialized = other.initialized && initialized,
memo = other.memo,
)
}
fun Manga.hasCustomCover(coverCache: CoverCache = Injekt.get()): Boolean {
return coverCache.getCustomCoverFile(id).exists()
fun Manga.hasCustomCover(coverCache: CoverCache = Injekt.get<Context>().appGraph.coverCache): Boolean {
return coverCache.hasCustomCover(id)
}
/**
@@ -82,30 +88,37 @@ fun getComicInfo(
urls: List<String>,
categories: List<String>?,
sourceName: String,
) = ComicInfo(
title = ComicInfo.Title(chapter.name),
series = ComicInfo.Series(manga.title),
number = chapter.chapterNumber.takeIf { it >= 0 }?.let {
if ((it.rem(1) == 0.0)) {
ComicInfo.Number(it.toInt().toString())
} else {
ComicInfo.Number(it.toString())
}
},
web = ComicInfo.Web(urls.joinToString(" ")),
summary = manga.description?.let { ComicInfo.Summary(it) },
writer = manga.author?.let { ComicInfo.Writer(it) },
penciller = manga.artist?.let { ComicInfo.Penciller(it) },
translator = chapter.scanlator?.let { ComicInfo.Translator(it) },
genre = manga.genre?.let { ComicInfo.Genre(it.joinToString()) },
publishingStatus = ComicInfo.PublishingStatusTachiyomi(
ComicInfoPublishingStatus.toComicInfoValue(manga.status),
),
categories = categories?.let { ComicInfo.CategoriesTachiyomi(it.joinToString()) },
source = ComicInfo.SourceMihon(sourceName),
inker = null,
colorist = null,
letterer = null,
coverArtist = null,
tags = null,
)
): ComicInfo {
val date = chapter.dateUpload?.toLocalDateTime(TimeZone.currentSystemDefault())
return ComicInfo(
title = ComicInfo.Title(chapter.name),
series = ComicInfo.Series(manga.title),
number = chapter.chapterNumber.takeIf { it >= 0 }?.let {
if ((it.rem(1) == 0.0)) {
ComicInfo.Number(it.toInt().toString())
} else {
ComicInfo.Number(it.toString())
}
},
web = ComicInfo.Web(urls.joinToString(" ")),
summary = manga.description?.let { ComicInfo.Summary(it) },
writer = manga.author?.let { ComicInfo.Writer(it) },
penciller = manga.artist?.let { ComicInfo.Penciller(it) },
translator = chapter.scanlator?.let { ComicInfo.Translator(it) },
genre = manga.genre?.let { ComicInfo.Genre(it.joinToString()) },
publishingStatus = ComicInfo.PublishingStatusTachiyomi(
ComicInfoPublishingStatus.toComicInfoValue(manga.status),
),
categories = categories?.let { ComicInfo.CategoriesTachiyomi(it.joinToString()) },
source = ComicInfo.SourceMihon(sourceName),
inker = null,
colorist = null,
letterer = null,
coverArtist = null,
tags = null,
year = date?.year?.let { ComicInfo.Year(it) },
month = date?.month?.number?.let { ComicInfo.Month(it) },
day = date?.day?.let { ComicInfo.Day(it) },
)
}
@@ -1,5 +1,6 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@@ -10,6 +11,7 @@ import tachiyomi.domain.source.model.Source
import tachiyomi.domain.source.repository.SourceRepository
import tachiyomi.source.local.isLocal
@Inject
class GetEnabledSources(
private val repository: SourceRepository,
private val preferences: SourcePreferences,
@@ -1,5 +1,6 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.base.BasePreferences
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.extension.ExtensionManager
@@ -7,12 +8,13 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
@Inject
class GetIncognitoState(
private val basePreferences: BasePreferences,
private val sourcePreferences: SourcePreferences,
private val extensionManager: ExtensionManager,
) {
fun await(sourceId: Long?): Boolean {
suspend fun await(sourceId: Long?): Boolean {
if (basePreferences.incognitoMode.get()) return true
if (sourceId == null) return false
val extensionPackage = extensionManager.getExtensionPackage(sourceId) ?: return false
@@ -1,5 +1,6 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.coroutines.flow.Flow
@@ -8,6 +9,7 @@ import tachiyomi.domain.source.model.Source
import tachiyomi.domain.source.repository.SourceRepository
import java.util.SortedMap
@Inject
class GetLanguagesWithSources(
private val repository: SourceRepository,
private val preferences: SourcePreferences,
@@ -1,5 +1,6 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@@ -9,6 +10,7 @@ import tachiyomi.domain.source.repository.SourceRepository
import tachiyomi.source.local.isLocal
import java.util.Collections
@Inject
class GetSourcesWithFavoriteCount(
private val repository: SourceRepository,
private val preferences: SourcePreferences,
@@ -1,7 +1,9 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
@Inject
class SetMigrateSorting(
private val preferences: SourcePreferences,
) {
@@ -1,8 +1,10 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import tachiyomi.core.common.preference.getAndSet
@Inject
class ToggleIncognito(
private val preferences: SourcePreferences,
) {
@@ -1,8 +1,10 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import tachiyomi.core.common.preference.getAndSet
@Inject
class ToggleLanguage(
val preferences: SourcePreferences,
) {
@@ -1,9 +1,11 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import tachiyomi.core.common.preference.getAndSet
import tachiyomi.domain.source.model.Source
@Inject
class ToggleSource(
private val preferences: SourcePreferences,
) {
@@ -1,9 +1,11 @@
package eu.kanade.domain.source.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.source.service.SourcePreferences
import tachiyomi.core.common.preference.getAndSet
import tachiyomi.domain.source.model.Source
@Inject
class ToggleSourcePin(
private val preferences: SourcePreferences,
) {
@@ -1,16 +0,0 @@
package eu.kanade.domain.source.model
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.core.graphics.drawable.toBitmap
import eu.kanade.tachiyomi.extension.ExtensionManager
import tachiyomi.domain.source.model.Source
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
val Source.icon: ImageBitmap?
get() {
return Injekt.get<ExtensionManager>().getAppIconForSource(id)
?.toBitmap()
?.asImageBitmap()
}
@@ -1,14 +1,21 @@
package eu.kanade.domain.source.service
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.Inject
import dev.zacsweers.metro.SingleIn
import eu.kanade.domain.source.interactor.SetMigrateSorting
import eu.kanade.tachiyomi.util.system.LocaleHelper
import mihon.domain.extension.model.ContentWarning
import mihon.domain.migration.models.MigrationFlag
import tachiyomi.core.common.preference.Preference
import tachiyomi.core.common.preference.PreferenceStore
import tachiyomi.core.common.preference.getEnum
import tachiyomi.core.common.preference.getEnumSet
import tachiyomi.core.common.preference.getLongArray
import tachiyomi.domain.library.model.LibraryDisplayMode
@Inject
@SingleIn(AppScope::class)
class SourcePreferences(
preferenceStore: PreferenceStore,
) {
@@ -36,7 +43,15 @@ class SourcePreferences(
-1,
)
val showNsfwSource: Preference<Boolean> = preferenceStore.getBoolean("show_nsfw_source", true)
val enabledContentWarnings: Preference<Set<ContentWarning>> = preferenceStore.getEnumSet(
"enabled_content_warnings",
setOf(ContentWarning.SAFE, ContentWarning.MIXED, ContentWarning.NSFW),
)
val applyContentWarningsToInstalled: Preference<Boolean> = preferenceStore.getBoolean(
"apply_content_warnings_to_installed",
true,
)
val migrationSortingMode: Preference<SetMigrateSorting.Mode> = preferenceStore.getEnum(
"pref_migration_sorting",
@@ -1,5 +1,6 @@
package eu.kanade.domain.track.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.track.model.toDbTrack
import eu.kanade.domain.track.model.toDomainTrack
import eu.kanade.tachiyomi.data.database.models.Track
@@ -7,101 +8,92 @@ import eu.kanade.tachiyomi.data.track.EnhancedTracker
import eu.kanade.tachiyomi.data.track.Tracker
import eu.kanade.tachiyomi.data.track.TrackerManager
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.util.lang.convertEpochMillisZone
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import logcat.LogPriority
import tachiyomi.core.common.util.lang.withIOContext
import tachiyomi.core.common.util.lang.withNonCancellableContext
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.history.interactor.GetHistory
import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.track.interactor.InsertTrack
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.time.ZoneOffset
import tachiyomi.domain.track.interactor.UpsertTrack
import kotlin.time.Instant
@Inject
class AddTracks(
private val insertTrack: InsertTrack,
private val upsertTrack: UpsertTrack,
private val syncChapterProgressWithTrack: SyncChapterProgressWithTrack,
private val getChaptersByMangaId: GetChaptersByMangaId,
private val trackerManager: TrackerManager,
private val getHistory: GetHistory,
) {
// TODO: update all trackers based on common data
suspend fun bind(tracker: Tracker, item: Track, mangaId: Long) = withNonCancellableContext {
withIOContext {
val allChapters = getChaptersByMangaId.await(mangaId)
val hasReadChapters = allChapters.any { it.read }
tracker.bind(item, hasReadChapters)
suspend fun bind(tracker: Tracker, item: Track, mangaId: Long) = withContext(Dispatchers.IO) {
val allChapters = getChaptersByMangaId.await(mangaId)
val hasReadChapters = allChapters.any { it.read }
tracker.bind(item, hasReadChapters)
var track = item.toDomainTrack(idRequired = false) ?: return@withIOContext
var track = item.toDomainTrack(idRequired = false) ?: return@withContext
insertTrack.await(track)
upsertTrack.await(track)
// TODO: merge into [SyncChapterProgressWithTrack]?
// Update chapter progress if newer chapters marked read locally
if (hasReadChapters) {
val latestLocalReadChapterNumber = allChapters
.sortedBy { it.chapterNumber }
.takeWhile { it.read }
.lastOrNull()
?.chapterNumber ?: -1.0
// TODO: merge into [SyncChapterProgressWithTrack]?
// Update chapter progress if newer chapters marked read locally
if (hasReadChapters) {
val latestLocalReadChapterNumber = allChapters
.sortedBy { it.chapterNumber }
.takeWhile { it.read }
.lastOrNull()
?.chapterNumber ?: -1.0
if (latestLocalReadChapterNumber > track.lastChapterRead) {
track = track.copy(
lastChapterRead = latestLocalReadChapterNumber,
)
tracker.setRemoteLastChapterRead(track.toDbTrack(), latestLocalReadChapterNumber.toInt())
}
if (track.startDate <= 0) {
val firstReadChapterDate = Injekt.get<GetHistory>().await(mangaId)
.sortedBy { it.readAt }
.firstOrNull()
?.readAt
firstReadChapterDate?.let {
val startDate = firstReadChapterDate.time.convertEpochMillisZone(
ZoneOffset.systemDefault(),
ZoneOffset.UTC,
)
track = track.copy(
startDate = startDate,
)
tracker.setRemoteStartDate(track.toDbTrack(), startDate)
}
}
if (latestLocalReadChapterNumber > track.lastChapterRead) {
track = track.copy(
lastChapterRead = latestLocalReadChapterNumber,
)
tracker.setRemoteLastChapterRead(track.toDbTrack(), latestLocalReadChapterNumber.toInt())
}
syncChapterProgressWithTrack.await(mangaId, track, tracker)
if (track.startDate == null) {
val firstReadChapterDate = getHistory.await(mangaId)
.mapNotNull { it.readAt }
.minOrNull()
firstReadChapterDate?.let {
val startDate = firstReadChapterDate.toEpochMilliseconds()
track = track.copy(
startDate = Instant.fromEpochMilliseconds(startDate),
)
tracker.setRemoteStartDate(track.toDbTrack(), startDate)
}
}
}
syncChapterProgressWithTrack.await(mangaId, track, tracker)
}
suspend fun bindEnhancedTrackers(manga: Manga, source: Source) = withNonCancellableContext {
withIOContext {
trackerManager.loggedInTrackers()
.filterIsInstance<EnhancedTracker>()
.filter { it.accept(source) }
.forEach { service ->
try {
service.match(manga)?.let { track ->
track.manga_id = manga.id
(service as Tracker).bind(track)
insertTrack.await(track.toDomainTrack(idRequired = false)!!)
suspend fun bindEnhancedTrackers(manga: Manga, source: Source) = withContext(Dispatchers.IO) {
trackerManager.loggedInTrackers()
.filterIsInstance<EnhancedTracker>()
.filter { it.accept(source) }
.forEach { service ->
try {
service.match(manga)?.let { track ->
track.manga_id = manga.id
(service as Tracker).bind(track)
upsertTrack.await(track.toDomainTrack(idRequired = false)!!)
syncChapterProgressWithTrack.await(
manga.id,
track.toDomainTrack(idRequired = false)!!,
service,
)
}
} catch (e: Exception) {
logcat(
LogPriority.WARN,
e,
) { "Could not match manga: ${manga.title} with service $service" }
syncChapterProgressWithTrack.await(
manga.id,
track.toDomainTrack(idRequired = false)!!,
service,
)
}
} catch (e: Exception) {
logcat(
LogPriority.WARN,
e,
) { "Could not match manga: ${manga.title} with service $service" }
}
}
}
}
}
@@ -1,19 +1,22 @@
package eu.kanade.domain.track.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.track.model.toDbTrack
import eu.kanade.domain.track.model.toDomainTrack
import eu.kanade.tachiyomi.data.track.Tracker
import eu.kanade.tachiyomi.data.track.TrackerManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.supervisorScope
import tachiyomi.domain.track.interactor.GetTracks
import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.domain.track.interactor.UpsertTrack
@Inject
class RefreshTracks(
private val getTracks: GetTracks,
private val trackerManager: TrackerManager,
private val insertTrack: InsertTrack,
private val upsertTrack: UpsertTrack,
private val syncChapterProgressWithTrack: SyncChapterProgressWithTrack,
) {
@@ -28,10 +31,10 @@ class RefreshTracks(
.map { it to trackerManager.get(it.trackerId) }
.filter { (_, service) -> service?.isLoggedIn == true }
.map { (track, service) ->
async {
async(Dispatchers.IO) {
return@async try {
val updatedTrack = service!!.refresh(track.toDbTrack()).toDomainTrack()!!
insertTrack.await(updatedTrack)
upsertTrack.await(updatedTrack)
syncChapterProgressWithTrack.await(mangaId, updatedTrack, service)
null
} catch (e: Throwable) {
@@ -1,5 +1,6 @@
package eu.kanade.domain.track.interactor
import dev.zacsweers.metro.Inject
import eu.kanade.domain.track.model.toDbTrack
import eu.kanade.tachiyomi.data.track.EnhancedTracker
import eu.kanade.tachiyomi.data.track.Tracker
@@ -7,14 +8,15 @@ import logcat.LogPriority
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.chapter.interactor.UpdateChapter
import tachiyomi.domain.chapter.model.toChapterUpdate
import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.domain.chapter.model.ChapterUpdate
import tachiyomi.domain.track.interactor.UpsertTrack
import tachiyomi.domain.track.model.Track
import kotlin.math.max
@Inject
class SyncChapterProgressWithTrack(
private val updateChapter: UpdateChapter,
private val insertTrack: InsertTrack,
private val upsertTrack: UpsertTrack,
private val getChaptersByMangaId: GetChaptersByMangaId,
) {
@@ -33,7 +35,7 @@ class SyncChapterProgressWithTrack(
val chapterUpdates = sortedChapters
.filter { chapter -> chapter.chapterNumber <= remoteTrack.lastChapterRead && !chapter.read }
.map { it.copy(read = true).toChapterUpdate() }
.map { ChapterUpdate(it.id) { read = true } }
// only take into account continuous reading
val localLastRead = sortedChapters.takeWhile { it.read }.lastOrNull()?.chapterNumber ?: 0F
@@ -43,7 +45,7 @@ class SyncChapterProgressWithTrack(
try {
tracker.update(updatedTrack.toDbTrack())
updateChapter.awaitAll(chapterUpdates)
insertTrack.await(updatedTrack)
upsertTrack.await(updatedTrack)
} catch (e: Throwable) {
logcat(LogPriority.WARN, e)
}
@@ -1,30 +1,32 @@
package eu.kanade.domain.track.interactor
import android.content.Context
import dev.zacsweers.metro.Inject
import eu.kanade.domain.track.model.toDbTrack
import eu.kanade.domain.track.model.toDomainTrack
import eu.kanade.domain.track.service.DelayedTrackingUpdateJob
import eu.kanade.domain.track.service.DelayedTrackingUpdateWorker
import eu.kanade.domain.track.store.DelayedTrackingStore
import eu.kanade.tachiyomi.data.track.TrackerManager
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import logcat.LogPriority
import tachiyomi.core.common.util.lang.withNonCancellableContext
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.track.interactor.GetTracks
import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.domain.track.interactor.UpsertTrack
@Inject
class TrackChapter(
private val getTracks: GetTracks,
private val trackerManager: TrackerManager,
private val insertTrack: InsertTrack,
private val upsertTrack: UpsertTrack,
private val delayedTrackingStore: DelayedTrackingStore,
) {
suspend fun await(context: Context, mangaId: Long, chapterNumber: Double, setupJobOnFailure: Boolean = true) {
withNonCancellableContext {
coroutineScope {
val tracks = getTracks.await(mangaId)
if (tracks.isEmpty()) return@withNonCancellableContext
if (tracks.isEmpty()) return@coroutineScope
tracks.mapNotNull { track ->
val service = trackerManager.get(track.trackerId)
@@ -39,12 +41,12 @@ class TrackChapter(
.toDomainTrack(idRequired = true)!!
.copy(lastChapterRead = chapterNumber)
service.update(updatedTrack.toDbTrack(), true)
insertTrack.await(updatedTrack)
upsertTrack.await(updatedTrack)
delayedTrackingStore.remove(track.id)
} catch (e: Exception) {
delayedTrackingStore.add(track.id, chapterNumber)
if (setupJobOnFailure) {
DelayedTrackingUpdateJob.setupTask(context)
DelayedTrackingUpdateWorker.setupTask(context)
}
throw e
}
@@ -1,5 +1,7 @@
package eu.kanade.domain.track.model
import mihon.core.common.extensions.toEpochMillisOrZero
import mihon.core.common.extensions.toInstantOrNull
import tachiyomi.domain.track.model.Track
import eu.kanade.tachiyomi.data.database.models.Track as DbTrack
@@ -25,8 +27,8 @@ fun Track.toDbTrack(): DbTrack = DbTrack.create(trackerId).also {
it.status = status
it.score = score
it.tracking_url = remoteUrl
it.started_reading_date = startDate
it.finished_reading_date = finishDate
it.started_reading_date = startDate.toEpochMillisOrZero()
it.finished_reading_date = finishDate.toEpochMillisOrZero()
it.private = private
}
@@ -44,8 +46,8 @@ fun DbTrack.toDomainTrack(idRequired: Boolean = true): Track? {
status = status,
score = score,
remoteUrl = tracking_url,
startDate = started_reading_date,
finishDate = finished_reading_date,
startDate = started_reading_date.toInstantOrNull(),
finishDate = finished_reading_date.toInstantOrNull(),
private = private,
)
}
@@ -8,31 +8,38 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.NetworkType
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkerParameters
import dev.zacsweers.metro.Inject
import eu.kanade.domain.track.interactor.TrackChapter
import eu.kanade.domain.track.store.DelayedTrackingStore
import eu.kanade.tachiyomi.util.system.workManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import logcat.LogPriority
import tachiyomi.core.common.util.lang.withIOContext
import mihon.app.di.AppGraph
import mihon.core.metro.metroGraph
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.track.interactor.GetTracks
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.concurrent.TimeUnit
class DelayedTrackingUpdateJob(private val context: Context, workerParams: WorkerParameters) :
class DelayedTrackingUpdateWorker(private val context: Context, workerParams: WorkerParameters) :
CoroutineWorker(context, workerParams) {
private val graph: AppGraph = context.metroGraph()
@Inject lateinit var getTracks: GetTracks
@Inject lateinit var trackChapter: TrackChapter
@Inject lateinit var delayedTrackingStore: DelayedTrackingStore
override suspend fun doWork(): Result {
graph.inject(this)
if (runAttemptCount > 3) {
return Result.failure()
}
val getTracks = Injekt.get<GetTracks>()
val trackChapter = Injekt.get<TrackChapter>()
val delayedTrackingStore = Injekt.get<DelayedTrackingStore>()
withIOContext {
withContext(Dispatchers.IO) {
delayedTrackingStore.getItems()
.mapNotNull {
val track = getTracks.awaitOne(it.trackId)
@@ -60,7 +67,7 @@ class DelayedTrackingUpdateJob(private val context: Context, workerParams: Worke
requiredNetworkType = NetworkType.CONNECTED,
)
val request = OneTimeWorkRequestBuilder<DelayedTrackingUpdateJob>()
val request = OneTimeWorkRequestBuilder<DelayedTrackingUpdateWorker>()
.setConstraints(constraints)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, 5, TimeUnit.MINUTES)
.addTag(TAG)
@@ -1,12 +1,19 @@
package eu.kanade.domain.track.service
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.Inject
import dev.zacsweers.metro.SingleIn
import eu.kanade.domain.track.model.AutoTrackState
import eu.kanade.tachiyomi.data.track.Tracker
import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.data.track.kitsu.Kitsu
import eu.kanade.tachiyomi.data.track.mangabaka.MangaBaka
import tachiyomi.core.common.preference.Preference
import tachiyomi.core.common.preference.PreferenceStore
import tachiyomi.core.common.preference.getEnum
@Inject
@SingleIn(AppScope::class)
class TrackPreferences(
private val preferenceStore: PreferenceStore,
) {
@@ -16,6 +23,11 @@ class TrackPreferences(
"",
)
fun trackDisplayUsername(tracker: Tracker) = preferenceStore.getString(
Preference.privateKey("pref_mangasync_displayname_${tracker.id}"),
"",
)
fun trackPassword(tracker: Tracker) = preferenceStore.getString(
Preference.privateKey("pref_mangasync_password_${tracker.id}"),
"",
@@ -36,6 +48,10 @@ class TrackPreferences(
val anilistScoreType: Preference<String> = preferenceStore.getString("anilist_score_type", Anilist.POINT_10)
val kitsuScoreType: Preference<String> = preferenceStore.getString("kitsu_score_type", Kitsu.RATING_ADVANCED)
val mangabakaScoreType: Preference<String> = preferenceStore.getString("mangabaka_score_type", MangaBaka.STEP_1)
val autoUpdateTrack: Preference<Boolean> = preferenceStore.getBoolean("pref_auto_update_manga_sync_key", true)
val autoUpdateTrackOnMarkRead: Preference<AutoTrackState> = preferenceStore.getEnum(
@@ -2,15 +2,20 @@ package eu.kanade.domain.track.store
import android.content.Context
import androidx.core.content.edit
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.Inject
import dev.zacsweers.metro.SingleIn
import logcat.LogPriority
import tachiyomi.core.common.util.system.logcat
@Inject
@SingleIn(AppScope::class)
class DelayedTrackingStore(context: Context) {
/**
* Preference file where queued tracking updates are stored.
*/
private val preferences = context.getSharedPreferences("tracking_queue", Context.MODE_PRIVATE)
private val preferences by lazy { context.getSharedPreferences("tracking_queue", Context.MODE_PRIVATE) }
fun add(trackId: Long, lastChapterRead: Double) {
val previousLastChapterRead = preferences.getFloat(trackId.toString(), 0f)
@@ -1,5 +1,8 @@
package eu.kanade.domain.ui
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.Inject
import dev.zacsweers.metro.SingleIn
import eu.kanade.domain.ui.model.AppTheme
import eu.kanade.domain.ui.model.TabletUiMode
import eu.kanade.domain.ui.model.ThemeMode
@@ -12,6 +15,8 @@ import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
import java.util.Locale
@Inject
@SingleIn(AppScope::class)
class UiPreferences(
preferenceStore: PreferenceStore,
) {
@@ -17,6 +17,7 @@ enum class AppTheme(val titleRes: StringResource?) {
TIDAL_WAVE(MR.strings.theme_tidalwave),
YINYANG(MR.strings.theme_yinyang),
YOTSUBA(MR.strings.theme_yotsuba),
TOKYONIGHT(MR.strings.theme_tokyonight),
MONOCHROME(MR.strings.theme_monochrome),
// Deprecated
@@ -3,10 +3,6 @@ package eu.kanade.presentation.browse
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.HelpOutline
import androidx.compose.material.icons.outlined.Public
import androidx.compose.material.icons.outlined.Refresh
import androidx.compose.material3.SnackbarDuration
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarResult
@@ -22,8 +18,11 @@ import eu.kanade.presentation.browse.components.BrowseSourceList
import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.util.formattedMessage
import eu.kanade.tachiyomi.source.Source
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.flow.StateFlow
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.automirroredrounded.Help
import mihon.icons.materialsymbols.rounded.Public
import mihon.icons.materialsymbols.rounded.Refresh
import tachiyomi.core.common.i18n.stringResource
import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.domain.manga.model.Manga
@@ -86,28 +85,28 @@ fun BrowseSourceContent(
else -> stringResource(MR.strings.no_results_found)
},
actions = if (source is LocalSource) {
persistentListOf(
listOf(
EmptyScreenAction(
stringRes = MR.strings.local_source_help_guide,
icon = Icons.AutoMirrored.Outlined.HelpOutline,
icon = MaterialSymbols.AutoMirroredRounded.Help,
onClick = onLocalSourceHelpClick,
),
)
} else {
persistentListOf(
listOf(
EmptyScreenAction(
stringRes = MR.strings.action_retry,
icon = Icons.Outlined.Refresh,
icon = MaterialSymbols.Rounded.Refresh,
onClick = mangaList::refresh,
),
EmptyScreenAction(
stringRes = MR.strings.action_open_in_web_view,
icon = Icons.Outlined.Public,
icon = MaterialSymbols.Rounded.Public,
onClick = onWebViewClick,
),
EmptyScreenAction(
stringRes = MR.strings.label_help,
icon = Icons.AutoMirrored.Outlined.HelpOutline,
icon = MaterialSymbols.AutoMirroredRounded.Help,
onClick = onHelpClick,
),
)
@@ -14,9 +14,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Launch
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.HorizontalDivider
@@ -35,40 +32,41 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import dev.icerock.moko.resources.StringResource
import eu.kanade.domain.extension.interactor.ExtensionSourceItem
import eu.kanade.presentation.browse.components.ExtensionIcon
import eu.kanade.presentation.browse.components.ExtensionPill
import eu.kanade.presentation.browse.components.label
import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.WarningBanner
import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.presentation.more.settings.widget.TrailingWidgetBuffer
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsScreenModel
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsViewModel
import eu.kanade.tachiyomi.util.system.LocaleHelper
import eu.kanade.tachiyomi.util.system.copyToClipboard
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.rounded.Eyeglasses2
import mihon.icons.materialsymbols.rounded.Settings
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen
@Composable
fun ExtensionDetailsScreen(
navigateUp: () -> Unit,
state: ExtensionDetailsScreenModel.State,
state: ExtensionDetailsViewModel.State.Success,
onClickSourcePreferences: (sourceId: Long) -> Unit,
onClickEnableAll: () -> Unit,
onClickDisableAll: () -> Unit,
@@ -78,15 +76,6 @@ fun ExtensionDetailsScreen(
onClickIncognito: (Boolean) -> Unit,
) {
val uriHandler = LocalUriHandler.current
val url = remember(state.extension) {
val regex = """https://raw.githubusercontent.com/(.+?)/(.+?)/.+""".toRegex()
regex.find(state.extension?.repoUrl.orEmpty())
?.let {
val (user, repo) = it.destructured
"https://github.com/$user/$repo"
}
?: state.extension?.repoUrl
}
Scaffold(
topBar = { scrollBehavior ->
@@ -95,54 +84,34 @@ fun ExtensionDetailsScreen(
navigateUp = navigateUp,
actions = {
AppBarActions(
actions = persistentListOf<AppBar.AppBarAction>().builder()
.apply {
if (url != null) {
add(
AppBar.Action(
title = stringResource(MR.strings.action_open_repo),
icon = Icons.AutoMirrored.Outlined.Launch,
onClick = {
uriHandler.openUri(url)
},
),
)
}
addAll(
listOf(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_enable_all),
onClick = onClickEnableAll,
),
AppBar.OverflowAction(
title = stringResource(MR.strings.action_disable_all),
onClick = onClickDisableAll,
),
AppBar.OverflowAction(
title = stringResource(MR.strings.pref_clear_cookies),
onClick = onClickClearCookies,
),
),
)
}
.build(),
actions = listOf(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_enable_all),
onClick = onClickEnableAll,
),
AppBar.OverflowAction(
title = stringResource(MR.strings.action_disable_all),
onClick = onClickDisableAll,
),
AppBar.OverflowAction(
title = stringResource(MR.strings.pref_clear_cookies),
onClick = onClickClearCookies,
),
),
)
},
scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
if (state.extension == null) {
EmptyScreen(
MR.strings.empty_screen,
modifier = Modifier.padding(paddingValues),
)
return@Scaffold
}
ExtensionDetails(
contentPadding = paddingValues,
extension = state.extension,
onClickStore = state.extension.store
?.contact
?.website
?.takeIf { it.isNotBlank() }
?.let { website -> { uriHandler.openUri(website) } },
sources = state.sources,
incognitoMode = state.isIncognito,
onClickSourcePreferences = onClickSourcePreferences,
@@ -156,8 +125,9 @@ fun ExtensionDetailsScreen(
@Composable
private fun ExtensionDetails(
contentPadding: PaddingValues,
extension: Extension.Installed,
sources: ImmutableList<ExtensionSourceItem>,
extension: Extension.Loaded,
onClickStore: (() -> Unit)?,
sources: List<ExtensionSourceItem>,
incognitoMode: Boolean,
onClickSourcePreferences: (sourceId: Long) -> Unit,
onClickUninstall: () -> Unit,
@@ -165,7 +135,8 @@ private fun ExtensionDetails(
onClickIncognito: (Boolean) -> Unit,
) {
val context = LocalContext.current
var showNsfwWarning by remember { mutableStateOf(false) }
var showContentWarning by remember { mutableStateOf(false) }
val contentWarning = extension.contentWarning.label
ScrollbarLazyColumn(
contentPadding = contentPadding,
@@ -188,8 +159,9 @@ private fun ExtensionDetails(
}
Unit
}.takeIf { extension.isShared },
onClickAgeRating = {
showNsfwWarning = true
onClickStore = onClickStore,
onClickContentWarning = {
showContentWarning = true
},
onExtIncognitoChange = onClickIncognito,
)
@@ -207,10 +179,12 @@ private fun ExtensionDetails(
)
}
}
if (showNsfwWarning) {
NsfwWarningDialog(
if (showContentWarning && contentWarning != null) {
ContentWarningDialog(
label = contentWarning.title,
description = contentWarning.description,
onClickConfirm = {
showNsfwWarning = false
showContentWarning = false
},
)
}
@@ -218,14 +192,16 @@ private fun ExtensionDetails(
@Composable
private fun DetailsHeader(
extension: Extension,
extension: Extension.Installed,
extIncognitoMode: Boolean,
onClickAgeRating: () -> Unit,
onClickStore: (() -> Unit)?,
onClickContentWarning: () -> Unit,
onClickUninstall: () -> Unit,
onClickAppInfo: (() -> Unit)?,
onExtIncognitoChange: (Boolean) -> Unit,
) {
val context = LocalContext.current
val contentWarning = extension.contentWarning.label
Column {
Column(
@@ -242,20 +218,23 @@ private fun DetailsHeader(
"""
Extension name: ${extension.name} (lang: ${extension.lang}; package: ${extension.pkgName})
Extension version: ${extension.versionName} (lib: ${extension.libVersion}; version code: ${extension.versionCode})
NSFW: ${extension.isNsfw}
Content warning: ${extension.contentWarning}
""".trimIndent(),
)
if (extension is Extension.Installed) {
if (extension is Extension.Loaded) {
append("\n\n")
append(
appendLine(
"""
Update available: ${extension.hasUpdate}
Obsolete: ${extension.isObsolete}
Orphaned: ${extension.isObsolete}
Shared: ${extension.isShared}
Repository: ${extension.repoUrl}
""".trimIndent(),
)
val store = extension.store
if (store != null) {
append("Repository: ${store.indexUrl}")
}
}
}
context.copyToClipboard("Extension Debug information", extDebugInfo)
@@ -275,19 +254,42 @@ private fun DetailsHeader(
textAlign = TextAlign.Center,
)
val strippedPkgName = extension.pkgName.substringAfter("eu.kanade.tachiyomi.extension.")
Text(
text = strippedPkgName,
text = extension.pkgName,
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
extension.store?.let { store ->
Text(
text = store.name,
modifier = Modifier
.clip(MaterialTheme.shapes.small)
.clickable(enabled = onClickStore != null) { onClickStore?.invoke() }
.padding(
horizontal = MaterialTheme.padding.extraSmall,
vertical = MaterialTheme.padding.extraSmall / 2,
),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colorScheme.primary,
)
}
if ((extension as? Extension.Loaded)?.isShared == false) {
ExtensionPill(
text = stringResource(MR.strings.ext_installer_private),
modifier = Modifier.padding(top = MaterialTheme.padding.small),
)
}
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(
horizontal = MaterialTheme.padding.extraLarge,
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small,
),
horizontalArrangement = Arrangement.SpaceEvenly,
@@ -302,23 +304,20 @@ private fun DetailsHeader(
InfoDivider()
InfoText(
modifier = Modifier.weight(if (extension.isNsfw) 1.5f else 1f),
modifier = Modifier.weight(1f),
primaryText = LocaleHelper.getSourceDisplayName(extension.lang, context),
secondaryText = stringResource(MR.strings.ext_info_language),
)
if (extension.isNsfw) {
if (contentWarning != null) {
InfoDivider()
InfoText(
modifier = Modifier.weight(1f),
primaryText = stringResource(MR.strings.ext_nsfw_short),
primaryTextStyle = MaterialTheme.typography.bodyLarge.copy(
color = MaterialTheme.colorScheme.error,
fontWeight = FontWeight.Medium,
),
secondaryText = stringResource(MR.strings.ext_info_age_rating),
onClick = onClickAgeRating,
primaryText = stringResource(contentWarning.title),
primaryTextColor = contentWarning.color,
secondaryText = stringResource(MR.strings.ext_info_warning),
onClick = onClickContentWarning,
)
}
}
@@ -341,10 +340,7 @@ private fun DetailsHeader(
modifier = Modifier.weight(1f),
onClick = onClickAppInfo,
) {
Text(
text = stringResource(MR.strings.ext_app_info),
color = MaterialTheme.colorScheme.onPrimary,
)
Text(stringResource(MR.strings.ext_app_info))
}
}
}
@@ -353,7 +349,7 @@ private fun DetailsHeader(
modifier = Modifier.padding(horizontal = MaterialTheme.padding.small),
title = stringResource(MR.strings.pref_incognito_mode),
subtitle = stringResource(MR.strings.pref_incognito_mode_extension_summary),
icon = ImageVector.vectorResource(R.drawable.ic_glasses_24dp),
icon = MaterialSymbols.Rounded.Eyeglasses2,
widget = {
Row(
verticalAlignment = Alignment.CenterVertically,
@@ -376,7 +372,7 @@ private fun InfoText(
primaryText: String,
secondaryText: String,
modifier: Modifier = Modifier,
primaryTextStyle: TextStyle = MaterialTheme.typography.bodyLarge,
primaryTextColor: Color = Color.Unspecified,
onClick: (() -> Unit)? = null,
) {
val clickableModifier = if (onClick != null) {
@@ -393,13 +389,16 @@ private fun InfoText(
Text(
text = primaryText,
textAlign = TextAlign.Center,
style = primaryTextStyle,
style = MaterialTheme.typography.titleSmall,
color = primaryTextColor,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
Text(
text = secondaryText + if (onClick != null) " ⓘ" else "",
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyMedium,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f),
)
}
@@ -408,7 +407,9 @@ private fun InfoText(
@Composable
private fun InfoDivider() {
VerticalDivider(
modifier = Modifier.height(20.dp),
modifier = Modifier
.padding(horizontal = MaterialTheme.padding.small)
.height(24.dp),
)
}
@@ -435,7 +436,7 @@ private fun SourceSwitchPreference(
if (source.source is ConfigurableSource) {
IconButton(onClick = { onClickSourcePreferences(source.source.id) }) {
Icon(
imageVector = Icons.Outlined.Settings,
imageVector = MaterialSymbols.Rounded.Settings,
contentDescription = stringResource(MR.strings.label_settings),
tint = MaterialTheme.colorScheme.onSurface,
)
@@ -454,12 +455,20 @@ private fun SourceSwitchPreference(
}
@Composable
private fun NsfwWarningDialog(
private fun ContentWarningDialog(
label: StringResource,
description: StringResource,
onClickConfirm: () -> Unit,
) {
AlertDialog(
title = {
Text(
text = stringResource(label),
style = MaterialTheme.typography.titleMedium,
)
},
text = {
Text(text = stringResource(MR.strings.ext_nsfw_warning))
Text(text = stringResource(description))
},
confirmButton = {
TextButton(onClick = onClickConfirm) {
@@ -13,13 +13,7 @@ import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Close
import androidx.compose.material.icons.outlined.GetApp
import androidx.compose.material.icons.outlined.Public
import androidx.compose.material.icons.outlined.Refresh
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.VerifiedUser
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.CircularProgressIndicator
@@ -27,7 +21,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ProvideTextStyle
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
@@ -37,7 +30,9 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.navigator.LocalNavigator
@@ -45,18 +40,28 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.browse.components.BaseBrowseItem
import eu.kanade.presentation.browse.components.ExtensionIcon
import eu.kanade.presentation.browse.components.ExtensionPill
import eu.kanade.presentation.browse.components.label
import eu.kanade.presentation.components.WarningBanner
import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText
import eu.kanade.presentation.more.settings.screen.browse.ExtensionReposScreen
import eu.kanade.presentation.util.animateItemFastScroll
import eu.kanade.presentation.more.settings.screen.browse.ExtensionStoresScreen
import eu.kanade.presentation.util.rememberRequestPackageInstallsPermissionState
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.InstallStep
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionUiModel
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsScreenModel
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsViewModel
import eu.kanade.tachiyomi.util.system.LocaleHelper
import eu.kanade.tachiyomi.util.system.copyToClipboard
import eu.kanade.tachiyomi.util.system.launchRequestPackageInstallsPermission
import kotlinx.collections.immutable.persistentListOf
import mihon.domain.extension.model.ExtensionStore
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.rounded.Close
import mihon.icons.materialsymbols.rounded.Download
import mihon.icons.materialsymbols.rounded.Info
import mihon.icons.materialsymbols.rounded.Public
import mihon.icons.materialsymbols.rounded.Refresh
import mihon.icons.materialsymbols.rounded.Settings
import mihon.icons.materialsymbols.rounded.VerifiedUser
import tachiyomi.core.common.i18n.stringResource
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.FastScrollLazyColumn
import tachiyomi.presentation.core.components.material.PullRefresh
@@ -68,21 +73,20 @@ import tachiyomi.presentation.core.screens.EmptyScreenAction
import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.theme.header
import tachiyomi.presentation.core.util.plus
import tachiyomi.presentation.core.util.secondaryItemAlpha
@Composable
fun ExtensionScreen(
state: ExtensionsScreenModel.State,
state: ExtensionsViewModel.State,
contentPadding: PaddingValues,
searchQuery: String?,
onLongClickItem: (Extension) -> Unit,
onClickItemCancel: (Extension) -> Unit,
onOpenWebView: (Extension.Available) -> Unit,
onInstallExtension: (Extension.Available) -> Unit,
onUninstallExtension: (Extension) -> Unit,
onUninstallExtension: (Extension.Installed) -> Unit,
onUpdateExtension: (Extension.Installed) -> Unit,
onTrustExtension: (Extension.Untrusted) -> Unit,
onOpenExtension: (Extension.Installed) -> Unit,
onTrustExtension: (Extension.NotLoaded) -> Unit,
onOpenExtension: (Extension.Loaded) -> Unit,
onClickUpdateAll: () -> Unit,
onRefresh: () -> Unit,
) {
@@ -104,11 +108,11 @@ fun ExtensionScreen(
EmptyScreen(
stringRes = msg,
modifier = Modifier.padding(contentPadding),
actions = persistentListOf(
actions = listOf(
EmptyScreenAction(
stringRes = MR.strings.label_extension_repos,
icon = Icons.Outlined.Settings,
onClick = { navigator.push(ExtensionReposScreen()) },
stringRes = MR.strings.extensionStores,
icon = MaterialSymbols.Rounded.Settings,
onClick = { navigator.push(ExtensionStoresScreen()) },
),
),
)
@@ -134,20 +138,20 @@ fun ExtensionScreen(
@Composable
private fun ExtensionContent(
state: ExtensionsScreenModel.State,
state: ExtensionsViewModel.State,
contentPadding: PaddingValues,
onLongClickItem: (Extension) -> Unit,
onClickItemCancel: (Extension) -> Unit,
onOpenWebView: (Extension.Available) -> Unit,
onInstallExtension: (Extension.Available) -> Unit,
onUninstallExtension: (Extension) -> Unit,
onUninstallExtension: (Extension.Installed) -> Unit,
onUpdateExtension: (Extension.Installed) -> Unit,
onTrustExtension: (Extension.Untrusted) -> Unit,
onOpenExtension: (Extension.Installed) -> Unit,
onTrustExtension: (Extension.NotLoaded) -> Unit,
onOpenExtension: (Extension.Loaded) -> Unit,
onClickUpdateAll: () -> Unit,
) {
val context = LocalContext.current
var trustState by remember { mutableStateOf<Extension.Untrusted?>(null) }
var notLoadedState by remember { mutableStateOf<Extension.NotLoaded?>(null) }
val installGranted = rememberRequestPackageInstallsPermissionState(initialValue = true)
FastScrollLazyColumn(
@@ -188,14 +192,14 @@ private fun ExtensionContent(
}
ExtensionHeader(
textRes = header.textRes,
modifier = Modifier.animateItemFastScroll(),
modifier = Modifier.animateItem(),
action = action,
)
}
is ExtensionUiModel.Header.Text -> {
ExtensionHeader(
text = header.text,
modifier = Modifier.animateItemFastScroll(),
modifier = Modifier.animateItem(),
)
}
}
@@ -206,21 +210,21 @@ private fun ExtensionContent(
contentType = { "item" },
key = { item ->
when (item.extension) {
is Extension.Untrusted -> "extension-untrusted-${item.hashCode()}"
is Extension.Installed -> "extension-installed-${item.hashCode()}"
is Extension.NotLoaded -> "extension-not-loaded-${item.hashCode()}"
is Extension.Loaded -> "extension-loaded-${item.hashCode()}"
is Extension.Available -> "extension-available-${item.hashCode()}"
}
},
) { item ->
ExtensionItem(
modifier = Modifier.animateItemFastScroll(),
modifier = Modifier.animateItem(),
item = item,
onClickItem = {
when (it) {
is Extension.Available -> onInstallExtension(it)
is Extension.Installed -> onOpenExtension(it)
is Extension.Untrusted -> {
trustState = it
is Extension.Loaded -> onOpenExtension(it)
is Extension.NotLoaded -> {
notLoadedState = it
}
}
},
@@ -228,23 +232,29 @@ private fun ExtensionContent(
onClickItemSecondaryAction = {
when (it) {
is Extension.Available -> onOpenWebView(it)
is Extension.Installed -> onOpenExtension(it)
else -> {}
is Extension.Loaded -> onOpenExtension(it)
is Extension.NotLoaded -> {
notLoadedState = it
}
}
},
onClickItemCancel = onClickItemCancel,
onClickItemAction = {
when (it) {
is Extension.Available -> onInstallExtension(it)
is Extension.Installed -> {
is Extension.Loaded -> {
if (it.hasUpdate) {
onUpdateExtension(it)
} else {
onOpenExtension(it)
}
}
is Extension.Untrusted -> {
trustState = it
is Extension.NotLoaded -> {
if (it.hasUpdate) {
onUpdateExtension(it)
} else {
notLoadedState = it
}
}
}
},
@@ -252,20 +262,30 @@ private fun ExtensionContent(
}
}
}
if (trustState != null) {
ExtensionTrustDialog(
onClickConfirm = {
onTrustExtension(trustState!!)
trustState = null
},
onClickDismiss = {
onUninstallExtension(trustState!!)
trustState = null
},
onDismissRequest = {
trustState = null
},
)
notLoadedState?.let { extension ->
val dismiss = { notLoadedState = null }
if (extension.reason is Extension.NotLoaded.Reason.Untrusted) {
ExtensionTrustDialog(
onClickConfirm = {
onTrustExtension(extension)
dismiss()
},
onClickDismiss = {
onUninstallExtension(extension)
dismiss()
},
onDismissRequest = dismiss,
)
} else {
ExtensionNotLoadedDialog(
reason = extension.reason,
onClickUninstall = {
onUninstallExtension(extension)
dismiss()
},
onDismissRequest = dismiss,
)
}
}
}
@@ -280,39 +300,17 @@ private fun ExtensionItem(
modifier: Modifier = Modifier,
) {
val (extension, installStep) = item
val store = when (extension) {
is Extension.Available -> extension.store
is Extension.Installed -> extension.store
}
BaseBrowseItem(
modifier = modifier
.combinedClickable(
onClick = { onClickItem(extension) },
onLongClick = { onLongClickItem(extension) },
),
modifier = modifier,
onClickItem = { onClickItem(extension) },
onLongClickItem = { onLongClickItem(extension) },
icon = {
Box(
modifier = Modifier
.size(40.dp),
contentAlignment = Alignment.Center,
) {
val idle = installStep.isCompleted()
if (!idle) {
CircularProgressIndicator(
modifier = Modifier.size(40.dp),
strokeWidth = 2.dp,
)
}
val padding by animateDpAsState(
targetValue = if (idle) 0.dp else 8.dp,
label = "iconPadding",
)
ExtensionIcon(
extension = extension,
modifier = Modifier
.matchParentSize()
.padding(padding),
)
}
ExtensionItemIcon(extension = extension, installStep = installStep)
},
action = {
ExtensionItemActions(
@@ -327,6 +325,7 @@ private fun ExtensionItem(
ExtensionItemContent(
extension = extension,
installStep = installStep,
store = store,
modifier = Modifier.weight(1f),
)
}
@@ -336,6 +335,7 @@ private fun ExtensionItem(
private fun ExtensionItemContent(
extension: Extension,
installStep: InstallStep,
store: ExtensionStore?,
modifier: Modifier = Modifier,
) {
Column(
@@ -347,63 +347,106 @@ private fun ExtensionItemContent(
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodyMedium,
)
// Won't look good but it's not like we can ellipsize overflowing content
FlowRow(
modifier = Modifier.secondaryItemAlpha(),
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) {
ProvideTextStyle(value = MaterialTheme.typography.bodySmall) {
var hasAlreadyShownAnElement by remember { mutableStateOf(false) }
if (extension is Extension.Installed && extension.lang.isNotEmpty()) {
hasAlreadyShownAnElement = true
Text(
text = LocaleHelper.getSourceDisplayName(extension.lang, LocalContext.current),
)
}
if (extension.versionName.isNotEmpty()) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
hasAlreadyShownAnElement = true
Text(
text = extension.versionName,
)
}
if (store != null) {
Text(
text = store.name,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
val warning = when {
extension is Extension.Untrusted -> MR.strings.ext_untrusted
extension is Extension.Installed && extension.isObsolete -> MR.strings.ext_obsolete
extension.isNsfw -> MR.strings.ext_nsfw_short
else -> null
}
if (warning != null) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
hasAlreadyShownAnElement = true
Text(
text = stringResource(warning).uppercase(),
color = MaterialTheme.colorScheme.error,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
if (extension is Extension.Installed && !extension.isShared) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
Text(
text = stringResource(MR.strings.ext_installer_private),
)
}
ExtensionItemMetadata(extension = extension, installStep = installStep)
}
}
if (!installStep.isCompleted()) {
DotSeparatorNoSpaceText()
Text(
text = when (installStep) {
InstallStep.Pending -> stringResource(MR.strings.ext_pending)
InstallStep.Downloading -> stringResource(MR.strings.ext_downloading)
InstallStep.Installing -> stringResource(MR.strings.ext_installing)
else -> error("Must not show non-install process text")
},
)
}
}
@Composable
private fun ExtensionItemIcon(
extension: Extension,
installStep: InstallStep,
modifier: Modifier = Modifier,
) {
Box(
modifier = modifier.size(48.dp),
contentAlignment = Alignment.Center,
) {
val idle = installStep.isCompleted()
if (!idle) {
CircularProgressIndicator(
modifier = Modifier.size(48.dp),
strokeWidth = 2.dp,
)
}
val padding by animateDpAsState(
targetValue = if (idle) 0.dp else 8.dp,
label = "iconPadding",
)
ExtensionIcon(
extension = extension,
modifier = Modifier
.matchParentSize()
.padding(padding),
)
}
}
/**
* Plain text for what an extension simply is, pills for the few things worth noticing about it.
* Won't look good when it wraps, but it's not like overflowing content can be ellipsized.
*/
@Composable
private fun ExtensionItemMetadata(
extension: Extension,
installStep: InstallStep,
modifier: Modifier = Modifier,
) {
FlowRow(
modifier = modifier,
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall / 2),
itemVerticalAlignment = Alignment.CenterVertically,
) {
val facts = listOfNotNull(
(extension as? Extension.Loaded)
?.lang
?.takeIf { it.isNotEmpty() }
?.let { LocaleHelper.getSourceDisplayName(it, LocalContext.current) },
extension.versionName.takeIf { it.isNotEmpty() },
)
if (facts.isNotEmpty()) {
Text(
text = facts.joinToString(" \u2022 "),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
val notable = listOfNotNull(
when (installStep) {
InstallStep.Pending -> MR.strings.ext_pending
InstallStep.Downloading -> MR.strings.ext_downloading
InstallStep.Installing -> MR.strings.ext_installing
else -> null
}?.let { it to MaterialTheme.colorScheme.primary },
when {
extension is Extension.NotLoaded ->
extension.reason.labelRes?.let { it to MaterialTheme.colorScheme.error }
extension is Extension.Loaded && extension.isObsolete ->
MR.strings.ext_obsolete to MaterialTheme.colorScheme.error
else -> null
},
extension.contentWarning.label?.let { it.title to it.color },
(extension as? Extension.Loaded)
?.takeIf { !it.isShared }
?.let { MR.strings.ext_installer_private to MaterialTheme.colorScheme.onSurfaceVariant },
)
notable.forEach { (label, color) ->
ExtensionPill(text = stringResource(label), color = color)
}
}
}
@@ -417,76 +460,50 @@ private fun ExtensionItemActions(
onClickItemAction: (Extension) -> Unit = {},
onClickItemSecondaryAction: (Extension) -> Unit = {},
) {
val isIdle = installStep.isCompleted()
Row(
modifier = modifier,
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
verticalAlignment = Alignment.CenterVertically,
) {
when {
!isIdle -> {
IconButton(onClick = { onClickItemCancel(extension) }) {
Icon(
imageVector = Icons.Outlined.Close,
contentDescription = stringResource(MR.strings.action_cancel),
)
}
if (!installStep.isCompleted()) {
IconButton(onClick = { onClickItemCancel(extension) }) {
Icon(
imageVector = MaterialSymbols.Rounded.Close,
contentDescription = stringResource(MR.strings.action_cancel),
)
}
installStep == InstallStep.Error -> {
IconButton(onClick = { onClickItemAction(extension) }) {
Icon(
imageVector = Icons.Outlined.Refresh,
contentDescription = stringResource(MR.strings.action_retry),
)
}
return@Row
}
val secondaryAction = when (extension) {
is Extension.Available -> {
(MaterialSymbols.Rounded.Public to MR.strings.action_open_in_web_view)
.takeIf { extension.sources.isNotEmpty() }
}
installStep == InstallStep.Idle -> {
when (extension) {
is Extension.Installed -> {
IconButton(onClick = { onClickItemSecondaryAction(extension) }) {
Icon(
imageVector = Icons.Outlined.Settings,
contentDescription = stringResource(MR.strings.action_settings),
)
}
is Extension.Loaded -> MaterialSymbols.Rounded.Settings to MR.strings.action_settings
is Extension.NotLoaded -> if (extension.reason is Extension.NotLoaded.Reason.Untrusted) {
MaterialSymbols.Rounded.VerifiedUser to MR.strings.ext_trust
} else {
MaterialSymbols.Rounded.Info to MR.strings.ext_not_loaded_details
}
}
secondaryAction?.let { (icon, label) ->
IconButton(onClick = { onClickItemSecondaryAction(extension) }) {
Icon(imageVector = icon, contentDescription = stringResource(label))
}
}
if (extension.hasUpdate) {
IconButton(onClick = { onClickItemAction(extension) }) {
Icon(
imageVector = Icons.Outlined.GetApp,
contentDescription = stringResource(MR.strings.ext_update),
)
}
}
}
is Extension.Untrusted -> {
IconButton(onClick = { onClickItemAction(extension) }) {
Icon(
imageVector = Icons.Outlined.VerifiedUser,
contentDescription = stringResource(MR.strings.ext_trust),
)
}
}
is Extension.Available -> {
if (extension.sources.isNotEmpty()) {
IconButton(
onClick = { onClickItemSecondaryAction(extension) },
) {
Icon(
imageVector = Icons.Outlined.Public,
contentDescription = stringResource(MR.strings.action_open_in_web_view),
)
}
}
IconButton(onClick = { onClickItemAction(extension) }) {
Icon(
imageVector = Icons.Outlined.GetApp,
contentDescription = stringResource(MR.strings.ext_install),
)
}
}
}
val action = when {
installStep == InstallStep.Error -> MaterialSymbols.Rounded.Refresh to MR.strings.action_retry
extension is Extension.Available -> MaterialSymbols.Rounded.Download to MR.strings.ext_install
extension is Extension.Installed && extension.hasUpdate -> {
MaterialSymbols.Rounded.Download to MR.strings.ext_update
}
else -> null
}
action?.let { (icon, label) ->
IconButton(onClick = { onClickItemAction(extension) }) {
Icon(imageVector = icon, contentDescription = stringResource(label))
}
}
}
@@ -526,6 +543,83 @@ private fun ExtensionHeader(
}
}
/**
* Only the reasons the user can act on are worth naming in the row; the rest all mean "broken" to
* them and are spelled out in [ExtensionNotLoadedDialog] instead.
*/
private val Extension.NotLoaded.Reason.labelRes: StringResource?
get() = when (this) {
is Extension.NotLoaded.Reason.Untrusted -> MR.strings.ext_untrusted
Extension.NotLoaded.Reason.Filtered -> MR.strings.ext_filtered
// The section header already says these aren't loaded; the dialog says why
Extension.NotLoaded.Reason.Unsigned,
Extension.NotLoaded.Reason.UnsupportedLibVersion,
Extension.NotLoaded.Reason.Malformed,
is Extension.NotLoaded.Reason.Failed,
-> null
}
private val Extension.NotLoaded.Reason.descriptionRes: StringResource
get() = when (this) {
is Extension.NotLoaded.Reason.Untrusted -> MR.strings.untrusted_extension_message
Extension.NotLoaded.Reason.Filtered -> MR.strings.ext_filtered_message
Extension.NotLoaded.Reason.Unsigned -> MR.strings.ext_unsigned_message
Extension.NotLoaded.Reason.UnsupportedLibVersion -> MR.strings.ext_unsupported_message
Extension.NotLoaded.Reason.Malformed -> MR.strings.ext_malformed_message
is Extension.NotLoaded.Reason.Failed -> MR.strings.ext_load_failed_message
}
@Composable
private fun ExtensionNotLoadedDialog(
reason: Extension.NotLoaded.Reason,
onClickUninstall: () -> Unit,
onDismissRequest: () -> Unit,
) {
AlertDialog(
title = {
Text(text = stringResource(MR.strings.ext_not_loaded_dialog))
},
text = {
Column(verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small)) {
Text(text = stringResource(reason.descriptionRes))
if (reason is Extension.NotLoaded.Reason.Failed) {
Text(
text = reason.message,
style = MaterialTheme.typography.bodySmall,
fontFamily = FontFamily.Monospace,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
val context = LocalContext.current
TextButton(
onClick = {
context.copyToClipboard(
label = context.stringResource(MR.strings.ext_copy_stacktrace),
content = reason.stackTrace,
)
},
contentPadding = PaddingValues(0.dp),
) {
Text(text = stringResource(MR.strings.ext_copy_stacktrace))
}
}
}
},
confirmButton = {
TextButton(onClick = onDismissRequest) {
Text(text = stringResource(MR.strings.action_ok))
}
},
dismissButton = {
TextButton(onClick = onClickUninstall) {
Text(text = stringResource(MR.strings.ext_uninstall))
}
},
onDismissRequest = onDismissRequest,
)
}
@Composable
private fun ExtensionTrustDialog(
onClickConfirm: () -> Unit,
@@ -10,9 +10,9 @@ import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem
import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem
import eu.kanade.presentation.browse.components.GlobalSearchResultItem
import eu.kanade.presentation.browse.components.GlobalSearchToolbar
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchItemResult
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchViewModel
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SourceFilter
import eu.kanade.tachiyomi.util.system.LocaleHelper
import tachiyomi.domain.manga.model.Manga
@@ -20,14 +20,14 @@ import tachiyomi.presentation.core.components.material.Scaffold
@Composable
fun GlobalSearchScreen(
state: SearchScreenModel.State,
state: SearchViewModel.State,
navigateUp: () -> Unit,
onChangeSearchQuery: (String?) -> Unit,
onSearch: (String) -> Unit,
onChangeSearchFilter: (SourceFilter) -> Unit,
onToggleResults: () -> Unit,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickSource: (Source) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
) {
@@ -62,10 +62,10 @@ fun GlobalSearchScreen(
@Composable
internal fun GlobalSearchContent(
items: Map<CatalogueSource, SearchItemResult>,
items: Map<Source, SearchItemResult>,
contentPadding: PaddingValues,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickSource: (Source) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
fromSourceId: Long? = null,
@@ -3,15 +3,15 @@ package eu.kanade.presentation.browse
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import eu.kanade.presentation.browse.components.GlobalSearchToolbar
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchViewModel
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SourceFilter
import tachiyomi.domain.manga.model.Manga
import tachiyomi.presentation.core.components.material.Scaffold
@Composable
fun MigrateSearchScreen(
state: SearchScreenModel.State,
state: SearchViewModel.State,
fromSourceId: Long?,
navigateUp: () -> Unit,
onChangeSearchQuery: (String?) -> Unit,
@@ -19,7 +19,7 @@ fun MigrateSearchScreen(
onChangeSearchFilter: (SourceFilter) -> Unit,
onToggleResults: () -> Unit,
getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit,
onClickSource: (Source) -> Unit,
onClickItem: (Manga) -> Unit,
onLongClickItem: (Manga) -> Unit,
) {
@@ -6,12 +6,8 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ArrowDownward
import androidx.compose.material.icons.outlined.ArrowUpward
import androidx.compose.material.icons.outlined.Numbers
import androidx.compose.material.icons.outlined.SortByAlpha
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
@@ -21,12 +17,17 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import eu.kanade.domain.source.interactor.SetMigrateSorting
import eu.kanade.presentation.browse.components.BaseSourceItem
import eu.kanade.presentation.browse.components.SourceIcon
import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrateSourceScreenModel
import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrateSourceViewModel
import eu.kanade.tachiyomi.util.system.copyToClipboard
import kotlinx.collections.immutable.ImmutableList
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.rounded.ArrowDownward
import mihon.icons.materialsymbols.rounded.ArrowUpward
import mihon.icons.materialsymbols.rounded.Numbers
import mihon.icons.materialsymbols.rounded.SortByAlpha
import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.Badge
@@ -44,7 +45,7 @@ import tachiyomi.presentation.core.util.secondaryItemAlpha
@Composable
fun MigrateSourceScreen(
state: MigrateSourceScreenModel.State,
state: MigrateSourceViewModel.State,
contentPadding: PaddingValues,
onClickItem: (Source) -> Unit,
onToggleSortingDirection: () -> Unit,
@@ -76,7 +77,7 @@ fun MigrateSourceScreen(
@Composable
private fun MigrateSourceList(
list: ImmutableList<Pair<Source, Long>>,
list: List<Pair<Source, Long>>,
contentPadding: PaddingValues,
onClickItem: (Source) -> Unit,
onLongClickItem: (Source) -> Unit,
@@ -104,11 +105,11 @@ private fun MigrateSourceList(
IconButton(onClick = onToggleSortingMode) {
when (sortingMode) {
SetMigrateSorting.Mode.ALPHABETICAL -> Icon(
Icons.Outlined.SortByAlpha,
MaterialSymbols.Rounded.SortByAlpha,
contentDescription = stringResource(MR.strings.action_sort_alpha),
)
SetMigrateSorting.Mode.TOTAL -> Icon(
Icons.Outlined.Numbers,
MaterialSymbols.Rounded.Numbers,
contentDescription = stringResource(MR.strings.action_sort_count),
)
}
@@ -116,11 +117,11 @@ private fun MigrateSourceList(
IconButton(onClick = onToggleSortingDirection) {
when (sortingDirection) {
SetMigrateSorting.Direction.ASCENDING -> Icon(
Icons.Outlined.ArrowUpward,
MaterialSymbols.Rounded.ArrowUpward,
contentDescription = stringResource(MR.strings.action_asc),
)
SetMigrateSorting.Direction.DESCENDING -> Icon(
Icons.Outlined.ArrowDownward,
MaterialSymbols.Rounded.ArrowDownward,
contentDescription = stringResource(MR.strings.action_desc),
)
}
@@ -157,7 +158,7 @@ private fun MigrateSourceItem(
showLanguageInContent = source.lang != "",
onClickItem = onClickItem,
onLongClickItem = onLongClickItem,
icon = { SourceIcon(source = source) },
icon = { SourceIcon(source = source, modifier = Modifier.size(48.dp)) },
action = {
BadgeGroup {
Badge(text = "$count")
@@ -10,8 +10,7 @@ import androidx.compose.ui.platform.LocalContext
import eu.kanade.presentation.browse.components.BaseSourceItem
import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget
import eu.kanade.presentation.util.animateItemFastScroll
import eu.kanade.tachiyomi.ui.browse.source.SourcesFilterScreenModel
import eu.kanade.tachiyomi.ui.browse.source.SourcesFilterViewModel
import eu.kanade.tachiyomi.util.system.LocaleHelper
import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR
@@ -23,7 +22,7 @@ import tachiyomi.presentation.core.screens.EmptyScreen
@Composable
fun SourcesFilterScreen(
navigateUp: () -> Unit,
state: SourcesFilterScreenModel.State.Success,
state: SourcesFilterViewModel.State.Success,
onClickLanguage: (String) -> Unit,
onClickSource: (Source) -> Unit,
) {
@@ -55,7 +54,7 @@ fun SourcesFilterScreen(
@Composable
private fun SourcesFilterContent(
contentPadding: PaddingValues,
state: SourcesFilterScreenModel.State.Success,
state: SourcesFilterViewModel.State.Success,
onClickLanguage: (String) -> Unit,
onClickSource: (Source) -> Unit,
) {
@@ -69,7 +68,7 @@ private fun SourcesFilterContent(
contentType = "source-filter-header",
) {
SourcesFilterHeader(
modifier = Modifier.animateItemFastScroll(),
modifier = Modifier.animateItem(),
language = language,
enabled = enabled,
onClickItem = onClickLanguage,
@@ -82,7 +81,7 @@ private fun SourcesFilterContent(
contentType = { "source-filter-item" },
) { source ->
SourcesFilterItem(
modifier = Modifier.animateItemFastScroll(),
modifier = Modifier.animateItem(),
source = source,
enabled = "${source.id}" !in state.disabledSources,
onClickItem = onClickSource,
@@ -6,9 +6,6 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.PushPin
import androidx.compose.material.icons.outlined.PushPin
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
@@ -21,9 +18,12 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import eu.kanade.presentation.browse.components.BaseSourceItem
import eu.kanade.tachiyomi.ui.browse.source.SourcesScreenModel
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreenModel.Listing
import eu.kanade.tachiyomi.ui.browse.source.SourcesViewModel
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceViewModel.Listing
import eu.kanade.tachiyomi.util.system.LocaleHelper
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.rounded.Keep
import mihon.icons.materialsymbols.roundedfilled.Keep
import tachiyomi.domain.source.model.Pin
import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR
@@ -40,7 +40,7 @@ import tachiyomi.source.local.isLocal
@Composable
fun SourcesScreen(
state: SourcesScreenModel.State,
state: SourcesViewModel.State,
contentPadding: PaddingValues,
onClickItem: (Source, Listing) -> Unit,
onClickPin: (Source) -> Unit,
@@ -143,7 +143,7 @@ private fun SourcePinButton(
isPinned: Boolean,
onClick: () -> Unit,
) {
val icon = if (isPinned) Icons.Filled.PushPin else Icons.Outlined.PushPin
val icon = if (isPinned) MaterialSymbols.RoundedFilled.Keep else MaterialSymbols.Rounded.Keep
val tint = if (isPinned) {
MaterialTheme.colorScheme.primary
} else {
@@ -3,12 +3,14 @@ package eu.kanade.presentation.browse.components
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.util.system.LocaleHelper
import tachiyomi.domain.source.model.Source
import tachiyomi.presentation.core.components.material.padding
@@ -39,7 +41,7 @@ fun BaseSourceItem(
}
private val defaultIcon: @Composable RowScope.(Source) -> Unit = { source ->
SourceIcon(source = source)
SourceIcon(source = source, modifier = Modifier.size(48.dp))
}
private val defaultContent: @Composable RowScope.(Source, String?) -> Unit = { source, sourceLangString ->
@@ -1,15 +1,15 @@
package eu.kanade.presentation.browse.components
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.CollectionsBookmark
import androidx.compose.runtime.Composable
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.rounded.CollectionsBookmark
import tachiyomi.presentation.core.components.Badge
@Composable
internal fun InLibraryBadge(enabled: Boolean) {
if (enabled) {
Badge(
imageVector = Icons.Outlined.CollectionsBookmark,
imageVector = MaterialSymbols.Rounded.CollectionsBookmark,
)
}
}
@@ -2,36 +2,26 @@ package eu.kanade.presentation.browse.components
import android.util.DisplayMetrics
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.height
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Dangerous
import androidx.compose.material.icons.filled.Warning
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.imageResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.core.graphics.drawable.toBitmap
import coil3.compose.AsyncImage
import eu.kanade.domain.source.model.icon
import eu.kanade.presentation.util.rememberResourceBitmapPainter
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.coil.InstalledExtensionIcon
import eu.kanade.tachiyomi.data.coil.InstalledSourceIcon
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.util.ExtensionLoader
import tachiyomi.core.common.util.lang.withIOContext
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.roundedfilled.Dangerous
import mihon.icons.materialsymbols.roundedfilled.Warning
import tachiyomi.domain.source.model.Source
import tachiyomi.source.local.isLocal
@@ -44,24 +34,15 @@ fun SourceIcon(
source: Source,
modifier: Modifier = Modifier,
) {
val icon = source.icon
when {
source.isStub && icon == null -> {
source.isStub -> {
Image(
imageVector = Icons.Filled.Warning,
imageVector = MaterialSymbols.RoundedFilled.Warning,
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.error),
modifier = modifier.then(defaultModifier),
)
}
icon != null -> {
Image(
bitmap = icon,
contentDescription = null,
modifier = modifier.then(defaultModifier),
)
}
source.isLocal() -> {
Image(
painter = painterResource(R.mipmap.ic_local_source),
@@ -70,9 +51,12 @@ fun SourceIcon(
)
}
else -> {
Image(
painter = painterResource(R.mipmap.ic_default_source),
val defaultIcon = painterResource(R.mipmap.ic_default_source)
AsyncImage(
model = InstalledSourceIcon(source.id),
contentDescription = null,
placeholder = defaultIcon,
error = defaultIcon,
modifier = modifier.then(defaultModifier),
)
}
@@ -96,53 +80,21 @@ fun ExtensionIcon(
.clip(MaterialTheme.shapes.extraSmall),
)
}
is Extension.Installed -> {
val icon by extension.getIcon(density)
when (icon) {
Result.Loading -> Box(modifier = modifier)
is Result.Success -> Image(
bitmap = (icon as Result.Success<ImageBitmap>).value,
contentDescription = null,
modifier = modifier,
)
Result.Error -> Image(
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
contentDescription = null,
modifier = modifier,
)
}
is Extension.Loaded -> {
val defaultIcon = painterResource(R.mipmap.ic_default_source)
AsyncImage(
model = InstalledExtensionIcon(extension.pkgName, extension.versionCode, density),
contentDescription = null,
placeholder = defaultIcon,
error = defaultIcon,
modifier = modifier,
)
}
is Extension.Untrusted -> Image(
imageVector = Icons.Filled.Dangerous,
is Extension.NotLoaded -> Image(
imageVector = MaterialSymbols.RoundedFilled.Dangerous,
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.error),
modifier = modifier.then(defaultModifier),
)
}
}
@Composable
private fun Extension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT): State<Result<ImageBitmap>> {
val context = LocalContext.current
return produceState<Result<ImageBitmap>>(initialValue = Result.Loading, this) {
withIOContext {
value = try {
val appInfo = ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo!!
val appResources = context.packageManager.getResourcesForApplication(appInfo)
Result.Success(
appResources.getDrawableForDensity(appInfo.icon, density, null)!!
.toBitmap()
.asImageBitmap(),
)
} catch (e: Exception) {
Result.Error
}
}
}
}
sealed class Result<out T> {
data object Loading : Result<Nothing>()
data object Error : Result<Nothing>()
data class Success<out T>(val value: T) : Result<T>()
}
@@ -1,8 +1,5 @@
package eu.kanade.presentation.browse.components
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList
import androidx.compose.material.icons.filled.ViewModule
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
@@ -18,7 +15,10 @@ import eu.kanade.presentation.components.RadioMenuItem
import eu.kanade.presentation.components.SearchToolbar
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.Source
import kotlinx.collections.immutable.persistentListOf
import mihon.icons.materialsymbols.MaterialSymbols
import mihon.icons.materialsymbols.automirroredroundedfilled.ViewList
import mihon.icons.materialsymbols.roundedfilled.ViewCompact
import mihon.icons.materialsymbols.roundedfilled.ViewModule
import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
@@ -54,44 +54,44 @@ fun BrowseSourceToolbar(
onClickCloseSearch = navigateUp,
actions = {
AppBarActions(
actions = persistentListOf<AppBar.AppBarAction>().builder()
.apply {
actions = buildList {
add(
AppBar.Action(
title = stringResource(MR.strings.action_display_mode),
icon = when (displayMode) {
LibraryDisplayMode.List -> MaterialSymbols.AutoMirroredRoundedFilled.ViewList
LibraryDisplayMode.ComfortableGrid -> MaterialSymbols.RoundedFilled.ViewModule
LibraryDisplayMode.CompactGrid,
LibraryDisplayMode.CoverOnlyGrid,
-> MaterialSymbols.RoundedFilled.ViewCompact
},
onClick = { selectingDisplayMode = true },
),
)
if (isLocalSource) {
add(
AppBar.Action(
title = stringResource(MR.strings.action_display_mode),
icon = if (displayMode == LibraryDisplayMode.List) {
Icons.AutoMirrored.Filled.ViewList
} else {
Icons.Filled.ViewModule
},
onClick = { selectingDisplayMode = true },
AppBar.OverflowAction(
title = stringResource(MR.strings.label_help),
onClick = onHelpClick,
),
)
} else {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_open_in_web_view),
onClick = onWebViewClick,
),
)
if (isLocalSource) {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.label_help),
onClick = onHelpClick,
),
)
} else {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_open_in_web_view),
onClick = onWebViewClick,
),
)
}
if (isConfigurableSource) {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_settings),
onClick = onSettingsClick,
),
)
}
}
.build(),
if (isConfigurableSource) {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_settings),
onClick = onSettingsClick,
),
)
}
},
)
DropdownMenu(
@@ -0,0 +1,32 @@
package eu.kanade.presentation.browse.components
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.graphics.Color
import dev.icerock.moko.resources.StringResource
import mihon.domain.extension.model.ContentWarning
import tachiyomi.i18n.MR
internal data class ContentWarningLabel(
val title: StringResource,
val description: StringResource,
val color: Color,
)
internal val ContentWarning.label: ContentWarningLabel?
@Composable
@ReadOnlyComposable
get() = when (this) {
ContentWarning.SAFE -> null
ContentWarning.MIXED -> ContentWarningLabel(
title = MR.strings.ext_content_warning_mixed,
description = MR.strings.ext_content_warning_mixed_description,
color = MaterialTheme.colorScheme.primary,
)
ContentWarning.NSFW -> ContentWarningLabel(
title = MR.strings.ext_content_warning_nsfw,
description = MR.strings.ext_content_warning_nsfw_description,
color = MaterialTheme.colorScheme.error,
)
}

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