Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
elringus committed Dec 6, 2023
1 parent d7d74a7 commit 8a713cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/.vitepress/imgit/plugin/youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const thumbs = ["maxresdefault", "hqdefault", "mqdefault", "sddefault", "default
/** Allows embedding YouTube videos with imgit.
* @example ![](https://www.youtube.com/watch?v=J7UwSVsiwzI) */
export default function (): Plugin {
if (!cache.hasOwnProperty("youtube")) cache.youtube = {};
return {
resolvers: [resolve],
builders: [build]
Expand Down Expand Up @@ -48,7 +49,7 @@ function build(asset: BuiltAsset): boolean {
}

async function resolveThumbnailUrl(id: string): Promise<string> {
if ((<YouTubeCache>cache).youtube?.hasOwnProperty(id))
if ((<YouTubeCache>cache).youtube.hasOwnProperty(id))
return (<YouTubeCache>cache).youtube[id];
let response: Response;
for (const variant of thumbs)
Expand Down

0 comments on commit 8a713cf

Please sign in to comment.