Small [YouTube] cleanup (#9860)

This commit is contained in:
Pierre-Yves Bigourdan
2023-12-30 19:07:08 +01:00
committed by GitHub
parent 700566ff26
commit 3300e4a09d
2 changed files with 4 additions and 5 deletions

View File

@@ -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 })
} }
} }

View File

@@ -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
} }
} }