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

[Kitsu API] Deals with the case where there is no small/tiny image #596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kcchouette
Copy link
Contributor

In the case of a recent anime, here the content we have back for poster:

      "posterImage": {
        "original": "https://kitsu-production-media.s3.us-west-002.backblazeb2.com/anime/44979/poster_image/9f6b8e791778abde38ca7e711327f50e.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=002d6013655cdc00000000003%2F20220116%2Fus-west-002%2Fs3%2Faws4_request&X-Amz-Date=20220116T214041Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=602c57bd3964a1aa4074cefb1f0e39d30a1ff6b46d23cd703cc12097b70959df",
        "meta": {
          "dimensions": {}
        }
      }

(for CUE anime / id = 44979)

So we have no small/tiny poster and so trackma keeps crashing

@Kcchouette Kcchouette changed the title [Kitsu API] Deals the case where there is no small/tiny image [Kitsu API] Deals with the case where there is no small/tiny image Jan 16, 2022
@ahmubashshir
Copy link
Contributor

ahmubashshir commented Jan 17, 2022

@Kcchouette, try writing more descriptive commit message than just "Update X" or "Fix Y"
Read these: 1 2 3

@Kcchouette
Copy link
Contributor Author

@ahmubashshir you are right, but when merging you can squash it
Here title is understandable

@ahmubashshir
Copy link
Contributor

People do more merge than squash, and the "Update X/Y" commit messages don't sense in that situation.

Fun fact: you didn't have to write a good description and title for the PR at all, if you write commit messages properly, github-cli uses the first commit title as PR title and generates the body from either first commit message body or from the title of all commit unmerged in that branch.

@@ -560,8 +560,8 @@ def _parse_info(self, media):
# For now I'm just picking the romaji title in these cases.
'title': attr['titles'].get('en_jp') or attr.get('canonicalTitle') or attr['titles'].get('en'),
'total': total or 0,
'image': attr['posterImage'] and attr['posterImage']['small'],
'image_thumb': attr['posterImage'] and attr['posterImage']['tiny'],
'image': attr['posterImage'] and attr['posterImage'].get('small'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a fallback to 'original' if 'small' cannot be found?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image is used by the details dialog. How small is the small thumb? And yes I think a fallback to original would be sensible as the details dialog can be as big as you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants