diff --git a/materialious/src/lib/Api/index.ts b/materialious/src/lib/Api/index.ts
index 49b07cc5..112b1020 100644
--- a/materialious/src/lib/Api/index.ts
+++ b/materialious/src/lib/Api/index.ts
@@ -1,6 +1,6 @@
import { get } from 'svelte/store';
import { auth, returnYTDislikesInstance } from '../../store';
-import type { Channel, ChannelPage, Comments, ReturnYTDislikes, SearchSuggestion, Subscription, Video, VideoPlay } from './model';
+import type { Channel, ChannelPage, Comments, Playlist, ReturnYTDislikes, SearchSuggestion, Subscription, Video, VideoPlay } from './model';
export function buildPath(path: string): string {
return `${import.meta.env.VITE_DEFAULT_INVIDIOUS_INSTANCE}/api/v1/${path}`;
@@ -65,7 +65,7 @@ export async function getSearch(search: string, options: {
sort_by?: "relevance" | "rating" | "upload_date" | "view_count",
type?: "video" | "playlist" | "channel" | "all";
page?: string;
-}): Promise<(Channel | Video)[]> {
+}): Promise<(Channel | Video | Playlist)[]> {
if (typeof options.sort_by === "undefined") {
options.sort_by = "relevance";
}
diff --git a/materialious/src/lib/Api/model.ts b/materialious/src/lib/Api/model.ts
index f1dea827..7a6eb969 100644
--- a/materialious/src/lib/Api/model.ts
+++ b/materialious/src/lib/Api/model.ts
@@ -159,6 +159,25 @@ export interface Channel {
authorThumbnails: Image[];
}
+export interface PlaylistVideo {
+ title: string;
+ videoId: string;
+ lengthSeconds: number;
+ videoThumbnails: Thumbnail[];
+}
+
+export interface Playlist {
+ type: "playlist";
+ title: string;
+ playlistId: string;
+ playlistThumbnail: string;
+ author: string;
+ authorId: string;
+ authorVerified: boolean;
+ videoCount: number;
+ videos: PlaylistVideo[];
+}
+
export interface ChannelPage extends Channel {
allowedRegions: string[];
tabs: string[];
diff --git a/materialious/src/lib/Channel.svelte b/materialious/src/lib/Channel.svelte
deleted file mode 100644
index 84dc6160..00000000
--- a/materialious/src/lib/Channel.svelte
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- {channel.description} {channel.description}
-
{truncate(channel.author, 14)}
-
- {cleanNumber(channel.subCount)} subscribers
-
-
+ {/if}
+
{truncate(channel.author, 14)}
+
+ {cleanNumber(channel.subCount)} subscribers
+
+