From ca7c3164e1b83b043b228c451328279c91f1fe74 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 21 Feb 2025 18:15:29 -0300 Subject: [PATCH] chore(AnimatedThumbnailOverlayView): Refactor thumbnail handling to use Thumbnail class --- .../classes/AnimatedThumbnailOverlayView.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/parser/classes/AnimatedThumbnailOverlayView.ts b/src/parser/classes/AnimatedThumbnailOverlayView.ts index 9bebfd3f..1eaa2d82 100644 --- a/src/parser/classes/AnimatedThumbnailOverlayView.ts +++ b/src/parser/classes/AnimatedThumbnailOverlayView.ts @@ -1,25 +1,14 @@ import { YTNode } from '../helpers.js'; import type { RawNode } from '../types/index.js'; +import Thumbnail from './misc/Thumbnail.js'; export default class AnimatedThumbnailOverlayView extends YTNode { static type = 'AnimatedThumbnailOverlayView'; - thumbnail: { - sources: { - url: string, - width: number, - height: number - }[] - }; + public thumbnail: Thumbnail[]; constructor(data: RawNode) { super(); - this.thumbnail = { - sources: data.thumbnail.sources.map((item: any) => ({ - url: item.url, - width: item.width, - height: item.height - })) - }; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); } }