From dff535a9e278dbb45a0ede5a82d4cbacd71c503d Mon Sep 17 00:00:00 2001 From: LuanRT Date: Wed, 6 Jul 2022 17:34:31 -0300 Subject: [PATCH] fix: refactor `Analytics` to use memo --- lib/parser/youtube/Analytics.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/parser/youtube/Analytics.js b/lib/parser/youtube/Analytics.js index 03305e43..c79be8d1 100644 --- a/lib/parser/youtube/Analytics.js +++ b/lib/parser/youtube/Analytics.js @@ -12,10 +12,7 @@ class Analytics { constructor(response) { this.#page = Parser.parseResponse(response); - const tab = this.#page.contents.tabs.get({ selected: true }); - const item = tab.content.contents.get({ target_id: null }); - - this.sections = item.contents; + this.sections = this.#page.contents_memo.get('Element'); } get page() { @@ -23,4 +20,4 @@ class Analytics { } } -module.exports = Analytics; \ No newline at end of file +module.exports = Analytics;