How to use bangumi-data - 2 common examples

To help you get started, we’ve selected a few bangumi-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github czy0729 / Bangumi / screens / home / subject / store.js View on Github external
init = async () => {
    const state = await this.getStorage(undefined, this.namespace)
    this.setState({
      ...state,
      visible: false,
      chap: '',
      vol: '',
      _loaded: true
    })

    const res = subjectStore.fetchSubject(this.subjectId)
    const data = await res
    const item = bangumiData.items.find(item => item.title === data.name)
    if (item) {
      this.setState({
        bangumiInfo: {
          sites: item.sites,
          type: item.type
        }
      })
    }

    // 获取其他源头eps在线地址
    if (this.type === '动画') {
      const { _ningMoeId } = this.params
      if (_ningMoeId) {
        discoveryStore.fetchNingMoeDetail({
          id: _ningMoeId,
          bgmId: this.subjectId
github czy0729 / Bangumi / utils / app.js View on Github external
export function findBangumiCn(jp = '') {
  if (_bangumiFindHistory[jp]) {
    return _bangumiFindHistory[jp]
  }

  const item = bangumiData.items.find(item => item.title === jp)
  if (item) {
    const cn =
      (item.titleTranslate &&
        item.titleTranslate['zh-Hans'] &&
        item.titleTranslate['zh-Hans'][0]) ||
      jp
    _bangumiFindHistory[jp] = cn
    return cn
  }

  _bangumiFindHistory[jp] = jp
  return jp
}

bangumi-data

Raw data for Anime

CC-BY-4.0
Latest version published 27 days ago

Package Health Score

84 / 100
Full package analysis

Popular bangumi-data functions