From 52aef0ff890d6e3a6cffd1a4baa2b4f676c7ec86 Mon Sep 17 00:00:00 2001 From: Daniel Bady Date: Sun, 10 Mar 2024 13:21:23 +0100 Subject: [PATCH] Added StatusError, default group variable to comply with pull request https://github.com/Mochi-Team/mochi/pull/6 --- .gitignore | 3 ++- src/core/errors/StatusError.ts | 12 ++++++++++++ src/core/errors/index.ts | 1 + src/core/index.ts | 1 + src/interfaces/source/types.ts | 6 ++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/core/errors/StatusError.ts create mode 100644 src/core/errors/index.ts diff --git a/.gitignore b/.gitignore index 73ece88..b41dde3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ dist/ node_modules/ .vscode/ +.idea/ -.DS_Store \ No newline at end of file +.DS_Store diff --git a/src/core/errors/StatusError.ts b/src/core/errors/StatusError.ts new file mode 100644 index 0000000..20aa1e2 --- /dev/null +++ b/src/core/errors/StatusError.ts @@ -0,0 +1,12 @@ +export class StatusError extends Error { + status: number; + data: string; + hostname: string; + + constructor(status: number, message: string, data: string, hostname: string) { + super(message); + this.status = status; + this.data = data; + this.hostname = hostname; + } +} diff --git a/src/core/errors/index.ts b/src/core/errors/index.ts new file mode 100644 index 0000000..fe4be23 --- /dev/null +++ b/src/core/errors/index.ts @@ -0,0 +1 @@ +export * from './StatusError'; diff --git a/src/core/index.ts b/src/core/index.ts index 323e9d9..849b3ff 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,3 +1,4 @@ export * from './request'; +export * from './errors'; // export * from './storage'; // export * from './crypto'; diff --git a/src/interfaces/source/types.ts b/src/interfaces/source/types.ts index b3d8a6b..7231171 100644 --- a/src/interfaces/source/types.ts +++ b/src/interfaces/source/types.ts @@ -49,6 +49,7 @@ export enum DiscoverListingType { default, rank, featured, + lastWatched, } export enum DiscoverListingOrientationType { @@ -241,6 +242,11 @@ export type PlaylistGroup = { * If it is initialized but no variants are provided, it is assumed that there is no contents for this group. */ variants?: PlaylistGroupVariant[]; + + /** + * The current group is the one that should be shown when playlist details are opened. + */ + default?: boolean; }; export type PlaylistGroupVariantID = string;