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

[Feature Request]: 为 GraphQL character 和 person 增加 name_cn #810

Open
Him188 opened this issue Nov 2, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Him188
Copy link

Him188 commented Nov 2, 2024

https://api.bgm.tv/v0/graphql

fragment SubjectFragment on Subject {
  id
  name #works
  name_cn # works
  characters {
    type
    character {
      id
      name # works
      name_cn # does not work
    }
  }
  persons {
    person {
      name  # works
      name_cn # does not work
    }
    position
  }
}

query BatchGetSubjectQuery {
  s0:subject(id: 425991){...SubjectFragment}
}

上述请求中 "works" 部分为目前已经支持的. 可以看到条目有 name_cn 字段. 角色和人物的 HTTP API 也有中文名字段, 说明数据库里应该有这些信息.

可以在 GraphQL API 也加上中文名, 也就是实现上述 "does not work" 部分.

@Him188 Him188 added the enhancement New feature or request label Nov 2, 2024
@Him188
Copy link
Author

Him188 commented Nov 2, 2024

没事了, 可以用 infobox 里 "简体中文名" 拿到 (虽然增加了更大查询体积)

{
  "data": {
    "s0": {
      "id": 425991,
      "type": 2,
      "name": "魔王2099",
      "name_cn": "魔王2099",
      "images": {
        "large": "https://lain.bgm.tv/pic/cover/l/31/d7/425991_JFQel.jpg",
        "common": "https://lain.bgm.tv/pic/cover/c/31/d7/425991_JFQel.jpg"
      },
      "characters": [
        {
          "order": 0,
          "type": 1,
          "character": {
            "id": 137905,
            "name": "ベルトール=ベルベット・ベールシュバルト",
            "comment": 7,
            "collects": 4,
            "infobox": [
              {
                "key": "简体中文名",
                "values": [
                  {
                    "k": null,
                    "v": "贝尔托尔·贝尔维特·贝尔修瓦特"
                  }
                ]
              },

@trim21 trim21 transferred this issue from bangumi/server Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant