In short:
- fetch & show actual summary
- fallback to "name" if "name_cn" is empty
- request larger responseGroup to get & display the summary & rating
- add type filter query param to make Bangumi filter, not us
Previously, we only displayed the "name" in the summary area and used
"name_cn" as the entry name. However, "name_cn" (Chinese name) can be
an empty string at times, resulting in an awkward looking search
result list where some, many, or even all the results have no title
displayed and only show the "name" (Japanese name) in the summary
area. This has been solved by using "name" as a fallback value should
"name_cn" be empty.
If a Chinese name is available, the original name is prepended to the
summary with the addition "作品原名:" (meaning "original series title").
By using the "responseGroup=large" query parameter, we can request
the required data we need to display the actual summary for an entry
and the entry's average rating.
The "name" is prepended to the summary contents, if any exist, so it
is still accessible for series identification if a "name_cn" exists
too and was used for the result title.
Adding the "type=1" filter query parameter means Bangumi will only
return entries of type 1 ("book") instead of all types and Mihon
needing to filter, resulting in potentially missed entry matches.
(cherry picked from commit 78f9a84b14e0ece988f80d61011f63c0f7e92a67)
# Conflicts:
# CHANGELOG.md
Somehow this specific issue keeps getting flagged by unrelated PRs'
CI runs (but only sometimes? Somehow? Other times the CI run would
succeed with no spotless issues.)
---------
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit ed9e13a365ba1b55cec21c26b93b1c62d29485c8)
* 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>