From 7447eb3fbfab9f64ece504c7b331351264262675 Mon Sep 17 00:00:00 2001 From: Guus van Meerveld Date: Wed, 26 Jun 2024 17:48:53 +0200 Subject: [PATCH] channel: made avatar, banner and description optional --- src/client/adapters/piped/transformer.ts | 6 +++--- src/client/adapters/piped/typings/channel.ts | 6 +++--- src/client/typings/channel.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/adapters/piped/transformer.ts b/src/client/adapters/piped/transformer.ts index 8ab0253..5dea804 100644 --- a/src/client/adapters/piped/transformer.ts +++ b/src/client/adapters/piped/transformer.ts @@ -169,10 +169,10 @@ export default class Transformer { return { name: data.name, id: data.id, - description: data.description, - avatar: data.avatarUrl, + description: data.description ?? undefined, + avatar: data.avatarUrl ?? undefined, subscribers: data.subscriberCount, - banner: data.bannerUrl, + banner: data.bannerUrl ?? undefined, verified: data.verified }; } diff --git a/src/client/adapters/piped/typings/channel.ts b/src/client/adapters/piped/typings/channel.ts index 0f26e6d..052508d 100644 --- a/src/client/adapters/piped/typings/channel.ts +++ b/src/client/adapters/piped/typings/channel.ts @@ -14,9 +14,9 @@ export const tabType = z.enum(tabEnum); export const ChannelModel = z.object({ id: z.string(), name: z.string(), - avatarUrl: z.string().url(), - bannerUrl: z.string().url(), - description: z.string(), + avatarUrl: z.string().url().nullable(), + bannerUrl: z.string().url().nullable(), + description: z.string().nullable(), nextpage: z.string().nullable(), subscriberCount: z.number(), verified: z.boolean(), diff --git a/src/client/typings/channel.ts b/src/client/typings/channel.ts index 9601bac..3b50abb 100644 --- a/src/client/typings/channel.ts +++ b/src/client/typings/channel.ts @@ -3,7 +3,7 @@ import { Author } from "./author"; export interface Channel extends Author { id: string; subscribers: number; - description: string; - avatar: string; + description?: string; + avatar?: string; banner?: string; }