Skip to content
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

Various improvements to Bangumi search #1396

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

MajorTanya
Copy link
Member

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.

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.

Sadly, Bangumi does not return any data on start or end dates in the search, no matter what responseGroup is used. Their data on this is sometimes contradictory at best anyway and often mixes Japanese and Chinese release dates.

Old New
image image

@MajorTanya MajorTanya force-pushed the fix-bangumi-description branch from b4f51d8 to ec8d14d Compare October 29, 2024 18:39
@MajorTanya
Copy link
Member Author

Rebased as well because why not

@MajorTanya MajorTanya requested a review from AntsyLich October 29, 2024 18:41
@AntsyLich
Copy link
Member

Where changelog

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.

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.
If a Chinese name is available, the original name is prepended to the
summary with the addition "作品原名:" (meaning "original series title").
@MajorTanya MajorTanya force-pushed the fix-bangumi-description branch from 871b3ac to 97c36b2 Compare October 30, 2024 19:42
@AntsyLich AntsyLich merged commit 78f9a84 into mihonapp:main Oct 30, 2024
1 check passed
@MajorTanya MajorTanya deleted the fix-bangumi-description branch October 30, 2024 19:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants