* Hide sync library option when sync is disabled
- Add isSyncEnabled parameter to LibraryToolbar and LibraryRegularToolbar
- Pass isSyncEnabled from LibraryTab to LibraryToolbar
- Conditionally display sync library action based on isSyncEnabled
- Update LibraryContent to include isSyncEnabled parameter
- Adjust LibraryTab to handle sync-related functionality
- Remove direct dependency on SyncPreferences in LibraryToolbar
* Update LibraryScreenModel to react to sync service changes
- Replace static isSyncEnabled update with dynamic observation
- Use syncPreferences.syncService().changes() to update isSyncEnabled state
- Ensure isSyncEnabled is updated whenever the sync service changes
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* Fix sync service state update in LibraryScreenModel
- Resolve ambiguity in lambda parameters
- Correctly update isSyncEnabled state based on syncService value
* Optimize sync service state updates in LibraryScreenModel
- Add distinctUntilChanged() to filter out consecutive duplicate emissions
- Simplify mutableState.update lambda for better readability
- Remove redundant boolean comparison in isSyncEnabled assignment
---------
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
This time, the Kitsu API docs are silent on whether this field (or
any other field) can be null/undefined/etc, but it can happen and
caused an error during search and update. This change just ensures the
attribute is nullable and is set to an empty String when it is null.
(cherry picked from commit f5c6d2e1a6896c031b8f4583375ee868f252822a)
* Don't use animateItem's fade-in/fade-out in FastScrollLazyColumn
* Move to extension function
Avoid using animateItemPlacement name since it's shadowed by compose-bom's deprecated one
(cherry picked from commit 913ff22132390a59a13c463645ce954c7cbc5c6b)
The API docs and the responses type `ratingTwenty` as a "number" (Int
in Kotlin, it's divided by 2 for a .5 step scale 0-10). It's nullable
because an entry without a user rating returns `null` in that field.
(cherry picked from commit 001249a89dd4824a3df5661733062662c0ab44bd)
* Track when marked as read
* Add dismiss to snack bar
* i18n & ignore decimal chapters
* Detekt would have caught that 🤣
* `Ok` > `Yes`
* Dont prompt if untracked or current > new
* Move to MangaScreenModel
* Suggestions
Co-Authored-By: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
* Review 2
* toggleAllSelections first
---------
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit abfb72c89c008973db866bf4b696b699db155574)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
* Migrate tracking APIs to DTOs
Changes the handling of tracker API responses to be parsed to DTOs
instead of doing so "manually" by use of `jsonPrimitive`s and/or
`Json.decodeFromString` invocations.
This greatly simplifies the API response handling.
Renamed constants to SCREAMING_SNAKE_CASE.
Largely tried to name the DTOs in a uniform pattern, with the
tracker's (short) name at the beginning of file and data class names
(ALOAuth instead of OAuth, etc).
With these changes, no area of the code base should be using
`jsonPrimitive` and/or `Json.decodeFromString` anymore.
* Fix wrong types in KitsuAlgoliaSearchItem
This API returns start and end dates as Long and the score as Double.
Kitsu's docs claim they're strings (and they are, when requesting
manga details from Kitsu directly) but the Algolia search results
return Longs and Double, respectively.
* Apply review changes
- Renamed `BangumiX` classes to `BGMX` classes.
- Renamed `toXStatus` and `toXScore` to `toApiStatus` and `toApiScore`
* Handle migration from detekt to spotless
Removed Suppressions added for detekt.
Specifically removed:
- `SwallowedException` where an exception ends as a default value
- `MagicNumber`
- `CyclomaticComplexMethod`
- `TooGenericExceptionThrown`
Also ran spotlessApply which changed SMAddMangaResponse
* Fix Kitsu failing to add series
The `included` attribute seems to only appear when the user already
has the entry in their Kitsu list.
Since both `data` and `included` are required for `firstToTrack`, a
guard clause has been added before all its calls.
* Fix empty Bangumi error when entry doesn't exist
Previously, the non-null assertion (!!) would cause a
NullPointerException and a Toast with
"Bangumi error: " (no message) when the user had removed their list
entry from Bangumi through other means like the website.
Now it will show "Bangumi error: Could not find manga".
This is analogous to the error shown by Kitsu under these
circumstances.
* Fix Shikimori ignoring missing remote entry
The user would see no indication that Shikimori could not properly
refresh the track from the remote. This change causes the error Toast
notification to pop up with the following message
"Shikimori error: Could not find manga".
This is analogous to Kitsu and Bangumi.
* Remove usage of let where not needed
These particular occurrences weren't needed because properties are
directly accessible to further act upon. This neatly simplifies these
clauses.
* Remove missed let
(cherry picked from commit 9f99f038f341e325c4f56372a5ce950cf9f7cd6d)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistInterceptor.kt
# app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt
# app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt
# app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt
# app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt
# app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriInterceptor.kt