-
Notifications
You must be signed in to change notification settings - Fork 39
Refactor code, fix AniList/MAL bugs, add local scan (#148, #349) #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add `ChapterWithPages` model and `MangaReaderController` (FamilyAsyncNotifier) to load chapter + pages in a single provider (`mangaReaderProvider`) - Replace synchronous Isar fetch in `MangaReaderView` with `ref.watch(mangaReaderProvider)` - Unify loading, error, and data states using a shared `scaffoldWith` helper - Remove duplicated `Scaffold`/`AppBar` boilerplate and inline SystemChrome restore logic - Simplify error handling
Fixed a bug, where newly added animes to AniList would register as "Rewatching" instead of "Plan to watch".
- getCookiesPref() and deleteAllCookies(): Avoid repeated parsing of `Uri.parse(url).host` by creating a variable. - httpClient(): cache RhttpCompatibleClients and add default IOClient fallback. - shouldAttemptRetryOnResponse(): Added a delay to avoid busy looping.
Remove code duplication.
Added a checkbox "ignoreFiltersOnSearch" to the library search, so when checked, the whole library will be searched, not just the filtered library (Downloaded, Unwatched/Unread, Started, Bookmarked) + added some comments
Better text rendering of "ignore filters" checkbox on mobile. Adds a line break to mobile devices, where horizontal space is limited.
remove code duplication by introducing a helper method _genericRoute().
Show the FollowSystemThemeButton always on first positon, whether ON or OFF. Before, the FollowSystemThemeButton was on first position if it was ON and in second position if it was OFF (DarkModeButton took the first position)
- New SettingsSection class to remove code duplication - Moved the big ListTile+Dialog blocks in their own private methods: _buildLanguageTile(), _buildFontTile(), _buildRelativeTimestampTile(), _buildDateFormatTile()
No need for SingleChildScrollView, because ReorderableListView already is scrollable
Move the getDirectory() call out of the for loop to enhance performance.
getMangaChapterDirectory() now accepts an optional mangaMainDirectory to avoid calling getMangaMainDirectory() and thus getDirectory() twice in places where both methods are called successively.
trim whitespace to prevent Exception
Users can now add Mangas/Animes to a **manually** created Mangayomi/local folder. Feature as described: ``` App Home Location/ local/ Manga Title/ cover.jpg (optional) Chapter 1/ 1.jpg ... Chapter 2.cbz ... Anime Title/ cover.png (optional) Episode 1.mp4 Episode 2.mkv ``` The folder (if exist) will be scanned once per app start. **Supported filetypes:** (taken from lib/modules/library/providers/local_archive.dart, line 98) ``` Videotypes: mp4, mov, avi, flv, wmv, mpeg, mkv Imagetypes: jpg, jpeg, png, webp Archivetypes: cbz, zip, cbt, tar ```
Remove incorrect expiresIn calculation in `OAuth.fromJson`. The `login()` function of the MyAnimeList class already sets expiresIn as an absolute timestamp in milliseconds. Multiplying by 1000 and adding the current timestamp in fromJson caused expiresIn to be inflated, making the expiration check in `_getAccessToken()` always false, skipping token refresh and returning an invalid token.
- Resolved the same timestamp conversion issue that affected MyAnimeList. - Previously, seconds-to-milliseconds conversion and `DateTime.now()` were applied twice — once on `login()` and once in `_getAccessToken()` — resulting in incorrect expiry dates (e.g., year 57349). - Updated Kitsu’s URL from `.io` to `.app`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors code for better maintainability, fixes bugs in AniList and MyAnimeList integrations, adds a local folder scanning feature (#148), and enhances the library search (#349).
Changes
Refactoring & Code Quality
build
method.ChapterWithPages
to group chapters and pages.scaffoldWith
helper to reduce code duplication.SettingsSection
class to reduce code duplication.ListTile+Dialog
blocks into private methods:_buildLanguageTile
_buildFontTile
_buildRelativeTimestampTile
_buildDateFormatTile
SingleChildScrollView
asReorderableListView
is scrollable.Bug Fixes
expiresIn
calculation inOAuth.fromJson
. Thelogin
function already setsexpiresIn
as a millisecond timestamp. Previous logic inflatedexpiresIn
, causing_getAccessToken
to skip token refresh, leading to invalid token errors.FollowSystemThemeButton
always appears in the first position, regardless of ON/OFF state (previously swapped withDarkModeButton
when OFF).New Features
Mangayomi/local
folder for manga/anime on app start.ignoreFiltersOnSearch
checkbox to search the entire library, not just filtered categories (Downloaded, Unwatched/Unread, Started, Bookmarked).Performance Improvements
getCookiesPref
anddeleteAllCookies
by cachingUri.parse(url).host
.RhttpCompatibleClients
inhttpClient
withIOClient
fallback.shouldAttemptRetryOnResponse
to prevent busy looping.Related Issues