Small [YouTube] cleanup (#9860)
This commit is contained in:
committed by
GitHub
parent
700566ff26
commit
3300e4a09d
@@ -70,7 +70,7 @@ class YouTubeBase extends BaseJsonService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async handle({ channelId, videoId }, queryParams) {
|
async handle({ channelId, videoId }) {
|
||||||
const id = channelId || videoId
|
const id = channelId || videoId
|
||||||
const json = await this.fetch({ id })
|
const json = await this.fetch({ id })
|
||||||
if (json.pageInfo.totalResults === 0) {
|
if (json.pageInfo.totalResults === 0) {
|
||||||
@@ -79,7 +79,7 @@ class YouTubeBase extends BaseJsonService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const statistics = json.items[0].statistics
|
const statistics = json.items[0].statistics
|
||||||
return this.constructor.render({ statistics, id }, queryParams)
|
return this.constructor.render({ statistics, id })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,11 @@ export default class YouTubeLikes extends YouTubeVideoBase {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
static render({ statistics, id }, queryParams) {
|
static render({ statistics, id }) {
|
||||||
const renderedBadge = super.renderSingleStat({
|
return super.renderSingleStat({
|
||||||
statistics,
|
statistics,
|
||||||
statisticName: 'like',
|
statisticName: 'like',
|
||||||
id,
|
id,
|
||||||
})
|
})
|
||||||
return renderedBadge
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user