diff --git a/.prettierrc b/.prettierrc index 64aca77..0fdfbf3 100644 --- a/.prettierrc +++ b/.prettierrc @@ -11,9 +11,9 @@ "requirePragma": false, "semi": true, "singleQuote": true, - "tabWidth": 2, + "tabWidth": 4, "trailingComma": "none", - "useTabs": false, + "useTabs": true, "vueIndentScriptAndStyle": false, "printWidth": 180, "endOfLine": "auto" diff --git a/@types/adnPlayerConfig.d.ts b/@types/adnPlayerConfig.d.ts index 82a81ec..62634f5 100644 --- a/@types/adnPlayerConfig.d.ts +++ b/@types/adnPlayerConfig.d.ts @@ -1,50 +1,50 @@ export interface ADNPlayerConfig { - player: Player; + player: Player; } export interface Player { - image: string; - options: Options; + image: string; + options: Options; } export interface Options { - user: User; - chromecast: Chromecast; - ios: Ios; - video: Video; - dock: any[]; - preference: Preference; + user: User; + chromecast: Chromecast; + ios: Ios; + video: Video; + dock: any[]; + preference: Preference; } export interface Chromecast { - appId: string; - refreshTokenUrl: string; + appId: string; + refreshTokenUrl: string; } export interface Ios { - videoUrl: string; - appUrl: string; - title: string; + videoUrl: string; + appUrl: string; + title: string; } export interface Preference { - quality: string; - autoplay: boolean; - language: string; - green: boolean; + quality: string; + autoplay: boolean; + language: string; + green: boolean; } export interface User { - hasAccess: boolean; - profileId: number; - refreshToken: string; - refreshTokenUrl: string; + hasAccess: boolean; + profileId: number; + refreshToken: string; + refreshTokenUrl: string; } export interface Video { - startDate: null; - currentDate: Date; - available: boolean; - free: boolean; - url: string; + startDate: null; + currentDate: Date; + available: boolean; + free: boolean; + url: string; } diff --git a/@types/adnSearch.d.ts b/@types/adnSearch.d.ts index a8f47b7..c47b33a 100644 --- a/@types/adnSearch.d.ts +++ b/@types/adnSearch.d.ts @@ -1,46 +1,46 @@ export interface ADNSearch { - shows: ADNSearchShow[]; - total: number; + shows: ADNSearchShow[]; + total: number; } export interface ADNSearchShow { - id: number; - title: string; - type: string; - originalTitle: string; - shortTitle: string; - reference: string; - age: string; - languages: string[]; - summary: string; - image: string; - image2x: string; - imageHorizontal: string; - imageHorizontal2x: string; - url: string; - urlPath: string; - episodeCount: number; - genres: string[]; - copyright: string; - rating: number; - ratingsCount: number; - commentsCount: number; - qualities: string[]; - simulcast: boolean; - free: boolean; - available: boolean; - download: boolean; - basedOn: string; - tagline: null; - firstReleaseYear: string; - productionStudio: string; - countryOfOrigin: string; - productionTeam: ProductionTeam[]; - nextVideoReleaseDate: null; - indexable: boolean; + id: number; + title: string; + type: string; + originalTitle: string; + shortTitle: string; + reference: string; + age: string; + languages: string[]; + summary: string; + image: string; + image2x: string; + imageHorizontal: string; + imageHorizontal2x: string; + url: string; + urlPath: string; + episodeCount: number; + genres: string[]; + copyright: string; + rating: number; + ratingsCount: number; + commentsCount: number; + qualities: string[]; + simulcast: boolean; + free: boolean; + available: boolean; + download: boolean; + basedOn: string; + tagline: null; + firstReleaseYear: string; + productionStudio: string; + countryOfOrigin: string; + productionTeam: ProductionTeam[]; + nextVideoReleaseDate: null; + indexable: boolean; } export interface ProductionTeam { - role: string; - name: string; + role: string; + name: string; } diff --git a/@types/adnStreams.d.ts b/@types/adnStreams.d.ts index 8942942..48dd969 100644 --- a/@types/adnStreams.d.ts +++ b/@types/adnStreams.d.ts @@ -1,51 +1,51 @@ export interface ADNStreams { - links: Links; - video: Video; - metadata: Metadata; + links: Links; + video: Video; + metadata: Metadata; } export interface Links { - streaming: Streaming; - subtitles: Subtitles; - history: string; - nextVideoUrl: string; - previousVideoUrl: string; + streaming: Streaming; + subtitles: Subtitles; + history: string; + nextVideoUrl: string; + previousVideoUrl: string; } export interface Streaming { - [streams: string]: Streams; + [streams: string]: Streams; } export interface Streams { - mobile: string; - sd: string; - hd: string; - fhd: string; - auto: string; + mobile: string; + sd: string; + hd: string; + fhd: string; + auto: string; } export interface Subtitles { - all: string; + all: string; } export interface Metadata { - title: string; - subtitle: string; - summary: null; - rating: number; + title: string; + subtitle: string; + summary: null; + rating: number; } export interface Video { - guid: string; - id: number; - currentTime: number; - duration: number; - url: string; - image: string; - tcEpisodeStart?:string; - tcEpisodeEnd?: string; - tcIntroStart?: string; - tcIntroEnd?: string; - tcEndingStart?: string; - tcEndingEnd?: string; + guid: string; + id: number; + currentTime: number; + duration: number; + url: string; + image: string; + tcEpisodeStart?:string; + tcEpisodeEnd?: string; + tcIntroStart?: string; + tcIntroEnd?: string; + tcEndingStart?: string; + tcEndingEnd?: string; } diff --git a/@types/adnSubtitles.d.ts b/@types/adnSubtitles.d.ts index ec45718..dc2cec1 100644 --- a/@types/adnSubtitles.d.ts +++ b/@types/adnSubtitles.d.ts @@ -1,11 +1,11 @@ export interface ADNSubtitles { - [subtitleLang: string]: Subtitle[]; + [subtitleLang: string]: Subtitle[]; } export interface Subtitle { - startTime: number; - endTime: number; - positionAlign: string; - lineAlign: string; - text: string; + startTime: number; + endTime: number; + positionAlign: string; + lineAlign: string; + text: string; } diff --git a/@types/adnVideos.d.ts b/@types/adnVideos.d.ts index ccf3d0b..27a2332 100644 --- a/@types/adnVideos.d.ts +++ b/@types/adnVideos.d.ts @@ -1,77 +1,77 @@ export interface ADNVideos { - videos: ADNVideo[]; + videos: ADNVideo[]; } export interface ADNVideo { - id: number; - title: string; - name: string; - number: string; - shortNumber: string; - season: string; - reference: string; - type: string; - order: number; - image: string; - image2x: string; - summary: string; - releaseDate: Date; - duration: number; - url: string; - urlPath: string; - embeddedUrl: string; - languages: string[]; - qualities: string[]; - rating: number; - ratingsCount: number; - commentsCount: number; - available: boolean; - download: boolean; - free: boolean; - freeWithAds: boolean; - show: Show; - indexable: boolean; - isSelected?: boolean; + id: number; + title: string; + name: string; + number: string; + shortNumber: string; + season: string; + reference: string; + type: string; + order: number; + image: string; + image2x: string; + summary: string; + releaseDate: Date; + duration: number; + url: string; + urlPath: string; + embeddedUrl: string; + languages: string[]; + qualities: string[]; + rating: number; + ratingsCount: number; + commentsCount: number; + available: boolean; + download: boolean; + free: boolean; + freeWithAds: boolean; + show: Show; + indexable: boolean; + isSelected?: boolean; } export interface Show { - id: number; - title: string; - type: string; - originalTitle: string; - shortTitle: string; - reference: string; - age: string; - languages: string[]; - summary: string; - image: string; - image2x: string; - imageHorizontal: string; - imageHorizontal2x: string; - url: string; - urlPath: string; - episodeCount: number; - genres: string[]; - copyright: string; - rating: number; - ratingsCount: number; - commentsCount: number; - qualities: string[]; - simulcast: boolean; - free: boolean; - available: boolean; - download: boolean; - basedOn: string; - tagline: string; - firstReleaseYear: string; - productionStudio: string; - countryOfOrigin: string; - productionTeam: ProductionTeam[]; - nextVideoReleaseDate: Date; - indexable: boolean; + id: number; + title: string; + type: string; + originalTitle: string; + shortTitle: string; + reference: string; + age: string; + languages: string[]; + summary: string; + image: string; + image2x: string; + imageHorizontal: string; + imageHorizontal2x: string; + url: string; + urlPath: string; + episodeCount: number; + genres: string[]; + copyright: string; + rating: number; + ratingsCount: number; + commentsCount: number; + qualities: string[]; + simulcast: boolean; + free: boolean; + available: boolean; + download: boolean; + basedOn: string; + tagline: string; + firstReleaseYear: string; + productionStudio: string; + countryOfOrigin: string; + productionTeam: ProductionTeam[]; + nextVideoReleaseDate: Date; + indexable: boolean; } export interface ProductionTeam { - role: string; - name: string; + role: string; + name: string; } diff --git a/@types/animeOnegaiSearch.d.ts b/@types/animeOnegaiSearch.d.ts index 74bdfc1..e030157 100644 --- a/@types/animeOnegaiSearch.d.ts +++ b/@types/animeOnegaiSearch.d.ts @@ -1,88 +1,88 @@ export interface AnimeOnegaiSearch { - text: string; - list: AOSearchResult[]; + text: string; + list: AOSearchResult[]; } export interface AOSearchResult { - /** - * Asset ID - */ - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - title: string; - active: boolean; - excerpt: string; - description: string; - bg: string; - poster: string; - entry: string; - code_name: string; - /** - * The Video ID required to get the streams - */ - video_entry: string; - trailer: string; - year: number; - /** - * Asset Type, Known Possibilities - * * 1 - Video - * * 2 - Series - */ - asset_type: 1 | 2; - status: number; - permalink: string; - duration: string; - subtitles: boolean; - price: number; - rent_price: number; - rating: number; - color: number | null; - classification: number; - brazil_classification: null | string; - likes: number; - views: number; - button: string; - stream_url: string; - stream_url_backup: string; - copyright: null | string; - skip_intro: null | string; - ending: null | string; - bumper_intro: string; - ads: string; - age_restriction: boolean | null; - epg: null; - allow_languages: string[] | null; - allow_countries: string[] | null; - classification_text: string; - locked: boolean; - resign: boolean; - favorite: boolean; - actors_list: null; - voiceactors_list: null; - artdirectors_list: null; - audios_list: null; - awards_list: null; - companies_list: null; - countries_list: null; - directors_list: null; - edition_list: null; - genres_list: null; - music_list: null; - photograpy_list: null; - producer_list: null; - screenwriter_list: null; - season_list: null; - tags_list: null; - chapter_id: number; - chapter_entry: string; - chapter_poster: string; - progress_time: number; - progress_percent: number; - included_subscription: number; - paid_content: number; - rent_content: number; - objectID: string; - lang: string; + /** + * Asset ID + */ + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + title: string; + active: boolean; + excerpt: string; + description: string; + bg: string; + poster: string; + entry: string; + code_name: string; + /** + * The Video ID required to get the streams + */ + video_entry: string; + trailer: string; + year: number; + /** + * Asset Type, Known Possibilities + * * 1 - Video + * * 2 - Series + */ + asset_type: 1 | 2; + status: number; + permalink: string; + duration: string; + subtitles: boolean; + price: number; + rent_price: number; + rating: number; + color: number | null; + classification: number; + brazil_classification: null | string; + likes: number; + views: number; + button: string; + stream_url: string; + stream_url_backup: string; + copyright: null | string; + skip_intro: null | string; + ending: null | string; + bumper_intro: string; + ads: string; + age_restriction: boolean | null; + epg: null; + allow_languages: string[] | null; + allow_countries: string[] | null; + classification_text: string; + locked: boolean; + resign: boolean; + favorite: boolean; + actors_list: null; + voiceactors_list: null; + artdirectors_list: null; + audios_list: null; + awards_list: null; + companies_list: null; + countries_list: null; + directors_list: null; + edition_list: null; + genres_list: null; + music_list: null; + photograpy_list: null; + producer_list: null; + screenwriter_list: null; + season_list: null; + tags_list: null; + chapter_id: number; + chapter_entry: string; + chapter_poster: string; + progress_time: number; + progress_percent: number; + included_subscription: number; + paid_content: number; + rent_content: number; + objectID: string; + lang: string; } \ No newline at end of file diff --git a/@types/animeOnegaiSeasons.d.ts b/@types/animeOnegaiSeasons.d.ts index 3ffe879..90e851d 100644 --- a/@types/animeOnegaiSeasons.d.ts +++ b/@types/animeOnegaiSeasons.d.ts @@ -1,36 +1,36 @@ export interface AnimeOnegaiSeasons { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - number: number; - asset_id: number; - entry: string; - description: string; - active: boolean; - allow_languages: string[]; - allow_countries: string[]; - list: Episode[]; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + number: number; + asset_id: number; + entry: string; + description: string; + active: boolean; + allow_languages: string[]; + allow_countries: string[]; + list: Episode[]; } export interface Episode { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - number: number; - description: string; - thumbnail: string; - entry: string; - video_entry: string; - active: boolean; - season_id: number; - stream_url: string; - skip_intro: null; - ending: null; - open_free: boolean; - asset_id: number; - age_restriction: boolean; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + number: number; + description: string; + thumbnail: string; + entry: string; + video_entry: string; + active: boolean; + season_id: number; + stream_url: string; + skip_intro: null; + ending: null; + open_free: boolean; + asset_id: number; + age_restriction: boolean; } diff --git a/@types/animeOnegaiSeries.d.ts b/@types/animeOnegaiSeries.d.ts index 52662ff..f8e5b21 100644 --- a/@types/animeOnegaiSeries.d.ts +++ b/@types/animeOnegaiSeries.d.ts @@ -1,111 +1,111 @@ export interface AnimeOnegaiSeries { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - title: string; - active: boolean; - excerpt: string; - description: string; - bg: string; - poster: string; - entry: string; - code_name: string; - /** - * The Video ID required to get the streams - */ - video_entry: string; - trailer: string; - year: number; - asset_type: number; - status: number; - permalink: string; - duration: string; - subtitles: boolean; - price: number; - rent_price: number; - rating: number; - color: number; - classification: number; - brazil_classification: string; - likes: number; - views: number; - button: string; - stream_url: string; - stream_url_backup: string; - copyright: string; - skip_intro: null; - ending: null; - bumper_intro: string; - ads: string; - age_restriction: boolean; - epg: null; - allow_languages: string[]; - allow_countries: string[]; - classification_text: string; - locked: boolean; - resign: boolean; - favorite: boolean; - actors_list: CtorsList[]; - voiceactors_list: CtorsList[]; - artdirectors_list: any[]; - audios_list: SList[]; - awards_list: any[]; - companies_list: any[]; - countries_list: any[]; - directors_list: CtorsList[]; - edition_list: any[]; - genres_list: SList[]; - music_list: any[]; - photograpy_list: any[]; - producer_list: any[]; - screenwriter_list: any[]; - season_list: any[]; - tags_list: TagsList[]; - chapter_id: number; - chapter_entry: string; - chapter_poster: string; - progress_time: number; - progress_percent: number; - included_subscription: number; - paid_content: number; - rent_content: number; - objectID: string; - lang: string; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + title: string; + active: boolean; + excerpt: string; + description: string; + bg: string; + poster: string; + entry: string; + code_name: string; + /** + * The Video ID required to get the streams + */ + video_entry: string; + trailer: string; + year: number; + asset_type: number; + status: number; + permalink: string; + duration: string; + subtitles: boolean; + price: number; + rent_price: number; + rating: number; + color: number; + classification: number; + brazil_classification: string; + likes: number; + views: number; + button: string; + stream_url: string; + stream_url_backup: string; + copyright: string; + skip_intro: null; + ending: null; + bumper_intro: string; + ads: string; + age_restriction: boolean; + epg: null; + allow_languages: string[]; + allow_countries: string[]; + classification_text: string; + locked: boolean; + resign: boolean; + favorite: boolean; + actors_list: CtorsList[]; + voiceactors_list: CtorsList[]; + artdirectors_list: any[]; + audios_list: SList[]; + awards_list: any[]; + companies_list: any[]; + countries_list: any[]; + directors_list: CtorsList[]; + edition_list: any[]; + genres_list: SList[]; + music_list: any[]; + photograpy_list: any[]; + producer_list: any[]; + screenwriter_list: any[]; + season_list: any[]; + tags_list: TagsList[]; + chapter_id: number; + chapter_entry: string; + chapter_poster: string; + progress_time: number; + progress_percent: number; + included_subscription: number; + paid_content: number; + rent_content: number; + objectID: string; + lang: string; } export interface CtorsList { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - Permalink?: string; - country: number | null; - year: number | null; - death: number | null; - image: string; - genre: null; - description: string; - permalink?: string; - background?: string; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + Permalink?: string; + country: number | null; + year: number | null; + death: number | null; + image: string; + genre: null; + description: string; + permalink?: string; + background?: string; } export interface SList { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - age_restriction?: number; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + age_restriction?: number; } export interface TagsList { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - position: number; - status: boolean; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + position: number; + status: boolean; } diff --git a/@types/animeOnegaiStream.d.ts b/@types/animeOnegaiStream.d.ts index 7199316..9eb3519 100644 --- a/@types/animeOnegaiStream.d.ts +++ b/@types/animeOnegaiStream.d.ts @@ -1,41 +1,41 @@ export interface AnimeOnegaiStream { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - source_url: string; - backup_url: string; - live: boolean; - token_handler: number; - entry: string; - job: string; - drm: boolean; - transcoding_content_id: string; - transcoding_asset_id: string; - status: number; - thumbnail: string; - hls: string; - dash: string; - widevine_proxy: string; - playready_proxy: string; - apple_licence: string; - apple_certificate: string; - dpath: string; - dbin: string; - subtitles: Subtitle[]; - origin: number; - offline_entry: string; - offline_status: boolean; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + source_url: string; + backup_url: string; + live: boolean; + token_handler: number; + entry: string; + job: string; + drm: boolean; + transcoding_content_id: string; + transcoding_asset_id: string; + status: number; + thumbnail: string; + hls: string; + dash: string; + widevine_proxy: string; + playready_proxy: string; + apple_licence: string; + apple_certificate: string; + dpath: string; + dbin: string; + subtitles: Subtitle[]; + origin: number; + offline_entry: string; + offline_status: boolean; } export interface Subtitle { - ID: number; - CreatedAt: Date; - UpdatedAt: Date; - DeletedAt: null; - name: string; - lang: string; - entry_id: string; - url: string; + ID: number; + CreatedAt: Date; + UpdatedAt: Date; + DeletedAt: null; + name: string; + lang: string; + entry_id: string; + url: string; } diff --git a/@types/crunchyAndroidEpisodes.d.ts b/@types/crunchyAndroidEpisodes.d.ts index 44a1269..9ee26b0 100644 --- a/@types/crunchyAndroidEpisodes.d.ts +++ b/@types/crunchyAndroidEpisodes.d.ts @@ -1,136 +1,136 @@ import { Images } from './crunchyEpisodeList'; export interface CrunchyAndroidEpisodes { - __class__: string; - __href__: string; - __resource_key__: string; - __links__: object; - __actions__: object; - total: number; - items: CrunchyAndroidEpisode[]; + __class__: string; + __href__: string; + __resource_key__: string; + __links__: object; + __actions__: object; + total: number; + items: CrunchyAndroidEpisode[]; } export interface CrunchyAndroidEpisode { - __class__: string; - __href__: string; - __resource_key__: string; - __links__: Links; - __actions__: Actions; - playback: string; - id: string; - channel_id: ChannelID; - series_id: string; - series_title: string; - series_slug_title: string; - season_id: string; - season_title: string; - season_slug_title: string; - season_number: number; - episode: string; - episode_number: number; - sequence_number: number; - production_episode_id: string; - title: string; - slug_title: string; - description: string; - next_episode_id: string; - next_episode_title: string; - hd_flag: boolean; - maturity_ratings: MaturityRating[]; - extended_maturity_rating: Actions; - is_mature: boolean; - mature_blocked: boolean; - episode_air_date: Date; - upload_date: Date; - availability_starts: Date; - availability_ends: Date; - eligible_region: string; - available_date: Date; - free_available_date: Date; - premium_date: Date; - premium_available_date: Date; - is_subbed: boolean; - is_dubbed: boolean; - is_clip: boolean; - seo_title: string; - seo_description: string; - season_tags: string[]; - available_offline: boolean; - subtitle_locales: Locale[]; - availability_notes: string; - audio_locale: Locale; - versions: Version[]; - closed_captions_available: boolean; - identifier: string; - media_type: MediaType; - slug: string; - images: Images; - duration_ms: number; - is_premium_only: boolean; - listing_id: string; - hide_season_title?: boolean; - hide_season_number?: boolean; - isSelected?: boolean; - seq_id: string; + __class__: string; + __href__: string; + __resource_key__: string; + __links__: Links; + __actions__: Actions; + playback: string; + id: string; + channel_id: ChannelID; + series_id: string; + series_title: string; + series_slug_title: string; + season_id: string; + season_title: string; + season_slug_title: string; + season_number: number; + episode: string; + episode_number: number; + sequence_number: number; + production_episode_id: string; + title: string; + slug_title: string; + description: string; + next_episode_id: string; + next_episode_title: string; + hd_flag: boolean; + maturity_ratings: MaturityRating[]; + extended_maturity_rating: Actions; + is_mature: boolean; + mature_blocked: boolean; + episode_air_date: Date; + upload_date: Date; + availability_starts: Date; + availability_ends: Date; + eligible_region: string; + available_date: Date; + free_available_date: Date; + premium_date: Date; + premium_available_date: Date; + is_subbed: boolean; + is_dubbed: boolean; + is_clip: boolean; + seo_title: string; + seo_description: string; + season_tags: string[]; + available_offline: boolean; + subtitle_locales: Locale[]; + availability_notes: string; + audio_locale: Locale; + versions: Version[]; + closed_captions_available: boolean; + identifier: string; + media_type: MediaType; + slug: string; + images: Images; + duration_ms: number; + is_premium_only: boolean; + listing_id: string; + hide_season_title?: boolean; + hide_season_number?: boolean; + isSelected?: boolean; + seq_id: string; } export interface Links { - 'episode/channel': Link; - 'episode/next_episode': Link; - 'episode/season': Link; - 'episode/series': Link; - streams: Link; + 'episode/channel': Link; + 'episode/next_episode': Link; + 'episode/season': Link; + 'episode/series': Link; + streams: Link; } export interface Link { - href: string; + href: string; } export interface Thumbnail { - width: number; - height: number; - type: string; - source: string; + width: number; + height: number; + type: string; + source: string; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } export enum MediaType { - Episode = 'episode', + Episode = 'episode', } export enum ChannelID { - Crunchyroll = 'crunchyroll', + Crunchyroll = 'crunchyroll', } export enum MaturityRating { - Tv14 = 'TV-14', + Tv14 = 'TV-14', } export interface Version { - audio_locale: Locale; - guid: string; - original: boolean; - variant: string; - season_guid: string; - media_guid: string; - is_premium_only: boolean; + audio_locale: Locale; + guid: string; + original: boolean; + variant: string; + season_guid: string; + media_guid: string; + is_premium_only: boolean; } diff --git a/@types/crunchyAndroidObject.d.ts b/@types/crunchyAndroidObject.d.ts index 85835c9..5bccbb2 100644 --- a/@types/crunchyAndroidObject.d.ts +++ b/@types/crunchyAndroidObject.d.ts @@ -1,186 +1,186 @@ import { ImageType, Images, Image } from './objectInfo'; export interface CrunchyAndroidObject { - __class__: string; - __href__: string; - __resource_key__: string; - __links__: object; - __actions__: object; - total: number; - items: AndroidObject[]; + __class__: string; + __href__: string; + __resource_key__: string; + __links__: object; + __actions__: object; + total: number; + items: AndroidObject[]; } export interface AndroidObject { - __class__: string; - __href__: string; - __links__: Links; - __actions__: Actions; - id: string; - external_id: string; - channel_id: string; - title: string; - description: string; - promo_title: string; - promo_description: string; - type: string; - slug: string; - slug_title: string; - images: Images; - movie_listing_metadata?: MovieListingMetadata; - movie_metadata?: MovieMetadata; - playback?: string; - episode_metadata?: EpisodeMetadata; - streams_link?: string; - season_metadata?: SeasonMetadata; - linked_resource_key: string; - isSelected?: boolean; - f_num: string; - s_num: string; + __class__: string; + __href__: string; + __links__: Links; + __actions__: Actions; + id: string; + external_id: string; + channel_id: string; + title: string; + description: string; + promo_title: string; + promo_description: string; + type: string; + slug: string; + slug_title: string; + images: Images; + movie_listing_metadata?: MovieListingMetadata; + movie_metadata?: MovieMetadata; + playback?: string; + episode_metadata?: EpisodeMetadata; + streams_link?: string; + season_metadata?: SeasonMetadata; + linked_resource_key: string; + isSelected?: boolean; + f_num: string; + s_num: string; } export interface Links { - 'episode/season': LinkData; - 'episode/series': LinkData; - resource: LinkData; - 'resource/channel': LinkData; - streams: LinkData; + 'episode/season': LinkData; + 'episode/series': LinkData; + resource: LinkData; + 'resource/channel': LinkData; + streams: LinkData; } export interface LinkData { - href: string; + href: string; } export interface EpisodeMetadata { - audio_locale: Locale; - availability_ends: Date; - availability_notes: string; - availability_starts: Date; - available_date: null; - available_offline: boolean; - closed_captions_available: boolean; - duration_ms: number; - eligible_region: string; - episode: string; - episode_air_date: Date; - episode_number: number; - extended_maturity_rating: Record; - free_available_date: Date; - identifier: string; - is_clip: boolean; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - premium_available_date: Date; - premium_date: null; - season_id: string; - season_number: number; - season_slug_title: string; - season_title: string; - sequence_number: number; - series_id: string; - series_slug_title: string; - series_title: string; - subtitle_locales: Locale[]; - tenant_categories?: string[]; - upload_date: Date; - versions: EpisodeMetadataVersion[]; + audio_locale: Locale; + availability_ends: Date; + availability_notes: string; + availability_starts: Date; + available_date: null; + available_offline: boolean; + closed_captions_available: boolean; + duration_ms: number; + eligible_region: string; + episode: string; + episode_air_date: Date; + episode_number: number; + extended_maturity_rating: Record; + free_available_date: Date; + identifier: string; + is_clip: boolean; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + premium_available_date: Date; + premium_date: null; + season_id: string; + season_number: number; + season_slug_title: string; + season_title: string; + sequence_number: number; + series_id: string; + series_slug_title: string; + series_title: string; + subtitle_locales: Locale[]; + tenant_categories?: string[]; + upload_date: Date; + versions: EpisodeMetadataVersion[]; } export interface MovieListingMetadata { - availability_notes: string; - available_date: null; - available_offline: boolean; - duration_ms: number; - extended_description: string; - extended_maturity_rating: Record; - first_movie_id: string; - free_available_date: Date; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - movie_release_year: number; - premium_available_date: Date; - premium_date: null; - subtitle_locales: Locale[]; - tenant_categories: string[]; + availability_notes: string; + available_date: null; + available_offline: boolean; + duration_ms: number; + extended_description: string; + extended_maturity_rating: Record; + first_movie_id: string; + free_available_date: Date; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + movie_release_year: number; + premium_available_date: Date; + premium_date: null; + subtitle_locales: Locale[]; + tenant_categories: string[]; } export interface MovieMetadata { - availability_notes: string; - available_offline: boolean; - closed_captions_available: boolean; - duration_ms: number; - extended_maturity_rating: Record; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - movie_listing_id: string; - movie_listing_slug_title: string; - movie_listing_title: string; + availability_notes: string; + available_offline: boolean; + closed_captions_available: boolean; + duration_ms: number; + extended_maturity_rating: Record; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + movie_listing_id: string; + movie_listing_slug_title: string; + movie_listing_title: string; } export interface SeasonMetadata { - audio_locale: Locale; - audio_locales: Locale[]; - extended_maturity_rating: Record; - identifier: string; - is_mature: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - season_display_number: string; - season_sequence_number: number; - subtitle_locales: Locale[]; - versions: SeasonMetadataVersion[]; + audio_locale: Locale; + audio_locales: Locale[]; + extended_maturity_rating: Record; + identifier: string; + is_mature: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + season_display_number: string; + season_sequence_number: number; + subtitle_locales: Locale[]; + versions: SeasonMetadataVersion[]; } export interface SeasonMetadataVersion { - audio_locale: Locale; - guid: string; - original: boolean; - variant: string; + audio_locale: Locale; + guid: string; + original: boolean; + variant: string; } export interface SeriesMetadata { - audio_locales: Locale[]; - availability_notes: string; - episode_count: number; - extended_description: string; - extended_maturity_rating: Record; - is_dubbed: boolean; - is_mature: boolean; - is_simulcast: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - season_count: number; - series_launch_year: number; - subtitle_locales: Locale[]; - tenant_categories?: string[]; + audio_locales: Locale[]; + availability_notes: string; + episode_count: number; + extended_description: string; + extended_maturity_rating: Record; + is_dubbed: boolean; + is_mature: boolean; + is_simulcast: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + season_count: number; + series_launch_year: number; + subtitle_locales: Locale[]; + tenant_categories?: string[]; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } \ No newline at end of file diff --git a/@types/crunchyAndroidStreams.d.ts b/@types/crunchyAndroidStreams.d.ts index c5e9889..f3674fd 100644 --- a/@types/crunchyAndroidStreams.d.ts +++ b/@types/crunchyAndroidStreams.d.ts @@ -1,93 +1,93 @@ export interface CrunchyAndroidStreams { - __class__: string; - __href__: string; - __resource_key__: string; - __links__: Links; - __actions__: Record; - media_id: string; - audio_locale: Locale; - subtitles: Subtitles; - closed_captions: Subtitles; - streams: Streams; - bifs: string[]; - versions: Version[]; - captions: Record; + __class__: string; + __href__: string; + __resource_key__: string; + __links__: Links; + __actions__: Record; + media_id: string; + audio_locale: Locale; + subtitles: Subtitles; + closed_captions: Subtitles; + streams: Streams; + bifs: string[]; + versions: Version[]; + captions: Record; } export interface Subtitles { - '': Subtitle; - 'en-US'?: Subtitle; - 'es-LA'?: Subtitle; - 'es-419'?: Subtitle; - 'es-ES'?: Subtitle; - 'pt-BR'?: Subtitle; - 'fr-FR'?: Subtitle; - 'de-DE'?: Subtitle; - 'ar-ME'?: Subtitle; - 'ar-SA'?: Subtitle; - 'it-IT'?: Subtitle; - 'ru-RU'?: Subtitle; - 'tr-TR'?: Subtitle; - 'hi-IN'?: Subtitle; - 'zh-CN'?: Subtitle; - 'ko-KR'?: Subtitle; - 'ja-JP'?: Subtitle; + '': Subtitle; + 'en-US'?: Subtitle; + 'es-LA'?: Subtitle; + 'es-419'?: Subtitle; + 'es-ES'?: Subtitle; + 'pt-BR'?: Subtitle; + 'fr-FR'?: Subtitle; + 'de-DE'?: Subtitle; + 'ar-ME'?: Subtitle; + 'ar-SA'?: Subtitle; + 'it-IT'?: Subtitle; + 'ru-RU'?: Subtitle; + 'tr-TR'?: Subtitle; + 'hi-IN'?: Subtitle; + 'zh-CN'?: Subtitle; + 'ko-KR'?: Subtitle; + 'ja-JP'?: Subtitle; } export interface Links { - resource: Resource; + resource: Resource; } export interface Resource { - href: string; + href: string; } export interface Streams { - [key: string]: { [key: string]: Download }; + [key: string]: { [key: string]: Download }; } export interface Download { - hardsub_locale: Locale; - hardsub_lang?: string; - url: string; + hardsub_locale: Locale; + hardsub_lang?: string; + url: string; } export interface Urls { - '': Download; + '': Download; } export interface Subtitle { - locale: Locale; - url: string; - format: string; + locale: Locale; + url: string; + format: string; } export interface Version { - audio_locale: Locale; - guid: string; - original: boolean; - variant: string; - season_guid: string; - media_guid: string; - is_premium_only: boolean; + audio_locale: Locale; + guid: string; + original: boolean; + variant: string; + season_guid: string; + media_guid: string; + is_premium_only: boolean; } export enum Locale { - default = '', - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + default = '', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } \ No newline at end of file diff --git a/@types/crunchyEpisodeList.d.ts b/@types/crunchyEpisodeList.d.ts index 2f57ca4..8a573fd 100644 --- a/@types/crunchyEpisodeList.d.ts +++ b/@types/crunchyEpisodeList.d.ts @@ -1,134 +1,134 @@ import { Links } from './crunchyAndroidEpisodes'; export interface CrunchyEpisodeList { - total: number; - data: CrunchyEpisode[]; - meta: Meta; + total: number; + data: CrunchyEpisode[]; + meta: Meta; } export interface CrunchyEpisode { - next_episode_id: string; - series_id: string; - season_number: number; - next_episode_title: string; - availability_notes: string; - duration_ms: number; - series_slug_title: string; - series_title: string; - is_dubbed: boolean; - versions: Version[] | null; - identifier: string; - sequence_number: number; - eligible_region: Record; - availability_starts: Date; - images: Images; - season_id: string; - seo_title: string; - is_premium_only: boolean; - extended_maturity_rating: Record; - title: string; - production_episode_id: string; - premium_available_date: Date; - season_title: string; - seo_description: string; - audio_locale: Locale; - id: string; - media_type: MediaType; - availability_ends: Date; - free_available_date: Date; - playback: string; - channel_id: ChannelID; - episode: string; - is_mature: boolean; - listing_id: string; - episode_air_date: Date; - slug: string; - available_date: Date; - subtitle_locales: Locale[]; - slug_title: string; - available_offline: boolean; - description: string; - is_subbed: boolean; - premium_date: Date; - upload_date: Date; - season_slug_title: string; - closed_captions_available: boolean; - episode_number: number; - season_tags: any[]; - maturity_ratings: MaturityRating[]; - streams_link?: string; - mature_blocked: boolean; - is_clip: boolean; - hd_flag: boolean; - hide_season_title?: boolean; - hide_season_number?: boolean; - isSelected?: boolean; - seq_id: string; - __links__?: Links; + next_episode_id: string; + series_id: string; + season_number: number; + next_episode_title: string; + availability_notes: string; + duration_ms: number; + series_slug_title: string; + series_title: string; + is_dubbed: boolean; + versions: Version[] | null; + identifier: string; + sequence_number: number; + eligible_region: Record; + availability_starts: Date; + images: Images; + season_id: string; + seo_title: string; + is_premium_only: boolean; + extended_maturity_rating: Record; + title: string; + production_episode_id: string; + premium_available_date: Date; + season_title: string; + seo_description: string; + audio_locale: Locale; + id: string; + media_type: MediaType; + availability_ends: Date; + free_available_date: Date; + playback: string; + channel_id: ChannelID; + episode: string; + is_mature: boolean; + listing_id: string; + episode_air_date: Date; + slug: string; + available_date: Date; + subtitle_locales: Locale[]; + slug_title: string; + available_offline: boolean; + description: string; + is_subbed: boolean; + premium_date: Date; + upload_date: Date; + season_slug_title: string; + closed_captions_available: boolean; + episode_number: number; + season_tags: any[]; + maturity_ratings: MaturityRating[]; + streams_link?: string; + mature_blocked: boolean; + is_clip: boolean; + hd_flag: boolean; + hide_season_title?: boolean; + hide_season_number?: boolean; + isSelected?: boolean; + seq_id: string; + __links__?: Links; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } export enum ChannelID { - Crunchyroll = 'crunchyroll', + Crunchyroll = 'crunchyroll', } export interface Images { - poster_tall?: Array; - poster_wide?: Array; - promo_image?: Array; - thumbnail?: Array; + poster_tall?: Array; + poster_wide?: Array; + promo_image?: Array; + thumbnail?: Array; } export interface Image { - height: number; - source: string; - type: ImageType; - width: number; + height: number; + source: string; + type: ImageType; + width: number; } export enum ImageType { - PosterTall = 'poster_tall', - PosterWide = 'poster_wide', - PromoImage = 'promo_image', - Thumbnail = 'thumbnail', + PosterTall = 'poster_tall', + PosterWide = 'poster_wide', + PromoImage = 'promo_image', + Thumbnail = 'thumbnail', } export enum MaturityRating { - Tv14 = 'TV-14', + Tv14 = 'TV-14', } export enum MediaType { - Episode = 'episode', + Episode = 'episode', } export interface Version { - audio_locale: Locale; - guid: string; - is_premium_only: boolean; - media_guid: string; - original: boolean; - season_guid: string; - variant: string; + audio_locale: Locale; + guid: string; + is_premium_only: boolean; + media_guid: string; + original: boolean; + season_guid: string; + variant: string; } export interface Meta { - versions_considered?: boolean; + versions_considered?: boolean; } \ No newline at end of file diff --git a/@types/crunchySearch.d.ts b/@types/crunchySearch.d.ts index 09ade69..9a61e7d 100644 --- a/@types/crunchySearch.d.ts +++ b/@types/crunchySearch.d.ts @@ -1,183 +1,183 @@ // Generated by https://quicktype.io export interface CrunchySearch { - total: number; - data: CrunchySearchData[]; - meta: Record; + total: number; + data: CrunchySearchData[]; + meta: Record; } export interface CrunchySearchData { - type: string; - count: number; - items: CrunchySearchItem[]; + type: string; + count: number; + items: CrunchySearchItem[]; } export interface CrunchySearchItem { - title: string; - images: Images; - series_metadata?: SeriesMetadata; - promo_description: string; - external_id: string; - slug: string; - new: boolean; - slug_title: string; - channel_id: ChannelID; - description: string; - linked_resource_key: string; - type: ItemType; - id: string; - promo_title: string; - search_metadata: SearchMetadata; - movie_listing_metadata?: MovieListingMetadata; - playback?: string; - streams_link?: string; - episode_metadata?: EpisodeMetadata; + title: string; + images: Images; + series_metadata?: SeriesMetadata; + promo_description: string; + external_id: string; + slug: string; + new: boolean; + slug_title: string; + channel_id: ChannelID; + description: string; + linked_resource_key: string; + type: ItemType; + id: string; + promo_title: string; + search_metadata: SearchMetadata; + movie_listing_metadata?: MovieListingMetadata; + playback?: string; + streams_link?: string; + episode_metadata?: EpisodeMetadata; } export enum ChannelID { - Crunchyroll = 'crunchyroll', + Crunchyroll = 'crunchyroll', } export interface EpisodeMetadata { - audio_locale: Locale; - availability_ends: Date; - availability_notes: string; - availability_starts: Date; - available_date: null; - available_offline: boolean; - closed_captions_available: boolean; - duration_ms: number; - eligible_region: string[]; - episode: string; - episode_air_date: Date; - episode_number: number; - extended_maturity_rating: Record; - free_available_date: Date; - identifier: string; - is_clip: boolean; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: MaturityRating[]; - premium_available_date: Date; - premium_date: null; - season_id: string; - season_number: number; - season_slug_title: string; - season_title: string; - sequence_number: number; - series_id: string; - series_slug_title: string; - series_title: string; - subtitle_locales: Locale[]; - upload_date: Date; - versions: Version[] | null; - tenant_categories?: string[]; + audio_locale: Locale; + availability_ends: Date; + availability_notes: string; + availability_starts: Date; + available_date: null; + available_offline: boolean; + closed_captions_available: boolean; + duration_ms: number; + eligible_region: string[]; + episode: string; + episode_air_date: Date; + episode_number: number; + extended_maturity_rating: Record; + free_available_date: Date; + identifier: string; + is_clip: boolean; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: MaturityRating[]; + premium_available_date: Date; + premium_date: null; + season_id: string; + season_number: number; + season_slug_title: string; + season_title: string; + sequence_number: number; + series_id: string; + series_slug_title: string; + series_title: string; + subtitle_locales: Locale[]; + upload_date: Date; + versions: Version[] | null; + tenant_categories?: string[]; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } export enum MaturityRating { - Tv14 = 'TV-14', - TvMa = 'TV-MA', + Tv14 = 'TV-14', + TvMa = 'TV-MA', } export interface Version { - audio_locale: Locale; - guid: string; - is_premium_only: boolean; - media_guid: string; - original: boolean; - season_guid: string; - variant: string; + audio_locale: Locale; + guid: string; + is_premium_only: boolean; + media_guid: string; + original: boolean; + season_guid: string; + variant: string; } export interface Images { - poster_tall?: Array; - poster_wide?: Array; - promo_image?: Array; - thumbnail?: Array; + poster_tall?: Array; + poster_wide?: Array; + promo_image?: Array; + thumbnail?: Array; } export interface Image { - height: number; - source: string; - type: ImageType; - width: number; + height: number; + source: string; + type: ImageType; + width: number; } export enum ImageType { - PosterTall = 'poster_tall', - PosterWide = 'poster_wide', - PromoImage = 'promo_image', - Thumbnail = 'thumbnail', + PosterTall = 'poster_tall', + PosterWide = 'poster_wide', + PromoImage = 'promo_image', + Thumbnail = 'thumbnail', } export interface MovieListingMetadata { - availability_notes: string; - available_date: null; - available_offline: boolean; - duration_ms: number; - extended_description: string; - extended_maturity_rating: Record; - first_movie_id: string; - free_available_date: Date; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - movie_release_year: number; - premium_available_date: Date; - premium_date: null; - subtitle_locales: any[]; - tenant_categories: string[]; + availability_notes: string; + available_date: null; + available_offline: boolean; + duration_ms: number; + extended_description: string; + extended_maturity_rating: Record; + first_movie_id: string; + free_available_date: Date; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + movie_release_year: number; + premium_available_date: Date; + premium_date: null; + subtitle_locales: any[]; + tenant_categories: string[]; } export interface SearchMetadata { - score: number; + score: number; } export interface SeriesMetadata { - audio_locales: Locale[]; - availability_notes: string; - episode_count: number; - extended_description: string; - extended_maturity_rating: Record; - is_dubbed: boolean; - is_mature: boolean; - is_simulcast: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: MaturityRating[]; - season_count: number; - series_launch_year: number; - subtitle_locales: Locale[]; - tenant_categories?: string[]; + audio_locales: Locale[]; + availability_notes: string; + episode_count: number; + extended_description: string; + extended_maturity_rating: Record; + is_dubbed: boolean; + is_mature: boolean; + is_simulcast: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: MaturityRating[]; + season_count: number; + series_launch_year: number; + subtitle_locales: Locale[]; + tenant_categories?: string[]; } export enum ItemType { - Episode = 'episode', - MovieListing = 'movie_listing', - Series = 'series', + Episode = 'episode', + MovieListing = 'movie_listing', + Series = 'series', } \ No newline at end of file diff --git a/@types/crunchyTypes.d.ts b/@types/crunchyTypes.d.ts index 0aa8960..a84d861 100644 --- a/@types/crunchyTypes.d.ts +++ b/@types/crunchyTypes.d.ts @@ -5,211 +5,211 @@ import { DownloadInfo } from './messageHandler'; import { CrunchyVideoPlayStreams, CrunchyAudioPlayStreams } from './enums'; export type CrunchyDownloadOptions = { - hslang: string, - // kstream: number, - cstream: keyof typeof CrunchyVideoPlayStreams, - vstream: keyof typeof CrunchyVideoPlayStreams, - astream: keyof typeof CrunchyAudioPlayStreams, - tsd?: boolean, - novids?: boolean, - noaudio?: boolean, - x: number, - q: number, - fileName: string, - numbers: number, - partsize: number, - callbackMaker?: (data: DownloadInfo) => HLSCallback, - timeout: number, - waittime: number, - fsRetryTime: number, - dlsubs: string[], - skipsubs: boolean, - nosubs?: boolean, - mp4: boolean, - override: string[], - videoTitle: string, - force: 'Y'|'y'|'N'|'n'|'C'|'c', - ffmpegOptions: string[], - mkvmergeOptions: string[], - defaultSub: LanguageItem, - defaultAudio: LanguageItem, - ccTag: string, - dlVideoOnce: boolean, - skipmux?: boolean, - syncTiming: boolean, - nocleanup: boolean, - chapters: boolean, - fontName: string | undefined, - originalFontSize: boolean, - fontSize: number, - dubLang: string[], + hslang: string, + // kstream: number, + cstream: keyof typeof CrunchyVideoPlayStreams, + vstream: keyof typeof CrunchyVideoPlayStreams, + astream: keyof typeof CrunchyAudioPlayStreams, + tsd?: boolean, + novids?: boolean, + noaudio?: boolean, + x: number, + q: number, + fileName: string, + numbers: number, + partsize: number, + callbackMaker?: (data: DownloadInfo) => HLSCallback, + timeout: number, + waittime: number, + fsRetryTime: number, + dlsubs: string[], + skipsubs: boolean, + nosubs?: boolean, + mp4: boolean, + override: string[], + videoTitle: string, + force: 'Y'|'y'|'N'|'n'|'C'|'c', + ffmpegOptions: string[], + mkvmergeOptions: string[], + defaultSub: LanguageItem, + defaultAudio: LanguageItem, + ccTag: string, + dlVideoOnce: boolean, + skipmux?: boolean, + syncTiming: boolean, + nocleanup: boolean, + chapters: boolean, + fontName: string | undefined, + originalFontSize: boolean, + fontSize: number, + dubLang: string[], } export type CrunchyMultiDownload = { - absolute?: boolean, - dubLang: string[], - all?: boolean, - but?: boolean, - e?: string, - s?: string + absolute?: boolean, + dubLang: string[], + all?: boolean, + but?: boolean, + e?: string, + s?: string } export type CrunchyMuxOptions = { - output: string, - skipSubMux?: boolean - keepAllVideos?: bolean - novids?: boolean, - mp4: boolean, - forceMuxer?: 'ffmpeg'|'mkvmerge', - nocleanup?: boolean, - videoTitle: string, - ffmpegOptions: string[], - mkvmergeOptions: string[], - defaultSub: LanguageItem, - defaultAudio: LanguageItem, - ccTag: string, - syncTiming: boolean, + output: string, + skipSubMux?: boolean + keepAllVideos?: bolean + novids?: boolean, + mp4: boolean, + forceMuxer?: 'ffmpeg'|'mkvmerge', + nocleanup?: boolean, + videoTitle: string, + ffmpegOptions: string[], + mkvmergeOptions: string[], + defaultSub: LanguageItem, + defaultAudio: LanguageItem, + ccTag: string, + syncTiming: boolean, } export type CrunchyEpMeta = { - data: { - mediaId: string, - lang?: LanguageItem, - playback?: string, - versions?: EpisodeVersion[] | null, - isSubbed: boolean, - isDubbed: boolean, - }[], - seriesTitle: string, - seasonTitle: string, - episodeNumber: string, - episodeTitle: string, - seasonID: string, - season: number, - showID: string, - e: string, - image: string, + data: { + mediaId: string, + lang?: LanguageItem, + playback?: string, + versions?: EpisodeVersion[] | null, + isSubbed: boolean, + isDubbed: boolean, + }[], + seriesTitle: string, + seasonTitle: string, + episodeNumber: string, + episodeTitle: string, + seasonID: string, + season: number, + showID: string, + e: string, + image: string, } export type DownloadedMedia = { - type: 'Video', - lang: LanguageItem, - path: string, - isPrimary?: boolean + type: 'Video', + lang: LanguageItem, + path: string, + isPrimary?: boolean } | { - type: 'Audio', - lang: LanguageItem, - path: string, - isPrimary?: boolean + type: 'Audio', + lang: LanguageItem, + path: string, + isPrimary?: boolean } | { - type: 'Chapters', - lang: LanguageItem, - path: string + type: 'Chapters', + lang: LanguageItem, + path: string } | ({ - type: 'Subtitle', - signs: boolean, - cc: boolean + type: 'Subtitle', + signs: boolean, + cc: boolean } & sxItem ) export type ParseItem = { - __class__?: string; - isSelected?: boolean, - type?: string, - id: string, - title: string, - playback?: string, - season_number?: number|string, - episode_number?: number|string, - season_count?: number|string, - is_premium_only?: boolean, - hide_metadata?: boolean, - seq_id?: string, - f_num?: string, - s_num?: string - external_id?: string, - ep_num?: string - last_public?: string, - subtitle_locales?: string[], - availability_notes?: string, - identifier?: string, - versions?: Version[] | null, - media_type?: string | null, - movie_release_year?: number | null, + __class__?: string; + isSelected?: boolean, + type?: string, + id: string, + title: string, + playback?: string, + season_number?: number|string, + episode_number?: number|string, + season_count?: number|string, + is_premium_only?: boolean, + hide_metadata?: boolean, + seq_id?: string, + f_num?: string, + s_num?: string + external_id?: string, + ep_num?: string + last_public?: string, + subtitle_locales?: string[], + availability_notes?: string, + identifier?: string, + versions?: Version[] | null, + media_type?: string | null, + movie_release_year?: number | null, } export interface SeriesSearch { - total: number; - data: SeriesSearchItem[]; - meta: Meta; + total: number; + data: SeriesSearchItem[]; + meta: Meta; } export interface SeriesSearchItem { - description: string; - seo_description: string; - number_of_episodes: number; - is_dubbed: boolean; - identifier: string; - channel_id: string; - slug_title: string; - season_sequence_number: number; - season_tags: string[]; - extended_maturity_rating: Record; - is_mature: boolean; - audio_locale: string; - season_number: number; - images: Record; - mature_blocked: boolean; - versions: Version[]; - title: string; - is_subbed: boolean; - id: string; - audio_locales: string[]; - subtitle_locales: string[]; - availability_notes: string; - series_id: string; - season_display_number: string; - is_complete: boolean; - keywords: any[]; - maturity_ratings: string[]; - is_simulcast: boolean; - seo_title: string; + description: string; + seo_description: string; + number_of_episodes: number; + is_dubbed: boolean; + identifier: string; + channel_id: string; + slug_title: string; + season_sequence_number: number; + season_tags: string[]; + extended_maturity_rating: Record; + is_mature: boolean; + audio_locale: string; + season_number: number; + images: Record; + mature_blocked: boolean; + versions: Version[]; + title: string; + is_subbed: boolean; + id: string; + audio_locales: string[]; + subtitle_locales: string[]; + availability_notes: string; + series_id: string; + season_display_number: string; + is_complete: boolean; + keywords: any[]; + maturity_ratings: string[]; + is_simulcast: boolean; + seo_title: string; } export interface Version { - audio_locale: Locale; - guid: string; - original: boolean; - variant: string; + audio_locale: Locale; + guid: string; + original: boolean; + variant: string; } export interface EpisodeVersion { - audio_locale: Locale; - guid: string; - is_premium_only: boolean; - media_guid: string; - original: boolean; - season_guid: string; - variant: string; + audio_locale: Locale; + guid: string; + is_premium_only: boolean; + media_guid: string; + original: boolean; + season_guid: string; + variant: string; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } export interface Meta { - versions_considered: boolean; + versions_considered: boolean; } diff --git a/@types/downloadedFile.d.ts b/@types/downloadedFile.d.ts index 9627b0c..a4240a5 100644 --- a/@types/downloadedFile.d.ts +++ b/@types/downloadedFile.d.ts @@ -1,6 +1,6 @@ import { LanguageItem } from '../modules/module.langsData'; export type DownloadedFile = { - path: string, - lang: LanguageItem + path: string, + lang: LanguageItem } \ No newline at end of file diff --git a/@types/enums.ts b/@types/enums.ts index 310b510..31f337e 100644 --- a/@types/enums.ts +++ b/@types/enums.ts @@ -1,11 +1,11 @@ export enum CrunchyVideoPlayStreams { - 'androidtv' = 'tv/android_tv', - 'android' = 'android/phone', - 'androidtab'= 'android/tablet' + 'androidtv' = 'tv/android_tv', + 'android' = 'android/phone', + 'androidtab'= 'android/tablet' } export enum CrunchyAudioPlayStreams { - 'androidtv' = 'tv/android_tv', - 'android' = 'android/phone', - 'androidtab'= 'android/tablet' + 'androidtv' = 'tv/android_tv', + 'android' = 'android/phone', + 'androidtab'= 'android/tablet' } \ No newline at end of file diff --git a/@types/hidiveDashboard.d.ts b/@types/hidiveDashboard.d.ts index ec78de2..e6fab33 100644 --- a/@types/hidiveDashboard.d.ts +++ b/@types/hidiveDashboard.d.ts @@ -1,70 +1,70 @@ export interface HidiveDashboard { - Code: number; - Status: string; - Message: null; - Messages: object; - Data: Data; - Timestamp: string; - IPAddress: string; + Code: number; + Status: string; + Message: null; + Messages: object; + Data: Data; + Timestamp: string; + IPAddress: string; } export interface Data { - TitleRows: TitleRow[]; - LoadTime: number; + TitleRows: TitleRow[]; + LoadTime: number; } export interface TitleRow { - Name: string; - Titles: Title[]; - LoadTime: number; + Name: string; + Titles: Title[]; + LoadTime: number; } export interface Title { - Id: number; - Name: string; - ShortSynopsis: string; - MediumSynopsis: string; - LongSynopsis: string; - KeyArtUrl: string; - MasterArtUrl: string; - Rating: null | string; - OverallRating: number; - RatingCount: number; - MALScore: null; - UserRating: number; - RunTime: number | null; - ShowInfoTitle: string; - FirstPremiereDate: Date; - EpisodeCount: number; - SeasonName: string; - RokuHDArtUrl: string; - RokuSDArtUrl: string; - IsRateable: boolean; - InQueue: boolean; - IsFavorite: boolean; - IsContinueWatching: boolean; - ContinueWatching: ContinueWatching; - Episodes: any[]; - LoadTime: number; + Id: number; + Name: string; + ShortSynopsis: string; + MediumSynopsis: string; + LongSynopsis: string; + KeyArtUrl: string; + MasterArtUrl: string; + Rating: null | string; + OverallRating: number; + RatingCount: number; + MALScore: null; + UserRating: number; + RunTime: number | null; + ShowInfoTitle: string; + FirstPremiereDate: Date; + EpisodeCount: number; + SeasonName: string; + RokuHDArtUrl: string; + RokuSDArtUrl: string; + IsRateable: boolean; + InQueue: boolean; + IsFavorite: boolean; + IsContinueWatching: boolean; + ContinueWatching: ContinueWatching; + Episodes: any[]; + LoadTime: number; } export interface ContinueWatching { - Id: string; - ProfileId: number; - EpisodeId: number; - Status: Status | null; - CurrentTime: number; - UserId: number; - TitleId: number; - SeasonId: number; - VideoId: number; - TotalSeconds: number; - CreatedDT: Date; - ModifiedDT: Date | null; + Id: string; + ProfileId: number; + EpisodeId: number; + Status: Status | null; + CurrentTime: number; + UserId: number; + TitleId: number; + SeasonId: number; + VideoId: number; + TotalSeconds: number; + CreatedDT: Date; + ModifiedDT: Date | null; } export enum Status { - Paused = 'Paused', - Playing = 'Playing', - Watching = 'Watching', + Paused = 'Paused', + Playing = 'Playing', + Watching = 'Watching', } \ No newline at end of file diff --git a/@types/hidiveEpisodeList.d.ts b/@types/hidiveEpisodeList.d.ts index ce35e8e..b6de9ec 100644 --- a/@types/hidiveEpisodeList.d.ts +++ b/@types/hidiveEpisodeList.d.ts @@ -1,84 +1,84 @@ export interface HidiveEpisodeList { - Code: number; - Status: string; - Message: null; - Messages: Record; - Data: Data; - Timestamp: string; - IPAddress: string; + Code: number; + Status: string; + Message: null; + Messages: Record; + Data: Data; + Timestamp: string; + IPAddress: string; } export interface Data { - Title: HidiveTitle; + Title: HidiveTitle; } export interface HidiveTitle { - Id: number; - Name: string; - ShortSynopsis: string; - MediumSynopsis: string; - LongSynopsis: string; - KeyArtUrl: string; - MasterArtUrl: string; - Rating: string; - OverallRating: number; - RatingCount: number; - MALScore: null; - UserRating: number; - RunTime: number; - ShowInfoTitle: string; - FirstPremiereDate: Date; - EpisodeCount: number; - SeasonName: string; - RokuHDArtUrl: string; - RokuSDArtUrl: string; - IsRateable: boolean; - InQueue: boolean; - IsFavorite: boolean; - IsContinueWatching: boolean; - ContinueWatching: ContinueWatching; - Episodes: HidiveEpisode[]; - LoadTime: number; + Id: number; + Name: string; + ShortSynopsis: string; + MediumSynopsis: string; + LongSynopsis: string; + KeyArtUrl: string; + MasterArtUrl: string; + Rating: string; + OverallRating: number; + RatingCount: number; + MALScore: null; + UserRating: number; + RunTime: number; + ShowInfoTitle: string; + FirstPremiereDate: Date; + EpisodeCount: number; + SeasonName: string; + RokuHDArtUrl: string; + RokuSDArtUrl: string; + IsRateable: boolean; + InQueue: boolean; + IsFavorite: boolean; + IsContinueWatching: boolean; + ContinueWatching: ContinueWatching; + Episodes: HidiveEpisode[]; + LoadTime: number; } export interface ContinueWatching { - Id: string; - ProfileId: number; - EpisodeId: number; - Status: string; - CurrentTime: number; - UserId: number; - TitleId: number; - SeasonId: number; - VideoId: number; - TotalSeconds: number; - CreatedDT: Date; - ModifiedDT: Date; + Id: string; + ProfileId: number; + EpisodeId: number; + Status: string; + CurrentTime: number; + UserId: number; + TitleId: number; + SeasonId: number; + VideoId: number; + TotalSeconds: number; + CreatedDT: Date; + ModifiedDT: Date; } export interface HidiveEpisode { - Id: number; - Number: number; - Name: string; - Summary: string; - HIDIVEPremiereDate: Date; - ScreenShotSmallUrl: string; - ScreenShotCompressedUrl: string; - SeasonNumber: number; - TitleId: number; - SeasonNumberValue: number; - EpisodeNumberValue: number; - VideoKey: string; - DisplayNameLong: string; - PercentProgress: number; - LoadTime: number; + Id: number; + Number: number; + Name: string; + Summary: string; + HIDIVEPremiereDate: Date; + ScreenShotSmallUrl: string; + ScreenShotCompressedUrl: string; + SeasonNumber: number; + TitleId: number; + SeasonNumberValue: number; + EpisodeNumberValue: number; + VideoKey: string; + DisplayNameLong: string; + PercentProgress: number; + LoadTime: number; } export interface HidiveEpisodeExtra extends HidiveEpisode { - titleId: number; - epKey: string; - nameLong: string; - seriesTitle: string; - seriesId?: number; - isSelected: boolean; + titleId: number; + epKey: string; + nameLong: string; + seriesTitle: string; + seriesId?: number; + isSelected: boolean; } \ No newline at end of file diff --git a/@types/hidiveSearch.d.ts b/@types/hidiveSearch.d.ts index 2a6af57..32186d0 100644 --- a/@types/hidiveSearch.d.ts +++ b/@types/hidiveSearch.d.ts @@ -1,47 +1,47 @@ export interface HidiveSearch { - Code: number; - Status: string; - Message: null; - Messages: Record; - Data: HidiveSearchData; - Timestamp: string; - IPAddress: string; + Code: number; + Status: string; + Message: null; + Messages: Record; + Data: HidiveSearchData; + Timestamp: string; + IPAddress: string; } export interface HidiveSearchData { - Query: string; - Slug: string; - TitleResults: HidiveSearchItem[]; - SearchId: number; - IsSearchPinned: boolean; - IsPinnedSearchAvailable: boolean; + Query: string; + Slug: string; + TitleResults: HidiveSearchItem[]; + SearchId: number; + IsSearchPinned: boolean; + IsPinnedSearchAvailable: boolean; } export interface HidiveSearchItem { - Id: number; - Name: string; - ShortSynopsis: string; - MediumSynopsis: string; - LongSynopsis: string; - KeyArtUrl: string; - MasterArtUrl: string; - Rating: string; - OverallRating: number; - RatingCount: number; - MALScore: null; - UserRating: number; - RunTime: number | null; - ShowInfoTitle: string; - FirstPremiereDate: Date; - EpisodeCount: number; - SeasonName: string; - RokuHDArtUrl: string; - RokuSDArtUrl: string; - IsRateable: boolean; - InQueue: boolean; - IsFavorite: boolean; - IsContinueWatching: boolean; - ContinueWatching: null; - Episodes: any[]; - LoadTime: number; + Id: number; + Name: string; + ShortSynopsis: string; + MediumSynopsis: string; + LongSynopsis: string; + KeyArtUrl: string; + MasterArtUrl: string; + Rating: string; + OverallRating: number; + RatingCount: number; + MALScore: null; + UserRating: number; + RunTime: number | null; + ShowInfoTitle: string; + FirstPremiereDate: Date; + EpisodeCount: number; + SeasonName: string; + RokuHDArtUrl: string; + RokuSDArtUrl: string; + IsRateable: boolean; + InQueue: boolean; + IsFavorite: boolean; + IsContinueWatching: boolean; + ContinueWatching: null; + Episodes: any[]; + LoadTime: number; } \ No newline at end of file diff --git a/@types/hidiveTypes.d.ts b/@types/hidiveTypes.d.ts index 858c40d..4eca332 100644 --- a/@types/hidiveTypes.d.ts +++ b/@types/hidiveTypes.d.ts @@ -1,61 +1,61 @@ export interface HidiveVideoList { - Code: number; - Status: string; - Message: null; - Messages: Record; - Data: HidiveVideo; - Timestamp: string; - IPAddress: string; + Code: number; + Status: string; + Message: null; + Messages: Record; + Data: HidiveVideo; + Timestamp: string; + IPAddress: string; } export interface HidiveVideo { - ShowAds: boolean; - CaptionCssUrl: string; - FontSize: number; - FontScale: number; - CaptionLanguages: string[]; - CaptionLanguage: string; - CaptionVttUrls: Record; - VideoLanguages: string[]; - VideoLanguage: string; - VideoUrls: Record; - FontColorName: string; - AutoPlayNextEpisode: boolean; - MaxStreams: number; - CurrentTime: number; - FontColorCode: string; - RunTime: number; - AdUrl: null; + ShowAds: boolean; + CaptionCssUrl: string; + FontSize: number; + FontScale: number; + CaptionLanguages: string[]; + CaptionLanguage: string; + CaptionVttUrls: Record; + VideoLanguages: string[]; + VideoLanguage: string; + VideoUrls: Record; + FontColorName: string; + AutoPlayNextEpisode: boolean; + MaxStreams: number; + CurrentTime: number; + FontColorCode: string; + RunTime: number; + AdUrl: null; } export interface HidiveStreamList { - hls: string[]; - drm: string[]; - drmEnabled: boolean; + hls: string[]; + drm: string[]; + drmEnabled: boolean; } export interface HidiveStreamInfo extends HidiveStreamList { - language?: string; - episodeTitle?: string; - seriesTitle?: string; - season?: number; - episodeNumber?: number; - uncut?: boolean; - image?: string; + language?: string; + episodeTitle?: string; + seriesTitle?: string; + season?: number; + episodeNumber?: number; + uncut?: boolean; + image?: string; } export interface HidiveSubtitleInfo { - language: string; - cc: boolean; - url: string; + language: string; + cc: boolean; + url: string; } export type DownloadedMedia = { - type: 'Video', - lang: LanguageItem, - path: string, - uncut: boolean + type: 'Video', + lang: LanguageItem, + path: string, + uncut: boolean } | ({ - type: 'Subtitle', - cc: boolean + type: 'Subtitle', + cc: boolean } & sxItem ) \ No newline at end of file diff --git a/@types/iso639.d.ts b/@types/iso639.d.ts index 57f0f24..39ef820 100644 --- a/@types/iso639.d.ts +++ b/@types/iso639.d.ts @@ -1,9 +1,9 @@ declare module 'iso-639' { - export type iso639Type = { - [key: string]: { - '639-1'?: string, - '639-2'?: string - } - } - export const iso_639_2: iso639Type; + export type iso639Type = { + [key: string]: { + '639-1'?: string, + '639-2'?: string + } + } + export const iso_639_2: iso639Type; } \ No newline at end of file diff --git a/@types/items.d.ts b/@types/items.d.ts index cc3ae6e..548d17f 100644 --- a/@types/items.d.ts +++ b/@types/items.d.ts @@ -1,169 +1,169 @@ export interface Item { - // Added later - id: string, - id_split: (number|string)[] - // Added from the start - mostRecentSvodJpnUs: MostRecentSvodJpnUs; - synopsis: string; - mediaCategory: ContentType; - mostRecentSvodUsEndTimestamp: number; - quality: QualityClass; - genres: Genre[]; - titleImages: TitleImages; - engAllTerritoryAvail: EngAllTerritoryAvail; - thumb: string; - mostRecentSvodJpnAllTerrStartTimestamp: number; - title: string; - starRating: number; - primaryAvail: PrimaryAvail; - access: Access[]; - version: Version[]; - mostRecentSvodJpnAllTerrEndTimestamp: number; - itemId: number; - versionAudio: VersionAudio; - contentType: ContentType; - mostRecentSvodUsStartTimestamp: number; - poster: string; - mostRecentSvodEngAllTerrEndTimestamp: number; - mostRecentSvodJpnUsStartTimestamp: number; - mostRecentSvodJpnUsEndTimestamp: number; - mostRecentSvodStartTimestamp: number; - mostRecentSvod: MostRecent; - altAvail: AltAvail; - ids: IDs; - mostRecentSvodUs: MostRecent; - item: Item; - mostRecentSvodEngAllTerrStartTimestamp: number; - audio: string[]; - mostRecentAvod: MostRecent; + // Added later + id: string, + id_split: (number|string)[] + // Added from the start + mostRecentSvodJpnUs: MostRecentSvodJpnUs; + synopsis: string; + mediaCategory: ContentType; + mostRecentSvodUsEndTimestamp: number; + quality: QualityClass; + genres: Genre[]; + titleImages: TitleImages; + engAllTerritoryAvail: EngAllTerritoryAvail; + thumb: string; + mostRecentSvodJpnAllTerrStartTimestamp: number; + title: string; + starRating: number; + primaryAvail: PrimaryAvail; + access: Access[]; + version: Version[]; + mostRecentSvodJpnAllTerrEndTimestamp: number; + itemId: number; + versionAudio: VersionAudio; + contentType: ContentType; + mostRecentSvodUsStartTimestamp: number; + poster: string; + mostRecentSvodEngAllTerrEndTimestamp: number; + mostRecentSvodJpnUsStartTimestamp: number; + mostRecentSvodJpnUsEndTimestamp: number; + mostRecentSvodStartTimestamp: number; + mostRecentSvod: MostRecent; + altAvail: AltAvail; + ids: IDs; + mostRecentSvodUs: MostRecent; + item: Item; + mostRecentSvodEngAllTerrStartTimestamp: number; + audio: string[]; + mostRecentAvod: MostRecent; } export enum ContentType { - Episode = 'episode', - Ova = 'ova', + Episode = 'episode', + Ova = 'ova', } export interface IDs { - externalShowId: ID; - externalSeasonId: ExternalSeasonID; - externalEpisodeId: string; - externalAsianId?: string + externalShowId: ID; + externalSeasonId: ExternalSeasonID; + externalEpisodeId: string; + externalAsianId?: string } export interface Item { - seasonTitle: string; - seasonId: number; - episodeOrder: number; - episodeSlug: string; - created: Date; - titleSlug: string; - episodeNum: string; - episodeId: number; - titleId: number; - seasonNum: string; - ratings: Array; - showImage: string; - titleName: string; - runtime: string; - episodeName: string; - seasonOrder: number; - titleExternalId: string; + seasonTitle: string; + seasonId: number; + episodeOrder: number; + episodeSlug: string; + created: Date; + titleSlug: string; + episodeNum: string; + episodeId: number; + titleId: number; + seasonNum: string; + ratings: Array; + showImage: string; + titleName: string; + runtime: string; + episodeName: string; + seasonOrder: number; + titleExternalId: string; } export interface MostRecent { - image?: string; - siblingStartTimestamp?: string; - devices?: Device[]; - availId?: number; - distributor?: Distributor; - quality?: MostRecentAvodQuality; - endTimestamp?: string; - mediaCategory?: ContentType; - isPromo?: boolean; - siblingType?: Purchase; - version?: Version; - territory?: Territory; - startDate?: Date; - endDate?: Date; - versionId?: number; - tier?: Device | null; - purchase?: Purchase; - startTimestamp?: string; - language?: Audio; - itemTitle?: string; - ids?: MostRecentAvodIDS; - experience?: number; - siblingEndTimestamp?: string; - item?: Item; - subscriptionRequired?: boolean; - purchased?: boolean; + image?: string; + siblingStartTimestamp?: string; + devices?: Device[]; + availId?: number; + distributor?: Distributor; + quality?: MostRecentAvodQuality; + endTimestamp?: string; + mediaCategory?: ContentType; + isPromo?: boolean; + siblingType?: Purchase; + version?: Version; + territory?: Territory; + startDate?: Date; + endDate?: Date; + versionId?: number; + tier?: Device | null; + purchase?: Purchase; + startTimestamp?: string; + language?: Audio; + itemTitle?: string; + ids?: MostRecentAvodIDS; + experience?: number; + siblingEndTimestamp?: string; + item?: Item; + subscriptionRequired?: boolean; + purchased?: boolean; } export interface MostRecentAvodIDS { - externalSeasonId: ExternalSeasonID; - externalAsianId: null; - externalShowId: ID; - externalEpisodeId: string; - externalEnglishId: string; - externalAlphaId: string; + externalSeasonId: ExternalSeasonID; + externalAsianId: null; + externalShowId: ID; + externalEpisodeId: string; + externalEnglishId: string; + externalAlphaId: string; } export enum Purchase { - AVOD = 'A-VOD', - Dfov = 'DFOV', - Est = 'EST', - Svod = 'SVOD', + AVOD = 'A-VOD', + Dfov = 'DFOV', + Est = 'EST', + Svod = 'SVOD', } export enum Version { - Simulcast = 'Simulcast', - Uncut = 'Uncut', + Simulcast = 'Simulcast', + Uncut = 'Uncut', } export type MostRecentSvodJpnUs = Record export interface QualityClass { - quality: QualityQuality; - height: number; + quality: QualityQuality; + height: number; } export enum QualityQuality { - HD = 'HD', - SD = 'SD', + HD = 'HD', + SD = 'SD', } export interface TitleImages { - showThumbnail: string; - showBackgroundSite: string; - showDetailHeaderDesktop: string; - continueWatchingDesktop: string; - showDetailHeroSite: string; - appleHorizontalBannerShow: string; - backgroundImageXbox_360: string; - applePosterCover: string; - showDetailBoxArtTablet: string; - featuredShowBackgroundTablet: string; - backgroundImageAppletvfiretv: string; - newShowDetailHero: string; - showDetailHeroDesktop: string; - showKeyart: string; - continueWatchingMobile: string; - featuredSpotlightShowPhone: string; - appleHorizontalBannerMovie: string; - featuredSpotlightShowTablet: string; - showDetailBoxArtPhone: string; - featuredShowBackgroundPhone: string; - appleSquareCover: string; - backgroundVideo: string; - showMasterKeyArt: string; - newShowDetailHeroPhone: string; - showDetailBoxArtXbox_360: string; - showDetailHeaderMobile: string; - showLogo: string; + showThumbnail: string; + showBackgroundSite: string; + showDetailHeaderDesktop: string; + continueWatchingDesktop: string; + showDetailHeroSite: string; + appleHorizontalBannerShow: string; + backgroundImageXbox_360: string; + applePosterCover: string; + showDetailBoxArtTablet: string; + featuredShowBackgroundTablet: string; + backgroundImageAppletvfiretv: string; + newShowDetailHero: string; + showDetailHeroDesktop: string; + showKeyart: string; + continueWatchingMobile: string; + featuredSpotlightShowPhone: string; + appleHorizontalBannerMovie: string; + featuredSpotlightShowTablet: string; + showDetailBoxArtPhone: string; + featuredShowBackgroundPhone: string; + appleSquareCover: string; + backgroundVideo: string; + showMasterKeyArt: string; + newShowDetailHeroPhone: string; + showDetailBoxArtXbox_360: string; + showDetailHeaderMobile: string; + showLogo: string; } export interface VersionAudio { - Uncut?: Audio[]; - Simulcast: Audio[]; + Uncut?: Audio[]; + Simulcast: Audio[]; } \ No newline at end of file diff --git a/@types/m3u8-parsed.d.ts b/@types/m3u8-parsed.d.ts index 7505adf..e42d532 100644 --- a/@types/m3u8-parsed.d.ts +++ b/@types/m3u8-parsed.d.ts @@ -1,49 +1,49 @@ declare module 'm3u8-parsed' { - export type M3U8 = { - allowCache: boolean, - discontinuityStarts: [], - segments: { - duration: number, - byterange?: { - length: number, - offset: number - }, - uri: string, - key: { - method: string, - uri: string, - }, - timeline: number - }[], - version: number, - mediaGroups: { - [type: string]: { - [index: string]: { - [language: string]: { - default: boolean, - autoselect: boolean, - language: string, - uri: string - } - } - } - }, - playlists: { - uri: string, - timeline: number, - attributes: { - 'CLOSED-CAPTIONS': string, - 'AUDIO': string, - 'FRAME-RATE': number, - 'RESOLUTION': { - width: number, - height: number - }, - 'CODECS': string, - 'AVERAGE-BANDWIDTH': string, - 'BANDWIDTH': number - } - }[], - } - export default function (data: string): M3U8; + export type M3U8 = { + allowCache: boolean, + discontinuityStarts: [], + segments: { + duration: number, + byterange?: { + length: number, + offset: number + }, + uri: string, + key: { + method: string, + uri: string, + }, + timeline: number + }[], + version: number, + mediaGroups: { + [type: string]: { + [index: string]: { + [language: string]: { + default: boolean, + autoselect: boolean, + language: string, + uri: string + } + } + } + }, + playlists: { + uri: string, + timeline: number, + attributes: { + 'CLOSED-CAPTIONS': string, + 'AUDIO': string, + 'FRAME-RATE': number, + 'RESOLUTION': { + width: number, + height: number + }, + 'CODECS': string, + 'AVERAGE-BANDWIDTH': string, + 'BANDWIDTH': number + } + }[], + } + export default function (data: string): M3U8; } \ No newline at end of file diff --git a/@types/messageHandler.d.ts b/@types/messageHandler.d.ts index 7e63da4..6f16ea9 100644 --- a/@types/messageHandler.d.ts +++ b/@types/messageHandler.d.ts @@ -4,97 +4,97 @@ import type { AvailableMuxer } from '../modules/module.args'; import { LanguageItem } from '../modules/module.langsData'; export interface MessageHandler { - name: string - auth: (data: AuthData) => Promise; - version: () => Promise; - checkToken: () => Promise; - search: (data: SearchData) => Promise, - availableDubCodes: () => Promise, - availableSubCodes: () => Promise, - handleDefault: (name: string) => Promise, - resolveItems: (data: ResolveItemsData) => Promise, - listEpisodes: (id: string) => Promise, - downloadItem: (data: QueueItem) => void, - isDownloading: () => Promise, - openFolder: (path: FolderTypes) => void, - openFile: (data: [FolderTypes, string]) => void, - openURL: (data: string) => void; - getQueue: () => Promise, - removeFromQueue: (index: number) => void, - clearQueue: () => void, - setDownloadQueue: (data: boolean) => void, - getDownloadQueue: () => Promise + name: string + auth: (data: AuthData) => Promise; + version: () => Promise; + checkToken: () => Promise; + search: (data: SearchData) => Promise, + availableDubCodes: () => Promise, + availableSubCodes: () => Promise, + handleDefault: (name: string) => Promise, + resolveItems: (data: ResolveItemsData) => Promise, + listEpisodes: (id: string) => Promise, + downloadItem: (data: QueueItem) => void, + isDownloading: () => Promise, + openFolder: (path: FolderTypes) => void, + openFile: (data: [FolderTypes, string]) => void, + openURL: (data: string) => void; + getQueue: () => Promise, + removeFromQueue: (index: number) => void, + clearQueue: () => void, + setDownloadQueue: (data: boolean) => void, + getDownloadQueue: () => Promise } export type FolderTypes = 'content' | 'config'; export type QueueItem = { - title: string, - episode: string, - fileName: string, - dlsubs: string[], - parent: { - title: string, - season: string - }, - q: number, - dlVideoOnce: boolean, - dubLang: string[], - image: string, + title: string, + episode: string, + fileName: string, + dlsubs: string[], + parent: { + title: string, + season: string + }, + q: number, + dlVideoOnce: boolean, + dubLang: string[], + image: string, } & ResolveItemsData export type ResolveItemsData = { - id: string, - dubLang: string[], - all: boolean, - but: boolean, - novids: boolean, - noaudio: boolean - dlVideoOnce: boolean, - e: string, - fileName: string, - q: number, - dlsubs: string[] + id: string, + dubLang: string[], + all: boolean, + but: boolean, + novids: boolean, + noaudio: boolean + dlVideoOnce: boolean, + e: string, + fileName: string, + q: number, + dlsubs: string[] } export type SearchResponseItem = { - image: string, - name: string, - desc?: string, - id: string, - lang?: string[], - rating: number + image: string, + name: string, + desc?: string, + id: string, + lang?: string[], + rating: number }; export type Episode = { - e: string, - lang: string[], - name: string, - season: string, - seasonTitle: string, - episode: string, - id: string, - img: string, - description: string, - time: string + e: string, + lang: string[], + name: string, + season: string, + seasonTitle: string, + episode: string, + id: string, + img: string, + description: string, + time: string } export type SearchResponse = ResponseBase export type EpisodeListResponse = ResponseBase export type FuniEpisodeData = { - title: string, - episode: string, - epsiodeNumber: string, - episodeID: string, - seasonTitle: string, - seasonNumber: string, - ids: { - episode: string, - show: string, - season: string - }, - image: string + title: string, + episode: string, + epsiodeNumber: string, + episodeID: string, + seasonTitle: string, + seasonNumber: string, + ids: { + episode: string, + show: string, + season: string + }, + image: string }; export type AuthData = { username: string, password: string }; @@ -102,12 +102,12 @@ export type SearchData = { search: string, page?: number, 'search-type'?: string export type FuniGetShowData = { id: number, e?: string, but: boolean, all: boolean }; export type FuniGetEpisodeData = { subs: FuniSubsData, fnSlug: FuniEpisodeData, simul?: boolean; dubLang: string[], s: string } export type FuniStreamData = { force?: 'Y'|'y'|'N'|'n'|'C'|'c', callbackMaker?: (data: DownloadInfo) => HLSCallback, q: number, x: number, fileName: string, numbers: number, novids?: boolean, - timeout: number, partsize: number, fsRetryTime: number, noaudio?: boolean, mp4: boolean, ass: boolean, fontSize: number, fontName?: string, skipmux?: boolean, - forceMuxer: AvailableMuxer | undefined, simul: boolean, skipSubMux: boolean, nocleanup: boolean, override: string[], videoTitle: string, - ffmpegOptions: string[], mkvmergeOptions: string[], defaultAudio: LanguageItem, defaultSub: LanguageItem, ccTag: string } + timeout: number, partsize: number, fsRetryTime: number, noaudio?: boolean, mp4: boolean, ass: boolean, fontSize: number, fontName?: string, skipmux?: boolean, + forceMuxer: AvailableMuxer | undefined, simul: boolean, skipSubMux: boolean, nocleanup: boolean, override: string[], videoTitle: string, + ffmpegOptions: string[], mkvmergeOptions: string[], defaultAudio: LanguageItem, defaultSub: LanguageItem, ccTag: string } export type FuniSubsData = { nosubs?: boolean, sub: boolean, dlsubs: string[], ccTag: string } export type DownloadData = { - hslang?: string; id: string, e: string, dubLang: string[], dlsubs: string[], fileName: string, q: number, novids: boolean, noaudio: boolean, dlVideoOnce: boolean + hslang?: string; id: string, e: string, dubLang: string[], dlsubs: string[], fileName: string, q: number, novids: boolean, noaudio: boolean, dlVideoOnce: boolean } export type AuthResponse = ResponseBase; @@ -118,44 +118,44 @@ export type CheckTokenResponse = ResponseBase; export type ResponseBase = ({ - isOk: true, - value: T + isOk: true, + value: T } | { - isOk: false, - reason: Error + isOk: false, + reason: Error }); export type ProgressData = { - total: number, - cur: number, - percent: number|string, - time: number, - downloadSpeed: number, - bytes: number + total: number, + cur: number, + percent: number|string, + time: number, + downloadSpeed: number, + bytes: number }; export type PossibleMessages = keyof ServiceHandler; export type DownloadInfo = { - image: string, - parent: { - title: string - }, - title: string, - language: LanguageItem, - fileName: string + image: string, + parent: { + title: string + }, + title: string, + language: LanguageItem, + fileName: string } export type ExtendedProgress = { - progress: ProgressData, - downloadInfo: DownloadInfo + progress: ProgressData, + downloadInfo: DownloadInfo } export type GuiState = { - setup: boolean, - services: Record + setup: boolean, + services: Record } export type GuiStateService = { - queue: QueueItem[] + queue: QueueItem[] } \ No newline at end of file diff --git a/@types/mpd-parser.d.ts b/@types/mpd-parser.d.ts index a45968f..54688a1 100644 --- a/@types/mpd-parser.d.ts +++ b/@types/mpd-parser.d.ts @@ -1,101 +1,101 @@ declare module 'mpd-parser' { - export type Segment = { - uri: string, - timeline: number, - duration: number, - resolvedUri: string, - map: { - uri: string, - resolvedUri: string, - byterange?: { - length: number, - offset: number - } - }, - byterange?: { - length: number, - offset: number - }, - number: number, - presentationTime: number - } + export type Segment = { + uri: string, + timeline: number, + duration: number, + resolvedUri: string, + map: { + uri: string, + resolvedUri: string, + byterange?: { + length: number, + offset: number + } + }, + byterange?: { + length: number, + offset: number + }, + number: number, + presentationTime: number + } - export type Sidx = { - uri: string, - resolvedUri: string, - byterange: { - length: number, - offset: number - }, - map: { - uri: string, - resolvedUri: string, - byterange: { - length: number, - offset: number - } - }, - duration: number, - timeline: number, - presentationTime: number, - number: number - } + export type Sidx = { + uri: string, + resolvedUri: string, + byterange: { + length: number, + offset: number + }, + map: { + uri: string, + resolvedUri: string, + byterange: { + length: number, + offset: number + } + }, + duration: number, + timeline: number, + presentationTime: number, + number: number + } - export type Playlist = { - attributes: { - NAME: string, - BANDWIDTH: number, - CODECS: string, - 'PROGRAM-ID': number, - // Following for video only - 'FRAME-RATE'?: number, - AUDIO?: string, // audio stream name - SUBTITLES?: string, - RESOLUTION?: { - width: number, - height: number - } - }, - uri: string, - endList: boolean, - timeline: number, - resolvedUri: string, - targetDuration: number, - discontinuitySequence: number, - discontinuityStarts: [], - timelineStarts: { - start: number, - timeline: number - }[], - mediaSequence: number, - contentProtection?: { - [type: string]: { - pssh?: Uint8Array - } - } - segments: Segment[] - sidx?: Sidx - } + export type Playlist = { + attributes: { + NAME: string, + BANDWIDTH: number, + CODECS: string, + 'PROGRAM-ID': number, + // Following for video only + 'FRAME-RATE'?: number, + AUDIO?: string, // audio stream name + SUBTITLES?: string, + RESOLUTION?: { + width: number, + height: number + } + }, + uri: string, + endList: boolean, + timeline: number, + resolvedUri: string, + targetDuration: number, + discontinuitySequence: number, + discontinuityStarts: [], + timelineStarts: { + start: number, + timeline: number + }[], + mediaSequence: number, + contentProtection?: { + [type: string]: { + pssh?: Uint8Array + } + } + segments: Segment[] + sidx?: Sidx + } - export type Manifest = { - allowCache: boolean, - discontinuityStarts: [], - segments: [], - endList: true, - duration: number, - playlists: Playlist[], - mediaGroups: { - AUDIO: { - audio: { - [name: string]: { - language: string, - autoselect: boolean, - default: boolean, - playlists: Playlist[] - } - } - } - } - } - export function parse(manifest: string): Manifest + export type Manifest = { + allowCache: boolean, + discontinuityStarts: [], + segments: [], + endList: true, + duration: number, + playlists: Playlist[], + mediaGroups: { + AUDIO: { + audio: { + [name: string]: { + language: string, + autoselect: boolean, + default: boolean, + playlists: Playlist[] + } + } + } + } + } + export function parse(manifest: string): Manifest } diff --git a/@types/newHidiveEpisode.d.ts b/@types/newHidiveEpisode.d.ts index 90fe2c7..9ccf705 100644 --- a/@types/newHidiveEpisode.d.ts +++ b/@types/newHidiveEpisode.d.ts @@ -1,43 +1,43 @@ export interface NewHidiveEpisode { - description: string; - duration: number; - title: string; - categories: string[]; - contentDownload: ContentDownload; - favourite: boolean; - subEvents: any[]; - thumbnailUrl: string; - longDescription: string; - posterUrl: string; - offlinePlaybackLanguages: string[]; - externalAssetId: string; - maxHeight: number; - rating: Rating; - episodeInformation: EpisodeInformation; - id: number; - accessLevel: string; - playerUrlCallback: string; - thumbnailsPreview: string; - displayableTags: any[]; - plugins: any[]; - watchStatus: string; - computedReleases: any[]; - licences: any[]; - type: string; + description: string; + duration: number; + title: string; + categories: string[]; + contentDownload: ContentDownload; + favourite: boolean; + subEvents: any[]; + thumbnailUrl: string; + longDescription: string; + posterUrl: string; + offlinePlaybackLanguages: string[]; + externalAssetId: string; + maxHeight: number; + rating: Rating; + episodeInformation: EpisodeInformation; + id: number; + accessLevel: string; + playerUrlCallback: string; + thumbnailsPreview: string; + displayableTags: any[]; + plugins: any[]; + watchStatus: string; + computedReleases: any[]; + licences: any[]; + type: string; } export interface ContentDownload { - permission: string; - period: string; + permission: string; + period: string; } export interface EpisodeInformation { - seasonNumber: number; - episodeNumber: number; - season: number; + seasonNumber: number; + episodeNumber: number; + season: number; } export interface Rating { - rating: string; - descriptors: any[]; + rating: string; + descriptors: any[]; } \ No newline at end of file diff --git a/@types/newHidivePlayback.d.ts b/@types/newHidivePlayback.d.ts index f25c863..3094c0c 100644 --- a/@types/newHidivePlayback.d.ts +++ b/@types/newHidivePlayback.d.ts @@ -1,33 +1,33 @@ export interface NewHidivePlayback { - watermark: null; - skipMarkers: any[]; - annotations: null; - dash: Format[]; - hls: Format[]; + watermark: null; + skipMarkers: any[]; + annotations: null; + dash: Format[]; + hls: Format[]; } export interface Format { - subtitles: Subtitle[]; - url: string; - drm: DRM; + subtitles: Subtitle[]; + url: string; + drm: DRM; } export interface DRM { - encryptionMode: string; - containerType: string; - jwtToken: string; - url: string; - keySystems: string[]; + encryptionMode: string; + containerType: string; + jwtToken: string; + url: string; + keySystems: string[]; } export interface Subtitle { - format: Formats; - language: string; - url: string; + format: Formats; + language: string; + url: string; } export enum Formats { - Scc = 'scc', - Srt = 'srt', - Vtt = 'vtt', + Scc = 'scc', + Srt = 'srt', + Vtt = 'vtt', } diff --git a/@types/newHidiveSearch.d.ts b/@types/newHidiveSearch.d.ts index 95b6acf..44cd903 100644 --- a/@types/newHidiveSearch.d.ts +++ b/@types/newHidiveSearch.d.ts @@ -1,88 +1,88 @@ export interface NewHidiveSearch { - results: Result[]; + results: Result[]; } export interface Result { - hits: Hit[]; - nbHits: number; - page: number; - nbPages: number; - hitsPerPage: number; - exhaustiveNbHits: boolean; - exhaustiveTypo: boolean; - exhaustive: Exhaustive; - query: string; - params: string; - index: string; - renderingContent: object; - processingTimeMS: number; - processingTimingsMS: ProcessingTimingsMS; - serverTimeMS: number; + hits: Hit[]; + nbHits: number; + page: number; + nbPages: number; + hitsPerPage: number; + exhaustiveNbHits: boolean; + exhaustiveTypo: boolean; + exhaustive: Exhaustive; + query: string; + params: string; + index: string; + renderingContent: object; + processingTimeMS: number; + processingTimingsMS: ProcessingTimingsMS; + serverTimeMS: number; } export interface Exhaustive { - nbHits: boolean; - typo: boolean; + nbHits: boolean; + typo: boolean; } export interface Hit { - type: string; - weight: number; - id: number; - name: string; - description: string; - meta: object; - coverUrl: string; - smallCoverUrl: string; - seasonsCount: number; - tags: string[]; - localisations: HitLocalisations; - ratings: Ratings; - objectID: string; - _highlightResult: HighlightResult; + type: string; + weight: number; + id: number; + name: string; + description: string; + meta: object; + coverUrl: string; + smallCoverUrl: string; + seasonsCount: number; + tags: string[]; + localisations: HitLocalisations; + ratings: Ratings; + objectID: string; + _highlightResult: HighlightResult; } export interface HighlightResult { - name: Description; - description: Description; - tags: Description[]; - localisations: HighlightResultLocalisations; + name: Description; + description: Description; + tags: Description[]; + localisations: HighlightResultLocalisations; } export interface Description { - value: string; - matchLevel: string; - matchedWords: string[]; - fullyHighlighted?: boolean; + value: string; + matchLevel: string; + matchedWords: string[]; + fullyHighlighted?: boolean; } export interface HighlightResultLocalisations { - en_US: PurpleEnUS; + en_US: PurpleEnUS; } export interface PurpleEnUS { - title: Description; - description: Description; + title: Description; + description: Description; } export interface HitLocalisations { - [language: string]: HitLocalization; + [language: string]: HitLocalization; } export interface HitLocalization { - title: string; - description: string; + title: string; + description: string; } export interface Ratings { - US: string[]; + US: string[]; } export interface ProcessingTimingsMS { - _request: Request; + _request: Request; } export interface Request { - queue: number; - roundTrip: number; + queue: number; + roundTrip: number; } diff --git a/@types/newHidiveSeason.d.ts b/@types/newHidiveSeason.d.ts index 0ed1b37..973c725 100644 --- a/@types/newHidiveSeason.d.ts +++ b/@types/newHidiveSeason.d.ts @@ -1,89 +1,89 @@ export interface NewHidiveSeason { - title: string; - description: string; - longDescription: string; - smallCoverUrl: string; - coverUrl: string; - titleUrl: string; - posterUrl: string; - seasonNumber: number; - episodeCount: number; - displayableTags: any[]; - rating: Rating; - contentRating: Rating; - id: number; - series: Series; - episodes: Episode[]; - paging: Paging; - licences: any[]; + title: string; + description: string; + longDescription: string; + smallCoverUrl: string; + coverUrl: string; + titleUrl: string; + posterUrl: string; + seasonNumber: number; + episodeCount: number; + displayableTags: any[]; + rating: Rating; + contentRating: Rating; + id: number; + series: Series; + episodes: Episode[]; + paging: Paging; + licences: any[]; } export interface Rating { - rating: string; - descriptors: any[]; + rating: string; + descriptors: any[]; } export interface Episode { - accessLevel: string; - availablePurchases?: any[]; - licenceIds?: any[]; - type: string; - id: number; - title: string; - description: string; - thumbnailUrl: string; - posterUrl: string; - duration: number; - favourite: boolean; - contentDownload: ContentDownload; - offlinePlaybackLanguages: string[]; - externalAssetId: string; - subEvents: any[]; - maxHeight: number; - thumbnailsPreview: string; - longDescription: string; - episodeInformation: EpisodeInformation; - categories: string[]; - displayableTags: any[]; - watchStatus: string; - computedReleases: any[]; + accessLevel: string; + availablePurchases?: any[]; + licenceIds?: any[]; + type: string; + id: number; + title: string; + description: string; + thumbnailUrl: string; + posterUrl: string; + duration: number; + favourite: boolean; + contentDownload: ContentDownload; + offlinePlaybackLanguages: string[]; + externalAssetId: string; + subEvents: any[]; + maxHeight: number; + thumbnailsPreview: string; + longDescription: string; + episodeInformation: EpisodeInformation; + categories: string[]; + displayableTags: any[]; + watchStatus: string; + computedReleases: any[]; } export interface ContentDownload { - permission: string; + permission: string; } export interface EpisodeInformation { - seasonNumber: number; - episodeNumber: number; - season: number; + seasonNumber: number; + episodeNumber: number; + season: number; } export interface Paging { - moreDataAvailable: boolean; - lastSeen: number; + moreDataAvailable: boolean; + lastSeen: number; } export interface Series { - seriesId: number; - title: string; - description: string; - longDescription: string; - displayableTags: any[]; - rating: Rating; - contentRating: Rating; + seriesId: number; + title: string; + description: string; + longDescription: string; + displayableTags: any[]; + rating: Rating; + contentRating: Rating; } export interface NewHidiveSeriesExtra extends Series { - season: NewHidiveSeason; + season: NewHidiveSeason; } export interface NewHidiveEpisodeExtra extends Episode { - titleId: number; - nameLong: string; - seasonTitle: string; - seriesTitle: string; - seriesId?: number; - isSelected: boolean; - jwtToken?: string; + titleId: number; + nameLong: string; + seasonTitle: string; + seriesTitle: string; + seriesId?: number; + isSelected: boolean; + jwtToken?: string; } \ No newline at end of file diff --git a/@types/newHidiveSeries.d.ts b/@types/newHidiveSeries.d.ts index 4391406..31935d2 100644 --- a/@types/newHidiveSeries.d.ts +++ b/@types/newHidiveSeries.d.ts @@ -1,35 +1,35 @@ export interface NewHidiveSeries { - id: number; - title: string; - description: string; - longDescription: string; - smallCoverUrl: string; - coverUrl: string; - titleUrl: string; - posterUrl: string; - seasons: Season[]; - rating: Rating; - contentRating: Rating; - displayableTags: any[]; - paging: Paging; + id: number; + title: string; + description: string; + longDescription: string; + smallCoverUrl: string; + coverUrl: string; + titleUrl: string; + posterUrl: string; + seasons: Season[]; + rating: Rating; + contentRating: Rating; + displayableTags: any[]; + paging: Paging; } export interface Rating { - rating: string; - descriptors: any[]; + rating: string; + descriptors: any[]; } export interface Paging { - moreDataAvailable: boolean; - lastSeen: number; + moreDataAvailable: boolean; + lastSeen: number; } export interface Season { - title: string; - description: string; - longDescription: string; - seasonNumber: number; - episodeCount: number; - displayableTags: any[]; - id: number; + title: string; + description: string; + longDescription: string; + seasonNumber: number; + episodeCount: number; + displayableTags: any[]; + id: number; } diff --git a/@types/objectInfo.d.ts b/@types/objectInfo.d.ts index 096e2c3..7a9a9e9 100644 --- a/@types/objectInfo.d.ts +++ b/@types/objectInfo.d.ts @@ -1,211 +1,211 @@ // Generated by https://quicktype.io export interface ObjectInfo { - total: number; - data: CrunchyObject[]; - meta: Record; + total: number; + data: CrunchyObject[]; + meta: Record; } export interface CrunchyObject { - __links__?: Links; - channel_id: string; - slug: string; - images: Images; - linked_resource_key: string; - description: string; - promo_description: string; - external_id: string; - title: string; - series_metadata?: SeriesMetadata; - id: string; - slug_title: string; - type: string; - promo_title: string; - movie_listing_metadata?: MovieListingMetadata; - movie_metadata?: MovieMetadata; - playback?: string; - episode_metadata?: EpisodeMetadata; - streams_link?: string; - season_metadata?: SeasonMetadata; - isSelected?: boolean; - f_num: string; - s_num: string; + __links__?: Links; + channel_id: string; + slug: string; + images: Images; + linked_resource_key: string; + description: string; + promo_description: string; + external_id: string; + title: string; + series_metadata?: SeriesMetadata; + id: string; + slug_title: string; + type: string; + promo_title: string; + movie_listing_metadata?: MovieListingMetadata; + movie_metadata?: MovieMetadata; + playback?: string; + episode_metadata?: EpisodeMetadata; + streams_link?: string; + season_metadata?: SeasonMetadata; + isSelected?: boolean; + f_num: string; + s_num: string; } export interface Links { - 'episode/season': LinkData; - 'episode/series': LinkData; - resource: LinkData; - 'resource/channel': LinkData; - streams: LinkData; + 'episode/season': LinkData; + 'episode/series': LinkData; + resource: LinkData; + 'resource/channel': LinkData; + streams: LinkData; } export interface LinkData { - href: string; + href: string; } export interface EpisodeMetadata { - audio_locale: Locale; - availability_ends: Date; - availability_notes: string; - availability_starts: Date; - available_date: null; - available_offline: boolean; - closed_captions_available: boolean; - duration_ms: number; - eligible_region: string; - episode: string; - episode_air_date: Date; - episode_number: number; - extended_maturity_rating: Record; - free_available_date: Date; - identifier: string; - is_clip: boolean; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - premium_available_date: Date; - premium_date: null; - season_id: string; - season_number: number; - season_slug_title: string; - season_title: string; - sequence_number: number; - series_id: string; - series_slug_title: string; - series_title: string; - subtitle_locales: Locale[]; - tenant_categories?: string[]; - upload_date: Date; - versions: EpisodeMetadataVersion[]; + audio_locale: Locale; + availability_ends: Date; + availability_notes: string; + availability_starts: Date; + available_date: null; + available_offline: boolean; + closed_captions_available: boolean; + duration_ms: number; + eligible_region: string; + episode: string; + episode_air_date: Date; + episode_number: number; + extended_maturity_rating: Record; + free_available_date: Date; + identifier: string; + is_clip: boolean; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + premium_available_date: Date; + premium_date: null; + season_id: string; + season_number: number; + season_slug_title: string; + season_title: string; + sequence_number: number; + series_id: string; + series_slug_title: string; + series_title: string; + subtitle_locales: Locale[]; + tenant_categories?: string[]; + upload_date: Date; + versions: EpisodeMetadataVersion[]; } export interface EpisodeMetadataVersion { - audio_locale: Locale; - guid: string; - is_premium_only: boolean; - media_guid: string; - original: boolean; - season_guid: string; - variant: string; + audio_locale: Locale; + guid: string; + is_premium_only: boolean; + media_guid: string; + original: boolean; + season_guid: string; + variant: string; } export interface Images { - poster_tall?: Array; - poster_wide?: Array; - promo_image?: Array; - thumbnail?: Array; + poster_tall?: Array; + poster_wide?: Array; + promo_image?: Array; + thumbnail?: Array; } export interface Image { - height: number; - source: string; - type: ImageType; - width: number; + height: number; + source: string; + type: ImageType; + width: number; } export enum ImageType { - PosterTall = 'poster_tall', - PosterWide = 'poster_wide', - PromoImage = 'promo_image', - Thumbnail = 'thumbnail', + PosterTall = 'poster_tall', + PosterWide = 'poster_wide', + PromoImage = 'promo_image', + Thumbnail = 'thumbnail', } export interface MovieListingMetadata { - availability_notes: string; - available_date: null; - available_offline: boolean; - duration_ms: number; - extended_description: string; - extended_maturity_rating: Record; - first_movie_id: string; - free_available_date: Date; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - movie_release_year: number; - premium_available_date: Date; - premium_date: null; - subtitle_locales: Locale[]; - tenant_categories: string[]; + availability_notes: string; + available_date: null; + available_offline: boolean; + duration_ms: number; + extended_description: string; + extended_maturity_rating: Record; + first_movie_id: string; + free_available_date: Date; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + movie_release_year: number; + premium_available_date: Date; + premium_date: null; + subtitle_locales: Locale[]; + tenant_categories: string[]; } export interface MovieMetadata { - availability_notes: string; - available_offline: boolean; - closed_captions_available: boolean; - duration_ms: number; - extended_maturity_rating: Record; - is_dubbed: boolean; - is_mature: boolean; - is_premium_only: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - movie_listing_id: string; - movie_listing_slug_title: string; - movie_listing_title: string; + availability_notes: string; + available_offline: boolean; + closed_captions_available: boolean; + duration_ms: number; + extended_maturity_rating: Record; + is_dubbed: boolean; + is_mature: boolean; + is_premium_only: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + movie_listing_id: string; + movie_listing_slug_title: string; + movie_listing_title: string; } export interface SeasonMetadata { - audio_locale: Locale; - audio_locales: Locale[]; - extended_maturity_rating: Record; - identifier: string; - is_mature: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - season_display_number: string; - season_sequence_number: number; - subtitle_locales: Locale[]; - versions: SeasonMetadataVersion[]; + audio_locale: Locale; + audio_locales: Locale[]; + extended_maturity_rating: Record; + identifier: string; + is_mature: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + season_display_number: string; + season_sequence_number: number; + subtitle_locales: Locale[]; + versions: SeasonMetadataVersion[]; } export interface SeasonMetadataVersion { - audio_locale: Locale; - guid: string; - original: boolean; - variant: string; + audio_locale: Locale; + guid: string; + original: boolean; + variant: string; } export interface SeriesMetadata { - audio_locales: Locale[]; - availability_notes: string; - episode_count: number; - extended_description: string; - extended_maturity_rating: Record; - is_dubbed: boolean; - is_mature: boolean; - is_simulcast: boolean; - is_subbed: boolean; - mature_blocked: boolean; - maturity_ratings: string[]; - season_count: number; - series_launch_year: number; - subtitle_locales: Locale[]; - tenant_categories?: string[]; + audio_locales: Locale[]; + availability_notes: string; + episode_count: number; + extended_description: string; + extended_maturity_rating: Record; + is_dubbed: boolean; + is_mature: boolean; + is_simulcast: boolean; + is_subbed: boolean; + mature_blocked: boolean; + maturity_ratings: string[]; + season_count: number; + series_launch_year: number; + subtitle_locales: Locale[]; + tenant_categories?: string[]; } export enum Locale { - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } \ No newline at end of file diff --git a/@types/pkg.d.ts b/@types/pkg.d.ts index b22e702..ba03e2a 100644 --- a/@types/pkg.d.ts +++ b/@types/pkg.d.ts @@ -1,3 +1,3 @@ declare module 'pkg' { - export async function exec(config: string[]); + export async function exec(config: string[]); } \ No newline at end of file diff --git a/@types/playbackData.d.ts b/@types/playbackData.d.ts index 015f41a..6223ab1 100644 --- a/@types/playbackData.d.ts +++ b/@types/playbackData.d.ts @@ -1,120 +1,120 @@ // Generated by https://quicktype.io export interface PlaybackData { - total: number; - vpb: { [key: string]: { [key: string]: StreamDetails } }; - apb: { [key: string]: { [key: string]: StreamDetails } }; - meta: Meta; + total: number; + vpb: { [key: string]: { [key: string]: StreamDetails } }; + apb: { [key: string]: { [key: string]: StreamDetails } }; + meta: Meta; } export interface StreamList { - download_hls: CrunchyStreams; - drm_adaptive_hls: CrunchyStreams; - multitrack_adaptive_hls_v2: CrunchyStreams; - vo_adaptive_hls: CrunchyStreams; - vo_drm_adaptive_hls: CrunchyStreams; - adaptive_hls: CrunchyStreams; - drm_download_dash: CrunchyStreams; - drm_download_hls: CrunchyStreams; - drm_multitrack_adaptive_hls_v2: CrunchyStreams; - vo_drm_adaptive_dash: CrunchyStreams; - adaptive_dash: CrunchyStreams; - urls: CrunchyStreams; - vo_adaptive_dash: CrunchyStreams; - download_dash: CrunchyStreams; - drm_adaptive_dash: CrunchyStreams; + download_hls: CrunchyStreams; + drm_adaptive_hls: CrunchyStreams; + multitrack_adaptive_hls_v2: CrunchyStreams; + vo_adaptive_hls: CrunchyStreams; + vo_drm_adaptive_hls: CrunchyStreams; + adaptive_hls: CrunchyStreams; + drm_download_dash: CrunchyStreams; + drm_download_hls: CrunchyStreams; + drm_multitrack_adaptive_hls_v2: CrunchyStreams; + vo_drm_adaptive_dash: CrunchyStreams; + adaptive_dash: CrunchyStreams; + urls: CrunchyStreams; + vo_adaptive_dash: CrunchyStreams; + download_dash: CrunchyStreams; + drm_adaptive_dash: CrunchyStreams; } export interface CrunchyStreams { - '': StreamDetails; - 'en-US'?: StreamDetails; - 'es-LA'?: StreamDetails; - 'es-419'?: StreamDetails; - 'es-ES'?: StreamDetails; - 'pt-BR'?: StreamDetails; - 'fr-FR'?: StreamDetails; - 'de-DE'?: StreamDetails; - 'ar-ME'?: StreamDetails; - 'ar-SA'?: StreamDetails; - 'it-IT'?: StreamDetails; - 'ru-RU'?: StreamDetails; - 'tr-TR'?: StreamDetails; - 'hi-IN'?: StreamDetails; - 'zh-CN'?: StreamDetails; - 'ko-KR'?: StreamDetails; - 'ja-JP'?: StreamDetails; - [string: string]: StreamDetails; + '': StreamDetails; + 'en-US'?: StreamDetails; + 'es-LA'?: StreamDetails; + 'es-419'?: StreamDetails; + 'es-ES'?: StreamDetails; + 'pt-BR'?: StreamDetails; + 'fr-FR'?: StreamDetails; + 'de-DE'?: StreamDetails; + 'ar-ME'?: StreamDetails; + 'ar-SA'?: StreamDetails; + 'it-IT'?: StreamDetails; + 'ru-RU'?: StreamDetails; + 'tr-TR'?: StreamDetails; + 'hi-IN'?: StreamDetails; + 'zh-CN'?: StreamDetails; + 'ko-KR'?: StreamDetails; + 'ja-JP'?: StreamDetails; + [string: string]: StreamDetails; } export interface StreamDetails { - //hardsub_locale: Locale; - hardsub_locale: string; - url: string; - hardsub_lang?: string; - audio_lang?: string; - type?: string; + //hardsub_locale: Locale; + hardsub_locale: string; + url: string; + hardsub_lang?: string; + audio_lang?: string; + type?: string; } export interface Meta { - media_id: string; - subtitles: Subtitles; - bifs: string[]; - versions: Version[]; - audio_locale: Locale; - closed_captions: Subtitles; - captions: Subtitles; + media_id: string; + subtitles: Subtitles; + bifs: string[]; + versions: Version[]; + audio_locale: Locale; + closed_captions: Subtitles; + captions: Subtitles; } export interface Subtitles { - ''?: SubtitleInfo; - 'en-US'?: SubtitleInfo; - 'es-LA'?: SubtitleInfo; - 'es-419'?: SubtitleInfo; - 'es-ES'?: SubtitleInfo; - 'pt-BR'?: SubtitleInfo; - 'fr-FR'?: SubtitleInfo; - 'de-DE'?: SubtitleInfo; - 'ar-ME'?: SubtitleInfo; - 'ar-SA'?: SubtitleInfo; - 'it-IT'?: SubtitleInfo; - 'ru-RU'?: SubtitleInfo; - 'tr-TR'?: SubtitleInfo; - 'hi-IN'?: SubtitleInfo; - 'zh-CN'?: SubtitleInfo; - 'ko-KR'?: SubtitleInfo; - 'ja-JP'?: SubtitleInfo; + ''?: SubtitleInfo; + 'en-US'?: SubtitleInfo; + 'es-LA'?: SubtitleInfo; + 'es-419'?: SubtitleInfo; + 'es-ES'?: SubtitleInfo; + 'pt-BR'?: SubtitleInfo; + 'fr-FR'?: SubtitleInfo; + 'de-DE'?: SubtitleInfo; + 'ar-ME'?: SubtitleInfo; + 'ar-SA'?: SubtitleInfo; + 'it-IT'?: SubtitleInfo; + 'ru-RU'?: SubtitleInfo; + 'tr-TR'?: SubtitleInfo; + 'hi-IN'?: SubtitleInfo; + 'zh-CN'?: SubtitleInfo; + 'ko-KR'?: SubtitleInfo; + 'ja-JP'?: SubtitleInfo; } export interface SubtitleInfo { - format: string; - locale: Locale; - url: string; + format: string; + locale: Locale; + url: string; } export interface Version { - audio_locale: Locale; - guid: string; - is_premium_only: boolean; - media_guid: string; - original: boolean; - season_guid: string; - variant: string; + audio_locale: Locale; + guid: string; + is_premium_only: boolean; + media_guid: string; + original: boolean; + season_guid: string; + variant: string; } export enum Locale { - default = '', - enUS = 'en-US', - esLA = 'es-LA', - es419 = 'es-419', - esES = 'es-ES', - ptBR = 'pt-BR', - frFR = 'fr-FR', - deDE = 'de-DE', - arME = 'ar-ME', - arSA = 'ar-SA', - itIT = 'it-IT', - ruRU = 'ru-RU', - trTR = 'tr-TR', - hiIN = 'hi-IN', - zhCN = 'zh-CN', - koKR = 'ko-KR', - jaJP = 'ja-JP', + default = '', + enUS = 'en-US', + esLA = 'es-LA', + es419 = 'es-419', + esES = 'es-ES', + ptBR = 'pt-BR', + frFR = 'fr-FR', + deDE = 'de-DE', + arME = 'ar-ME', + arSA = 'ar-SA', + itIT = 'it-IT', + ruRU = 'ru-RU', + trTR = 'tr-TR', + hiIN = 'hi-IN', + zhCN = 'zh-CN', + koKR = 'ko-KR', + jaJP = 'ja-JP', } \ No newline at end of file diff --git a/@types/randomEvents.d.ts b/@types/randomEvents.d.ts index 41ea519..357029f 100644 --- a/@types/randomEvents.d.ts +++ b/@types/randomEvents.d.ts @@ -1,15 +1,15 @@ import { ExtendedProgress, QueueItem } from './messageHandler'; export type RandomEvents = { - progress: ExtendedProgress, - finish: undefined, - queueChange: QueueItem[], - current: QueueItem|undefined + progress: ExtendedProgress, + finish: undefined, + queueChange: QueueItem[], + current: QueueItem|undefined } export interface RandomEvent { - name: T, - data: RandomEvents[T] + name: T, + data: RandomEvents[T] } export type Handler = (data: RandomEvent) => unknown; \ No newline at end of file diff --git a/@types/removeNPMAbsolutePaths.d.ts b/@types/removeNPMAbsolutePaths.d.ts index b48935a..f141c00 100644 --- a/@types/removeNPMAbsolutePaths.d.ts +++ b/@types/removeNPMAbsolutePaths.d.ts @@ -1,3 +1,3 @@ declare module 'removeNPMAbsolutePaths' { - export default async function modulesCleanup(path: string); + export default async function modulesCleanup(path: string); } \ No newline at end of file diff --git a/@types/serviceClassInterface.d.ts b/@types/serviceClassInterface.d.ts index aefc890..4115bd6 100644 --- a/@types/serviceClassInterface.d.ts +++ b/@types/serviceClassInterface.d.ts @@ -1,3 +1,3 @@ export interface ServiceClass { - cli: () => Promise + cli: () => Promise } \ No newline at end of file diff --git a/@types/streamData.d.ts b/@types/streamData.d.ts index 351c96f..16ed2e7 100644 --- a/@types/streamData.d.ts +++ b/@types/streamData.d.ts @@ -1,28 +1,28 @@ // Generated by https://quicktype.io export interface StreamData { - items: Item[]; - watchHistorySaveInterval: number; - errors?: Error[] + items: Item[]; + watchHistorySaveInterval: number; + errors?: Error[] } export interface Error { - detail: string, - code: number + detail: string, + code: number } export interface Item { - src: string; - kind: string; - isPromo: boolean; - videoType: string; - aips: Aip[]; - experienceId: string; - showAds: boolean; - id: number; + src: string; + kind: string; + isPromo: boolean; + videoType: string; + aips: Aip[]; + experienceId: string; + showAds: boolean; + id: number; } export interface Aip { - out: number; - in: number; + out: number; + in: number; } diff --git a/@types/updateFile.d.ts b/@types/updateFile.d.ts index 7f00777..3960260 100644 --- a/@types/updateFile.d.ts +++ b/@types/updateFile.d.ts @@ -1,4 +1,4 @@ export type UpdateFile = { - lastCheck: number, - nextCheck: number + lastCheck: number, + nextCheck: number } \ No newline at end of file diff --git a/@types/ws.d.ts b/@types/ws.d.ts index 3669f28..1c85447 100644 --- a/@types/ws.d.ts +++ b/@types/ws.d.ts @@ -2,44 +2,44 @@ import { GUIConfig } from '../modules/module.cfg-loader'; import { AuthResponse, CheckTokenResponse, EpisodeListResponse, FolderTypes, QueueItem, ResolveItemsData, SearchData, SearchResponse } from './messageHandler'; export type WSMessage = { - name: T, - data: MessageTypes[T][P] + name: T, + data: MessageTypes[T][P] } export type WSMessageWithID = WSMessage & { - id: string + id: string } export type UnknownWSMessage = { - name: keyof MessageTypes, - data: MessageTypes[keyof MessageTypes][0], - id: string + name: keyof MessageTypes, + data: MessageTypes[keyof MessageTypes][0], + id: string } export type MessageTypes = { - 'auth': [AuthData, AuthResponse], - 'version': [undefined, string], - 'checkToken': [undefined, CheckTokenResponse], - 'search': [SearchData, SearchResponse], - 'default': [string, unknown], - 'availableDubCodes': [undefined, string[]], - 'availableSubCodes': [undefined, string[]], - 'resolveItems': [ResolveItemsData, boolean], - 'listEpisodes': [string, EpisodeListResponse], - 'downloadItem': [QueueItem, undefined], - 'isDownloading': [undefined, boolean], - 'openFolder': [FolderTypes, undefined], - 'changeProvider': [undefined, boolean], - 'type': [undefined, 'crunchy'|'hidive'|'ao'|'adn'|undefined], - 'setup': ['crunchy'|'hidive'|'ao'|'adn'|undefined, undefined], - 'openFile': [[FolderTypes, string], undefined], - 'openURL': [string, undefined], - 'isSetup': [undefined, boolean], - 'setupServer': [GUIConfig, boolean], - 'requirePassword': [undefined, boolean], - 'getQueue': [undefined, QueueItem[]], - 'removeFromQueue': [number, undefined], - 'clearQueue': [undefined, undefined], - 'setDownloadQueue': [boolean, undefined], - 'getDownloadQueue': [undefined, boolean] + 'auth': [AuthData, AuthResponse], + 'version': [undefined, string], + 'checkToken': [undefined, CheckTokenResponse], + 'search': [SearchData, SearchResponse], + 'default': [string, unknown], + 'availableDubCodes': [undefined, string[]], + 'availableSubCodes': [undefined, string[]], + 'resolveItems': [ResolveItemsData, boolean], + 'listEpisodes': [string, EpisodeListResponse], + 'downloadItem': [QueueItem, undefined], + 'isDownloading': [undefined, boolean], + 'openFolder': [FolderTypes, undefined], + 'changeProvider': [undefined, boolean], + 'type': [undefined, 'crunchy'|'hidive'|'ao'|'adn'|undefined], + 'setup': ['crunchy'|'hidive'|'ao'|'adn'|undefined, undefined], + 'openFile': [[FolderTypes, string], undefined], + 'openURL': [string, undefined], + 'isSetup': [undefined, boolean], + 'setupServer': [GUIConfig, boolean], + 'requirePassword': [undefined, boolean], + 'getQueue': [undefined, QueueItem[]], + 'removeFromQueue': [number, undefined], + 'clearQueue': [undefined, undefined], + 'setDownloadQueue': [boolean, undefined], + 'getDownloadQueue': [undefined, boolean] } \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index 95dc8d6..eed41c9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -56,8 +56,10 @@ export default tseslint.config( files: ['gui/react/**/*'], rules: { 'no-console': 0, - // Disabled because ESLint bugs around on .tsx files somehow? - indent: 'off' + 'indent': [ + 'error', + 4 + ], } } ); \ No newline at end of file diff --git a/gui/react/.babelrc b/gui/react/.babelrc index 4c2774a..0761517 100644 --- a/gui/react/.babelrc +++ b/gui/react/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["@babel/preset-env","@babel/preset-react", "@babel/preset-typescript"] + "presets": ["@babel/preset-env","@babel/preset-react", "@babel/preset-typescript"] } \ No newline at end of file diff --git a/gui/react/package.json b/gui/react/package.json index 77b45e6..a2b704c 100644 --- a/gui/react/package.json +++ b/gui/react/package.json @@ -1,57 +1,57 @@ { - "name": "anidl-gui", - "version": "1.0.0", - "private": true, - "dependencies": { - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.0", - "@mui/icons-material": "^7.1.2", - "@mui/lab": "7.0.0-beta.12", - "@mui/material": "^7.1.2", - "concurrently": "^9.2.0", - "notistack": "^3.0.2", - "react": "^19.1.0", - "react-dom": "^19.1.0", - "typescript": "^5.8.3", - "uuid": "^11.1.0", - "ws": "^8.18.2" - }, - "devDependencies": { - "@babel/cli": "^7.27.2", - "@babel/core": "^7.27.4", - "@babel/preset-env": "^7.27.2", - "@babel/preset-react": "^7.27.1", - "@babel/preset-typescript": "^7.27.1", - "@types/node": "^22.15.32", - "@types/react": "^19.1.8", - "@types/react-dom": "^19.1.6", - "@types/uuid": "^10.0.0", - "babel-loader": "^10.0.0", - "css-loader": "^7.1.2", - "html-webpack-plugin": "^5.6.3", - "style-loader": "^4.0.0", - "ts-node": "^10.9.2", - "webpack": "^5.99.9", - "webpack-cli": "^6.0.1", - "webpack-dev-server": "^5.2.2" - }, - "proxy": "http://localhost:3000", - "scripts": { - "build": "npx tsc && npx webpack", - "start": "npx concurrently -k npm:frontend npm:backend", - "frontend": "npx webpack-dev-server", - "backend": "npx ts-node -T ../../gui.ts" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} + "name": "anidl-gui", + "version": "1.0.0", + "private": true, + "dependencies": { + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.0", + "@mui/icons-material": "^7.1.2", + "@mui/lab": "7.0.0-beta.12", + "@mui/material": "^7.1.2", + "concurrently": "^9.2.0", + "notistack": "^3.0.2", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "typescript": "^5.8.3", + "uuid": "^11.1.0", + "ws": "^8.18.2" + }, + "devDependencies": { + "@babel/cli": "^7.27.2", + "@babel/core": "^7.27.4", + "@babel/preset-env": "^7.27.2", + "@babel/preset-react": "^7.27.1", + "@babel/preset-typescript": "^7.27.1", + "@types/node": "^22.15.32", + "@types/react": "^19.1.8", + "@types/react-dom": "^19.1.6", + "@types/uuid": "^10.0.0", + "babel-loader": "^10.0.0", + "css-loader": "^7.1.2", + "html-webpack-plugin": "^5.6.3", + "style-loader": "^4.0.0", + "ts-node": "^10.9.2", + "webpack": "^5.99.9", + "webpack-cli": "^6.0.1", + "webpack-dev-server": "^5.2.2" + }, + "proxy": "http://localhost:3000", + "scripts": { + "build": "npx tsc && npx webpack", + "start": "npx concurrently -k npm:frontend npm:backend", + "frontend": "npx webpack-dev-server", + "backend": "npx ts-node -T ../../gui.ts" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} \ No newline at end of file diff --git a/gui/react/public/index.html b/gui/react/public/index.html index e0f99bb..08d1831 100644 --- a/gui/react/public/index.html +++ b/gui/react/public/index.html @@ -1,15 +1,15 @@ - - Multi Downloader - - - - - -
- + + Multi Downloader + + + + + +
+ diff --git a/gui/react/src/@types/FC.d.ts b/gui/react/src/@types/FC.d.ts index 5ec3de1..11963df 100644 --- a/gui/react/src/@types/FC.d.ts +++ b/gui/react/src/@types/FC.d.ts @@ -1,3 +1,3 @@ type FCWithChildren = React.FC<{ - children?: React.ReactNode[]|React.ReactNode + children?: React.ReactNode[]|React.ReactNode } & T> \ No newline at end of file diff --git a/gui/react/src/App.tsx b/gui/react/src/App.tsx index 8f278f3..42b08bf 100644 --- a/gui/react/src/App.tsx +++ b/gui/react/src/App.tsx @@ -2,9 +2,9 @@ import React from 'react'; import Layout from './Layout'; const App: React.FC = () => { - return ( - - ); + return ( + + ); }; export default App; diff --git a/gui/react/src/Layout.tsx b/gui/react/src/Layout.tsx index 478ae91..d9b50f1 100644 --- a/gui/react/src/Layout.tsx +++ b/gui/react/src/Layout.tsx @@ -11,28 +11,28 @@ import MenuBar from './components/MenuBar/MenuBar'; const Layout: React.FC = () => { - const messageHandler = React.useContext(messageChannelContext); + const messageHandler = React.useContext(messageChannelContext); - return - - - - - - - - - - - ; + return + + + + + + + + + + + ; }; export default Layout; \ No newline at end of file diff --git a/gui/react/src/Style.tsx b/gui/react/src/Style.tsx index 1195472..643ba40 100644 --- a/gui/react/src/Style.tsx +++ b/gui/react/src/Style.tsx @@ -2,18 +2,18 @@ import React from 'react'; import { Container, Box, ThemeProvider, createTheme, Theme } from '@mui/material'; const makeTheme = (mode: 'dark'|'light') : Partial => { - return createTheme({ - palette: { - mode, - }, - }); + return createTheme({ + palette: { + mode, + }, + }); }; const Style: FCWithChildren = ({children}) => { - return - - {children} - ; + return + + {children} + ; }; export default Style; \ No newline at end of file diff --git a/gui/react/src/components/AddToQueue/AddToQueue.tsx b/gui/react/src/components/AddToQueue/AddToQueue.tsx index 6e19041..251f4d5 100644 --- a/gui/react/src/components/AddToQueue/AddToQueue.tsx +++ b/gui/react/src/components/AddToQueue/AddToQueue.tsx @@ -6,22 +6,22 @@ import EpisodeListing from './DownloadSelector/Listing/EpisodeListing'; import SearchBox from './SearchBox/SearchBox'; const AddToQueue: React.FC = () => { - const [isOpen, setOpen] = React.useState(false); + const [isOpen, setOpen] = React.useState(false); - return - - setOpen(false)} maxWidth='md' PaperProps={{ elevation:4 }}> - - - - setOpen(false)} /> - - - - ; + + ; }; export default AddToQueue; \ No newline at end of file diff --git a/gui/react/src/components/AddToQueue/DownloadSelector/DownloadSelector.tsx b/gui/react/src/components/AddToQueue/DownloadSelector/DownloadSelector.tsx index 586518b..bac174f 100644 --- a/gui/react/src/components/AddToQueue/DownloadSelector/DownloadSelector.tsx +++ b/gui/react/src/components/AddToQueue/DownloadSelector/DownloadSelector.tsx @@ -12,316 +12,316 @@ type DownloadSelectorProps = { } const DownloadSelector: React.FC = ({ onFinish }) => { - const messageHandler = React.useContext(messageChannelContext); - const [store, dispatch] = useStore(); - const [availableDubs, setAvailableDubs] = React.useState([]); - const [availableSubs, setAvailableSubs ] = React.useState([]); - const [ loading, setLoading ] = React.useState(false); - const { enqueueSnackbar } = useSnackbar(); - const ITEM_HEIGHT = 48; - const ITEM_PADDING_TOP = 8; + const messageHandler = React.useContext(messageChannelContext); + const [store, dispatch] = useStore(); + const [availableDubs, setAvailableDubs] = React.useState([]); + const [availableSubs, setAvailableSubs ] = React.useState([]); + const [ loading, setLoading ] = React.useState(false); + const { enqueueSnackbar } = useSnackbar(); + const ITEM_HEIGHT = 48; + const ITEM_PADDING_TOP = 8; - React.useEffect(() => { - (async () => { - /* If we don't wait the response is undefined? */ - await new Promise((resolve) => setTimeout(() => resolve(undefined), 100)); - const dubLang = messageHandler?.handleDefault('dubLang'); - const subLang = messageHandler?.handleDefault('dlsubs'); - const q = messageHandler?.handleDefault('q'); - const fileName = messageHandler?.handleDefault('fileName'); - const dlVideoOnce = messageHandler?.handleDefault('dlVideoOnce'); - const result = await Promise.all([dubLang, subLang, q, fileName, dlVideoOnce]); - dispatch({ - type: 'downloadOptions', - payload: { - ...store.downloadOptions, - dubLang: result[0], - dlsubs: result[1], - q: result[2], - fileName: result[3], - dlVideoOnce: result[4], + React.useEffect(() => { + (async () => { + /* If we don't wait the response is undefined? */ + await new Promise((resolve) => setTimeout(() => resolve(undefined), 100)); + const dubLang = messageHandler?.handleDefault('dubLang'); + const subLang = messageHandler?.handleDefault('dlsubs'); + const q = messageHandler?.handleDefault('q'); + const fileName = messageHandler?.handleDefault('fileName'); + const dlVideoOnce = messageHandler?.handleDefault('dlVideoOnce'); + const result = await Promise.all([dubLang, subLang, q, fileName, dlVideoOnce]); + dispatch({ + type: 'downloadOptions', + payload: { + ...store.downloadOptions, + dubLang: result[0], + dlsubs: result[1], + q: result[2], + fileName: result[3], + dlVideoOnce: result[4], + } + }); + setAvailableDubs(await messageHandler?.availableDubCodes() ?? []); + setAvailableSubs(await messageHandler?.availableSubCodes() ?? []); + })(); + }, []); + + const addToQueue = async () => { + setLoading(true); + const res = await messageHandler?.resolveItems(store.downloadOptions); + if (!res) + return enqueueSnackbar('The request failed. Please check if the ID is correct.', { + variant: 'error' + }); + setLoading(false); + if (onFinish) + onFinish(); + }; + + const listEpisodes = async () => { + if (!store.downloadOptions.id) { + return enqueueSnackbar('Please enter a ID', { + variant: 'error' + }); } - }); - setAvailableDubs(await messageHandler?.availableDubCodes() ?? []); - setAvailableSubs(await messageHandler?.availableSubCodes() ?? []); - })(); - }, []); - - const addToQueue = async () => { - setLoading(true); - const res = await messageHandler?.resolveItems(store.downloadOptions); - if (!res) - return enqueueSnackbar('The request failed. Please check if the ID is correct.', { - variant: 'error' - }); - setLoading(false); - if (onFinish) - onFinish(); - }; - - const listEpisodes = async () => { - if (!store.downloadOptions.id) { - return enqueueSnackbar('Please enter a ID', { - variant: 'error' - }); - } - setLoading(true); - const res = await messageHandler?.listEpisodes(store.downloadOptions.id); - if (!res || !res.isOk) { - setLoading(false); - return enqueueSnackbar('The request failed. Please check if the ID is correct.', { - variant: 'error' - }); - } else { - dispatch({ - type: 'episodeListing', - payload: res.value - }); - } - setLoading(false); - }; - - return - - - - - General Options - - { - dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, id: e.target.value } + setLoading(true); + const res = await messageHandler?.listEpisodes(store.downloadOptions.id); + if (!res || !res.isOk) { + setLoading(false); + return enqueueSnackbar('The request failed. Please check if the ID is correct.', { + variant: 'error' }); - }} label='Show ID'/> - { - const parsed = parseInt(e.target.value); - if (isNaN(parsed) || parsed < 0 || parsed > 10) - return; + } else { dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, q: parsed } + type: 'episodeListing', + payload: res.value }); - }} label='Quality Level (0 for max)'/> - - - - - - - Simulcast is only supported on Hidive - } - arrow placement='top' - > - - - - - - - - Episode Options - - + - - { - dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, e: e.target.value } - }); - }} placeholder='Episode Select'/> - - List
Episodes
-
-
- - -
- - - Language Options - - { - dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, dubLang: e } - }); - }} - allOption - /> - - { - dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, dlsubs: e } - }); - }} - /> - - Hardsubs are only supported on Crunchyroll - - } - arrow placement='top'> - - - - Hardsub Language - - - + justifyContent: 'space-between', + //backgroundColor: '#ffffff30', + }}> + + + General Options + + { + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, id: e.target.value } + }); + }} label='Show ID'/> + { + const parsed = parseInt(e.target.value); + if (isNaN(parsed) || parsed < 0 || parsed > 10) + return; + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, q: parsed } + }); + }} label='Quality Level (0 for max)'/> + + + + + + + Simulcast is only supported on Hidive + } + arrow placement='top' + > + + + + + + + + Episode Options + + + + { + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, e: e.target.value } + }); + }} placeholder='Episode Select'/> + + List
Episodes
+
+
+ + +
+ + + Language Options + + { + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, dubLang: e } + }); + }} + allOption + /> + + { + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, dlsubs: e } + }); + }} + /> + + Hardsubs are only supported on Crunchyroll + + } + arrow placement='top'> + + + + + Hardsub Language + + + - + Downloads the hardsub version of the selected subtitle.
Subtitles are displayed PERMANENTLY!
You can choose only 1 subtitle per video! - - } arrow placement='top'> - -
+ + } arrow placement='top'> + +
+
+
+
-
-
-
- - - { - dispatch({ - type: 'downloadOptions', - payload: { ...store.downloadOptions, fileName: e.target.value } - }); - }} sx={{ width: '87%' }} label='Filename Overwrite' /> - + + + { + dispatch({ + type: 'downloadOptions', + payload: { ...store.downloadOptions, fileName: e.target.value } + }); + }} sx={{ width: '87%' }} label='Filename Overwrite' /> + Click here to see the documentation - - } arrow placement='top'> - - - - - - - + + } arrow placement='top'> + + + + + + + - Add to Queue + Add to Queue - ; +
; }; export default DownloadSelector; \ No newline at end of file diff --git a/gui/react/src/components/AddToQueue/DownloadSelector/Listing/EpisodeListing.tsx b/gui/react/src/components/AddToQueue/DownloadSelector/Listing/EpisodeListing.tsx index 2249068..a59cf77 100644 --- a/gui/react/src/components/AddToQueue/DownloadSelector/Listing/EpisodeListing.tsx +++ b/gui/react/src/components/AddToQueue/DownloadSelector/Listing/EpisodeListing.tsx @@ -7,185 +7,185 @@ import { useSnackbar } from 'notistack'; const EpisodeListing: React.FC = () => { - const [store, dispatch] = useStore(); + const [store, dispatch] = useStore(); - const [season, setSeason] = React.useState<'all'|string>('all'); - const { enqueueSnackbar } = useSnackbar(); + const [season, setSeason] = React.useState<'all'|string>('all'); + const { enqueueSnackbar } = useSnackbar(); - const seasons = React.useMemo(() => { - const s: string[] = []; - for (const {season} of store.episodeListing) { - if (s.includes(season)) - continue; - s.push(season); - } - return s; - }, [ store.episodeListing ]); + const seasons = React.useMemo(() => { + const s: string[] = []; + for (const {season} of store.episodeListing) { + if (s.includes(season)) + continue; + s.push(season); + } + return s; + }, [ store.episodeListing ]); - const [selected, setSelected] = React.useState([]); + const [selected, setSelected] = React.useState([]); - React.useEffect(() => { - setSelected(parseSelect(store.downloadOptions.e)); - }, [ store.episodeListing ]); + React.useEffect(() => { + setSelected(parseSelect(store.downloadOptions.e)); + }, [ store.episodeListing ]); - const close = () => { - dispatch({ - type: 'episodeListing', - payload: [] - }); - dispatch({ - type: 'downloadOptions', - payload: { - ...store.downloadOptions, - e: `${([...new Set([...parseSelect(store.downloadOptions.e), ...selected])]).join(',')}` - } - }); - }; + const close = () => { + dispatch({ + type: 'episodeListing', + payload: [] + }); + dispatch({ + type: 'downloadOptions', + payload: { + ...store.downloadOptions, + e: `${([...new Set([...parseSelect(store.downloadOptions.e), ...selected])]).join(',')}` + } + }); + }; - const getEpisodesForSeason = (season: string|'all') => { - return store.episodeListing.filter((a) => season === 'all' ? true : a.season === season); - }; + const getEpisodesForSeason = (season: string|'all') => { + return store.episodeListing.filter((a) => season === 'all' ? true : a.season === season); + }; - return 0} onClose={close} scroll='paper' maxWidth='xl' sx={{ p: 2 }}> - - + return 0} onClose={close} scroll='paper' maxWidth='xl' sx={{ p: 2 }}> + + Episodes - - - Season - - - - - - selected.includes(a.e)) && !store.episodeListing.every(a => selected.includes(a.e))} - checked={store.episodeListing.every(a => selected.includes(a.e))} - onChange={() => { - if (selected.length > 0) { - setSelected([]); - } else { - setSelected(getEpisodesForSeason(season).map(a => a.e)); - } - }} - /> - - {getEpisodesForSeason(season).map((item, index, { length }) => { - const e = isNaN(parseInt(item.e)) ? item.e : parseInt(item.e); - const idStr = `S${item.season}E${e}`; - const isSelected = selected.includes(e.toString()); - const imageRef = React.createRef(); - const summaryRef = React.createRef(); - return - { - let arr: string[] = []; - if (isSelected) { - arr = [...selected.filter(a => a !== e.toString())]; - } else { - arr = [...selected, e.toString()]; - } - setSelected(arr.filter(a => a.length > 0)); - }}> - { isSelected ? : } - - {idStr} - thumbnail - - - - {item.name} - - - {item.time.startsWith('00:') ? item.time.slice(3) : item.time} - - - - {item.description} - - - -
+ + Season + + +
+ + + selected.includes(a.e)) && !store.episodeListing.every(a => selected.includes(a.e))} + checked={store.episodeListing.every(a => selected.includes(a.e))} + onChange={() => { + if (selected.length > 0) { + setSelected([]); + } else { + setSelected(getEpisodesForSeason(season).map(a => a.e)); + } + }} + /> + + {getEpisodesForSeason(season).map((item, index, { length }) => { + const e = isNaN(parseInt(item.e)) ? item.e : parseInt(item.e); + const idStr = `S${item.season}E${e}`; + const isSelected = selected.includes(e.toString()); + const imageRef = React.createRef(); + const summaryRef = React.createRef(); + return + { + let arr: string[] = []; + if (isSelected) { + arr = [...selected.filter(a => a !== e.toString())]; + } else { + arr = [...selected, e.toString()]; + } + setSelected(arr.filter(a => a.length > 0)); + }}> + { isSelected ? : } + + {idStr} + + thumbnail + + + + {item.name} + + + {item.time.startsWith('00:') ? item.time.slice(3) : item.time} + + + + {item.description} + + + +
Available audio languages: {item.lang.join(', ')} -
-
-
-
- { - await navigator.clipboard.writeText(item.img); - enqueueSnackbar('Copied URL to clipboard', { - variant: 'info' - }); - }}, - { - text: 'Open image in new tab', - onClick: () => { - window.open(item.img); - } - } ]} popupItem={imageRef as RefObject} /> - { - await navigator.clipboard.writeText(item.description!); - enqueueSnackbar('Copied summary to clipboard', { - variant: 'info' - }); - }, - text: 'Copy summary to clipboard' - } - ]} popupItem={summaryRef as RefObject} /> - {index < length - 1 && } -
; - })} -
-
; +
+
+
+ + { + await navigator.clipboard.writeText(item.img); + enqueueSnackbar('Copied URL to clipboard', { + variant: 'info' + }); + }}, + { + text: 'Open image in new tab', + onClick: () => { + window.open(item.img); + } + } ]} popupItem={imageRef as RefObject} /> + { + await navigator.clipboard.writeText(item.description!); + enqueueSnackbar('Copied summary to clipboard', { + variant: 'info' + }); + }, + text: 'Copy summary to clipboard' + } + ]} popupItem={summaryRef as RefObject} /> + {index < length - 1 && } +
; + })} + + ; }; const parseSelect = (s: string): string[] => { - const ret: string[] = []; - s.split(',').forEach(item => { - if (item.includes('-')) { - const split = item.split('-'); - if (split.length !== 2) - return; - const match = split[0].match(/[A-Za-z]+/); - if (match && match.length > 0) { - if (match.index && match.index !== 0) { - return; - } - const letters = split[0].substring(0, match[0].length); - const number = parseInt(split[0].substring(match[0].length)); - const b = parseInt(split[1]); - if (isNaN(number) || isNaN(b)) { - return; - } - for (let i = number; i <= b; i++) { - ret.push(`${letters}${i}`); - } + const ret: string[] = []; + s.split(',').forEach(item => { + if (item.includes('-')) { + const split = item.split('-'); + if (split.length !== 2) + return; + const match = split[0].match(/[A-Za-z]+/); + if (match && match.length > 0) { + if (match.index && match.index !== 0) { + return; + } + const letters = split[0].substring(0, match[0].length); + const number = parseInt(split[0].substring(match[0].length)); + const b = parseInt(split[1]); + if (isNaN(number) || isNaN(b)) { + return; + } + for (let i = number; i <= b; i++) { + ret.push(`${letters}${i}`); + } - } else { - const a = parseInt(split[0]); - const b = parseInt(split[1]); - if (isNaN(a) || isNaN(b)) { - return; + } else { + const a = parseInt(split[0]); + const b = parseInt(split[1]); + if (isNaN(a) || isNaN(b)) { + return; + } + for (let i = a; i <= b; i++) { + ret.push(`${i}`); + } + } + } else { + ret.push(item); } - for (let i = a; i <= b; i++) { - ret.push(`${i}`); - } - } - } else { - ret.push(item); - } - }); - return [...new Set(ret)]; + }); + return [...new Set(ret)]; }; export default EpisodeListing; diff --git a/gui/react/src/components/AddToQueue/SearchBox/SearchBox.tsx b/gui/react/src/components/AddToQueue/SearchBox/SearchBox.tsx index 6c4e2e6..b494f33 100644 --- a/gui/react/src/components/AddToQueue/SearchBox/SearchBox.tsx +++ b/gui/react/src/components/AddToQueue/SearchBox/SearchBox.tsx @@ -8,112 +8,112 @@ import ContextMenu from '../../reusable/ContextMenu'; import { useSnackbar } from 'notistack'; const SearchBox: React.FC = () => { - const messageHandler = React.useContext(messageChannelContext); - const [store, dispatch] = useStore(); - const [search, setSearch] = React.useState(''); + const messageHandler = React.useContext(messageChannelContext); + const [store, dispatch] = useStore(); + const [search, setSearch] = React.useState(''); - const [focus, setFocus] = React.useState(false); + const [focus, setFocus] = React.useState(false); - const [searchResult, setSearchResult] = React.useState(); - const anchor = React.useRef(null); + const [searchResult, setSearchResult] = React.useState(); + const anchor = React.useRef(null); - const { enqueueSnackbar } = useSnackbar(); + const { enqueueSnackbar } = useSnackbar(); - const selectItem = (id: string) => { - dispatch({ - type: 'downloadOptions', - payload: { - ...store.downloadOptions, - id - } - }); - }; + const selectItem = (id: string) => { + dispatch({ + type: 'downloadOptions', + payload: { + ...store.downloadOptions, + id + } + }); + }; - React.useEffect(() => { - if (search.trim().length === 0) - return setSearchResult({ isOk: true, value: [] }); + React.useEffect(() => { + if (search.trim().length === 0) + return setSearchResult({ isOk: true, value: [] }); - const timeOutId = setTimeout(async () => { - if (search.trim().length > 3) { - const s = await messageHandler?.search({search}); - if (s && s.isOk) - s.value = s.value.slice(0, 10); - setSearchResult(s); - } - }, 500); - return () => clearTimeout(timeOutId); - }, [search]); + const timeOutId = setTimeout(async () => { + if (search.trim().length > 3) { + const s = await messageHandler?.search({search}); + if (s && s.isOk) + s.value = s.value.slice(0, 10); + setSearchResult(s); + } + }, 500); + return () => clearTimeout(timeOutId); + }, [search]); - const anchorBounding = anchor.current?.getBoundingClientRect(); - return setFocus(false)}> - - setFocus(true)} onChange={e => setSearch(e.target.value)} variant='outlined' label='Search' fullWidth /> - {searchResult !== undefined && searchResult.isOk && searchResult.value.length > 0 && focus && + const anchorBounding = anchor.current?.getBoundingClientRect(); + return setFocus(false)}> + + setFocus(true)} onChange={e => setSearch(e.target.value)} variant='outlined' label='Search' fullWidth /> + {searchResult !== undefined && searchResult.isOk && searchResult.value.length > 0 && focus && - - {searchResult && searchResult.isOk ? - searchResult.value.map((a, ind, arr) => { - const imageRef = React.createRef(); - const summaryRef = React.createRef(); - return - { - selectItem(a.id); - setFocus(false); - }}> - - - thumbnail - - - - {a.name} - - {a.desc && - {a.desc} - } - {a.lang && + left: anchorBounding?.x, top: (anchorBounding?.y ?? 0) + (anchorBounding?.height ?? 0), zIndex: 99, overflowY: 'scroll'}}> + + {searchResult && searchResult.isOk ? + searchResult.value.map((a, ind, arr) => { + const imageRef = React.createRef(); + const summaryRef = React.createRef(); + return + { + selectItem(a.id); + setFocus(false); + }}> + + + thumbnail + + + + {a.name} + + {a.desc && + {a.desc} + } + {a.lang && Languages: {a.lang.join(', ')} - } - + } + ID: {a.id} - - - - - { - await navigator.clipboard.writeText(a.image); - enqueueSnackbar('Copied URL to clipboard', { - variant: 'info' - }); - }}, - { - text: 'Open image in new tab', - onClick: () => { - window.open(a.image); - } - } ]} popupItem={imageRef as RefObject} /> - {a.desc && + + + + + { + await navigator.clipboard.writeText(a.image); + enqueueSnackbar('Copied URL to clipboard', { + variant: 'info' + }); + }}, + { + text: 'Open image in new tab', + onClick: () => { + window.open(a.image); + } + } ]} popupItem={imageRef as RefObject} /> + {a.desc && { - await navigator.clipboard.writeText(a.desc!); - enqueueSnackbar('Copied summary to clipboard', { - variant: 'info' - }); - }, - text: 'Copy summary to clipboard' - } + { + onClick: async () => { + await navigator.clipboard.writeText(a.desc!); + enqueueSnackbar('Copied summary to clipboard', { + variant: 'info' + }); + }, + text: 'Copy summary to clipboard' + } ]} popupItem={summaryRef as RefObject} /> - } - {(ind < arr.length - 1) && } - ; - }) - : <>} - + } + {(ind < arr.length - 1) && } + ; + }) + : <>} + } - - ; + + ; }; export default SearchBox; diff --git a/gui/react/src/components/AuthButton.tsx b/gui/react/src/components/AuthButton.tsx index 8f5d273..a218afb 100644 --- a/gui/react/src/components/AuthButton.tsx +++ b/gui/react/src/components/AuthButton.tsx @@ -6,107 +6,107 @@ import Require from './Require'; import { useSnackbar } from 'notistack'; const AuthButton: React.FC = () => { - const snackbar = useSnackbar(); + const snackbar = useSnackbar(); - const [open, setOpen] = React.useState(false); + const [open, setOpen] = React.useState(false); - const [username, setUsername] = React.useState(''); - const [password, setPassword] = React.useState(''); + const [username, setUsername] = React.useState(''); + const [password, setPassword] = React.useState(''); - const [usernameError, setUsernameError] = React.useState(false); - const [passwordError, setPasswordError] = React.useState(false); + const [usernameError, setUsernameError] = React.useState(false); + const [passwordError, setPasswordError] = React.useState(false); - const messageChannel = React.useContext(messageChannelContext); + const messageChannel = React.useContext(messageChannelContext); - const [loading, setLoading] = React.useState(false); - const [error, setError] = React.useState(undefined); - const [authed, setAuthed] = React.useState(false); + const [loading, setLoading] = React.useState(false); + const [error, setError] = React.useState(undefined); + const [authed, setAuthed] = React.useState(false); - const checkAuth = async () => { - setAuthed((await messageChannel?.checkToken())?.isOk ?? false); - }; + const checkAuth = async () => { + setAuthed((await messageChannel?.checkToken())?.isOk ?? false); + }; - React.useEffect(() => { checkAuth(); }, []); + React.useEffect(() => { checkAuth(); }, []); - const handleSubmit = async () => { - if (!messageChannel) - throw new Error('Invalid state'); //The components to confirm only render if the messageChannel is not undefinded - if (username.trim().length === 0) - return setUsernameError(true); - if (password.trim().length === 0) - return setPasswordError(true); - setUsernameError(false); - setPasswordError(false); - setLoading(true); + const handleSubmit = async () => { + if (!messageChannel) + throw new Error('Invalid state'); //The components to confirm only render if the messageChannel is not undefinded + if (username.trim().length === 0) + return setUsernameError(true); + if (password.trim().length === 0) + return setPasswordError(true); + setUsernameError(false); + setPasswordError(false); + setLoading(true); - const res = await messageChannel.auth({ username, password }); - if (res.isOk) { - setOpen(false); - snackbar.enqueueSnackbar('Logged in', { - variant: 'success' - }); - setUsername(''); - setPassword(''); - } else { - setError(res.reason); - } - await checkAuth(); - setLoading(false); - }; + const res = await messageChannel.auth({ username, password }); + if (res.isOk) { + setOpen(false); + snackbar.enqueueSnackbar('Logged in', { + variant: 'success' + }); + setUsername(''); + setPassword(''); + } else { + setError(res.reason); + } + await checkAuth(); + setLoading(false); + }; - return - - - Error during Authentication - - {error?.name} - {error?.message} - - - - - - Authentication - - + return + + + Error during Authentication + + {error?.name} + {error?.message} + + + + + + Authentication + + Here, you need to enter your username (most likely your Email) and your password.
These information are not stored anywhere and are only used to authenticate with the service once. -
- setUsername(e.target.value)} - disabled={loading} - /> - setPassword(e.target.value)} - disabled={loading} - /> -
- - {loading && } - - - -
- -
; +
+ setUsername(e.target.value)} + disabled={loading} + /> + setPassword(e.target.value)} + disabled={loading} + /> +
+ + {loading && } + + + +
+ +
; }; export default AuthButton; \ No newline at end of file diff --git a/gui/react/src/components/LogoutButton.tsx b/gui/react/src/components/LogoutButton.tsx index 916db7a..83283d7 100644 --- a/gui/react/src/components/LogoutButton.tsx +++ b/gui/react/src/components/LogoutButton.tsx @@ -6,31 +6,31 @@ import { messageChannelContext } from '../provider/MessageChannel'; import Require from './Require'; const LogoutButton: React.FC = () => { - const messageChannel = React.useContext(messageChannelContext); - const [, dispatch] = useStore(); + const messageChannel = React.useContext(messageChannelContext); + const [, dispatch] = useStore(); - const logout = async () => { - if (await messageChannel?.isDownloading()) - return alert('You are currently downloading. Please finish the download first.'); - if (await messageChannel?.logout()) - dispatch({ - type: 'service', - payload: undefined - }); - else - alert('Unable to change service'); - }; + const logout = async () => { + if (await messageChannel?.isDownloading()) + return alert('You are currently downloading. Please finish the download first.'); + if (await messageChannel?.logout()) + dispatch({ + type: 'service', + payload: undefined + }); + else + alert('Unable to change service'); + }; - return - - ; + + ; }; diff --git a/gui/react/src/components/MainFrame/DownloadManager/DownloadManager.tsx b/gui/react/src/components/MainFrame/DownloadManager/DownloadManager.tsx index 7917707..ee78ac5 100644 --- a/gui/react/src/components/MainFrame/DownloadManager/DownloadManager.tsx +++ b/gui/react/src/components/MainFrame/DownloadManager/DownloadManager.tsx @@ -4,37 +4,37 @@ import { RandomEvent } from '../../../../../../@types/randomEvents'; import { messageChannelContext } from '../../../provider/MessageChannel'; const useDownloadManager = () => { - const messageHandler = React.useContext(messageChannelContext); + const messageHandler = React.useContext(messageChannelContext); - const [progressData, setProgressData] = React.useState(); - const [current, setCurrent] = React.useState(); + const [progressData, setProgressData] = React.useState(); + const [current, setCurrent] = React.useState(); - React.useEffect(() => { - const handler = (ev: RandomEvent<'progress'>) => { - console.log(ev.data); - setProgressData(ev.data); - }; + React.useEffect(() => { + const handler = (ev: RandomEvent<'progress'>) => { + console.log(ev.data); + setProgressData(ev.data); + }; - const currentHandler = (ev: RandomEvent<'current'>) => { - setCurrent(ev.data); - }; + const currentHandler = (ev: RandomEvent<'current'>) => { + setCurrent(ev.data); + }; - const finishHandler = () => { - setProgressData(undefined); - }; + const finishHandler = () => { + setProgressData(undefined); + }; - messageHandler?.randomEvents.on('progress', handler); - messageHandler?.randomEvents.on('current', currentHandler); - messageHandler?.randomEvents.on('finish', finishHandler); + messageHandler?.randomEvents.on('progress', handler); + messageHandler?.randomEvents.on('current', currentHandler); + messageHandler?.randomEvents.on('finish', finishHandler); - return () => { - messageHandler?.randomEvents.removeListener('progress', handler); - messageHandler?.randomEvents.removeListener('finish', finishHandler); - messageHandler?.randomEvents.removeListener('current', currentHandler); - }; - }, [messageHandler]); + return () => { + messageHandler?.randomEvents.removeListener('progress', handler); + messageHandler?.randomEvents.removeListener('finish', finishHandler); + messageHandler?.randomEvents.removeListener('current', currentHandler); + }; + }, [messageHandler]); - return { data: progressData, current}; + return { data: progressData, current}; }; export default useDownloadManager; \ No newline at end of file diff --git a/gui/react/src/components/MainFrame/MainFrame.tsx b/gui/react/src/components/MainFrame/MainFrame.tsx index 425b321..1e387e5 100644 --- a/gui/react/src/components/MainFrame/MainFrame.tsx +++ b/gui/react/src/components/MainFrame/MainFrame.tsx @@ -3,9 +3,9 @@ import React from 'react'; import Queue from './Queue/Queue'; const MainFrame: React.FC = () => { - return - - ; + return + + ; }; export default MainFrame; \ No newline at end of file diff --git a/gui/react/src/components/MainFrame/Queue/Queue.tsx b/gui/react/src/components/MainFrame/Queue/Queue.tsx index 7707f74..96aa825 100644 --- a/gui/react/src/components/MainFrame/Queue/Queue.tsx +++ b/gui/react/src/components/MainFrame/Queue/Queue.tsx @@ -7,414 +7,414 @@ import DeleteIcon from '@mui/icons-material/Delete'; import useDownloadManager from '../DownloadManager/DownloadManager'; const Queue: React.FC = () => { - const { data, current } = useDownloadManager(); - const queue = React.useContext(queueContext); - const msg = React.useContext(messageChannelContext); + const { data, current } = useDownloadManager(); + const queue = React.useContext(queueContext); + const msg = React.useContext(messageChannelContext); - if (!msg) - return <>Never; + if (!msg) + return <>Never; - return data || queue.length > 0 ? <> - {data && <> - - - Thumbnail - + return data || queue.length > 0 ? <> + {data && <> - - - - {data.downloadInfo.parent.title} - - - {data.downloadInfo.title} - - - - - - Downloading: {data.downloadInfo.language.name} - - - - - - - - {data.progress.cur} / {(data.progress.total)} parts ({data.progress.percent}% | {formatTime(data.progress.time)} | {(data.progress.downloadSpeed / 1024 / 1024).toFixed(2)} MB/s | {(data.progress.bytes / 1024 / 1024).toFixed(2)}MB) - - - - - - - - } - { - current && !data && <> - - - Thumbnail - - - - - - {current.parent.title} - - - {current.title} - - - - - - - Downloading: - - - - - - - + + Thumbnail + + + + + + {data.downloadInfo.parent.title} + + + {data.downloadInfo.title} + + + + + + Downloading: {data.downloadInfo.language.name} + + + + + + + + {data.progress.cur} / {(data.progress.total)} parts ({data.progress.percent}% | {formatTime(data.progress.time)} | {(data.progress.downloadSpeed / 1024 / 1024).toFixed(2)} MB/s | {(data.progress.bytes / 1024 / 1024).toFixed(2)}MB) + + + + + + + + } + { + current && !data && <> + + + Thumbnail + + + + + + {current.parent.title} + + + {current.title} + + + + + + + Downloading: + + + + + + + + + + 0 / ? parts (0% | XX:XX | 0 MB/s | 0MB) + + + + + + + + } + {queue.map((queueItem, index, { length }) => { + return + - - + Thumbnail + - 0 / ? parts (0% | XX:XX | 0 MB/s | 0MB) - + + + {queueItem.parent.title} + + + S{queueItem.parent.season}E{queueItem.episode} + + + {queueItem.title} + + + + + Dub(s): {queueItem.dubLang.join(', ')} + + + Sub(s): {queueItem.dlsubs.join(', ')} + + + Quality: {queueItem.q} + + + + + { + msg.removeFromQueue(index); + }} + sx={{ + backgroundColor: '#ff573a25', + height: '40px', + transition: '250ms', + '&:hover' : { + backgroundColor: '#ff573a', + } + }}> + + + + + - - - - - } - {queue.map((queueItem, index, { length }) => { - return : - + - Thumbnail - - - - {queueItem.parent.title} - - - S{queueItem.parent.season}E{queueItem.episode} - - - {queueItem.title} - - - - - Dub(s): {queueItem.dubLang.join(', ')} - - - Sub(s): {queueItem.dlsubs.join(', ')} - - - Quality: {queueItem.q} - - - - - { - msg.removeFromQueue(index); - }} - sx={{ - backgroundColor: '#ff573a25', - height: '40px', - transition: '250ms', - '&:hover' : { - backgroundColor: '#ff573a', - } - }}> - - - - - - - - ; - })} - : - Selected episodes will be shown here - - - - - - - - - - - - - - - - ; + + + + + + + + + + + + + + + + ; }; const formatTime = (time: number) => { - time = Math.floor(time / 1000); - const minutes = Math.floor(time / 60); - time = time % 60; + time = Math.floor(time / 1000); + const minutes = Math.floor(time / 60); + time = time % 60; - return `${minutes.toFixed(0).length < 2 ? `0${minutes}` : minutes}m${time.toFixed(0).length < 2 ? `0${time}` : time}s`; + return `${minutes.toFixed(0).length < 2 ? `0${minutes}` : minutes}m${time.toFixed(0).length < 2 ? `0${time}` : time}s`; }; export default Queue; \ No newline at end of file diff --git a/gui/react/src/components/MenuBar/MenuBar.tsx b/gui/react/src/components/MenuBar/MenuBar.tsx index 00f5ed8..dc48ab7 100644 --- a/gui/react/src/components/MenuBar/MenuBar.tsx +++ b/gui/react/src/components/MenuBar/MenuBar.tsx @@ -5,120 +5,120 @@ import useStore from '../../hooks/useStore'; import { StoreState } from '../../provider/Store'; const MenuBar: React.FC = () => { - const [ openMenu, setMenuOpen ] = React.useState<'settings'|'help'|undefined>(); - const [anchorEl, setAnchorEl] = React.useState(null); - const [store, dispatch] = useStore(); + const [ openMenu, setMenuOpen ] = React.useState<'settings'|'help'|undefined>(); + const [anchorEl, setAnchorEl] = React.useState(null); + const [store, dispatch] = useStore(); - const messageChannel = React.useContext(messageChannelContext); + const messageChannel = React.useContext(messageChannelContext); - React.useEffect(() => { - (async () => { - if (!messageChannel || store.version !== '') - return; - dispatch({ - type: 'version', - payload: await messageChannel.version() - }); - })(); - }, [messageChannel]); + React.useEffect(() => { + (async () => { + if (!messageChannel || store.version !== '') + return; + dispatch({ + type: 'version', + payload: await messageChannel.version() + }); + })(); + }, [messageChannel]); - const transformService = (service: StoreState['service']) => { - switch(service) { - case 'crunchy': - return 'Crunchyroll'; - case 'hidive': - return 'Hidive'; - case 'ao': - return 'AnimeOnegai'; - case 'adn': - return 'AnimationDigitalNetwork'; - } - }; + const transformService = (service: StoreState['service']) => { + switch(service) { + case 'crunchy': + return 'Crunchyroll'; + case 'hidive': + return 'Hidive'; + case 'ao': + return 'AnimeOnegai'; + case 'adn': + return 'AnimationDigitalNetwork'; + } + }; - const msg = React.useContext(messageChannelContext); + const msg = React.useContext(messageChannelContext); - const handleClick = (event: React.MouseEvent, n: 'settings'|'help') => { - setAnchorEl(event.currentTarget); - setMenuOpen(n); - }; - const handleClose = () => { - setAnchorEl(null); - setMenuOpen(undefined); - }; + const handleClick = (event: React.MouseEvent, n: 'settings'|'help') => { + setAnchorEl(event.currentTarget); + setMenuOpen(n); + }; + const handleClose = () => { + setAnchorEl(null); + setMenuOpen(undefined); + }; - if (!msg) - return <>; + if (!msg) + return <>; - return - - - + - - - { - msg.openFolder('config'); - handleClose(); - }}> + + + + { + msg.openFolder('config'); + handleClose(); + }}> Open settings folder - - { - msg.openFile(['config', 'bin-path.yml']); - handleClose(); - }}> + + { + msg.openFile(['config', 'bin-path.yml']); + handleClose(); + }}> Open FFmpeg/Mkvmerge file - - { - msg.openFile(['config', 'cli-defaults.yml']); - handleClose(); - }}> + + { + msg.openFile(['config', 'cli-defaults.yml']); + handleClose(); + }}> Open advanced options - - { - msg.openFolder('content'); - handleClose(); - }}> + + { + msg.openFolder('content'); + handleClose(); + }}> Open output path - - - - { - msg.openURL('https://github.com/anidl/multi-downloader-nx'); - handleClose(); - }}> + + + + { + msg.openURL('https://github.com/anidl/multi-downloader-nx'); + handleClose(); + }}> GitHub - - { - msg.openURL('https://github.com/anidl/multi-downloader-nx/issues/new?assignees=AnimeDL,AnidlSupport&labels=bug&template=bug.yml&title=BUG'); - handleClose(); - }}> + + { + msg.openURL('https://github.com/anidl/multi-downloader-nx/issues/new?assignees=AnimeDL,AnidlSupport&labels=bug&template=bug.yml&title=BUG'); + handleClose(); + }}> Report a bug - - { - msg.openURL('https://github.com/anidl/multi-downloader-nx/graphs/contributors'); - handleClose(); - }}> + + { + msg.openURL('https://github.com/anidl/multi-downloader-nx/graphs/contributors'); + handleClose(); + }}> Contributors - - { - msg.openURL('https://discord.gg/qEpbWen5vq'); - handleClose(); - }}> + + { + msg.openURL('https://discord.gg/qEpbWen5vq'); + handleClose(); + }}> Discord - - { - handleClose(); - }}> + + { + handleClose(); + }}> Version: {store.version} - - - - {transformService(store.service)} - - ; + + + + {transformService(store.service)} + + ; }; export default MenuBar; diff --git a/gui/react/src/components/Require.tsx b/gui/react/src/components/Require.tsx index 847541f..8c2827d 100644 --- a/gui/react/src/components/Require.tsx +++ b/gui/react/src/components/Require.tsx @@ -6,9 +6,9 @@ export type RequireType = { } const Require = (props: React.PropsWithChildren>) => { - return props.value === undefined ? - - : {props.children}; + return props.value === undefined ? + + : {props.children}; }; export default Require; \ No newline at end of file diff --git a/gui/react/src/components/StartQueue.tsx b/gui/react/src/components/StartQueue.tsx index 05b630c..71eb834 100644 --- a/gui/react/src/components/StartQueue.tsx +++ b/gui/react/src/components/StartQueue.tsx @@ -5,37 +5,37 @@ import { messageChannelContext } from '../provider/MessageChannel'; import Require from './Require'; const StartQueueButton: React.FC = () => { - const messageChannel = React.useContext(messageChannelContext); - const [start, setStart] = React.useState(false); - const msg = React.useContext(messageChannelContext); + const messageChannel = React.useContext(messageChannelContext); + const [start, setStart] = React.useState(false); + const msg = React.useContext(messageChannelContext); - React.useEffect(() => { - (async () => { - if (!msg) - return alert('Invalid state: msg not found'); - setStart(await msg.getDownloadQueue()); - })(); - }, []); + React.useEffect(() => { + (async () => { + if (!msg) + return alert('Invalid state: msg not found'); + setStart(await msg.getDownloadQueue()); + })(); + }, []); - const change = async () => { - if (await messageChannel?.isDownloading()) - alert('The current download will be finished before the queue stops'); - msg?.setDownloadQueue(!start); - setStart(!start); - }; + const change = async () => { + if (await messageChannel?.isDownloading()) + alert('The current download will be finished before the queue stops'); + msg?.setDownloadQueue(!start); + setStart(!start); + }; - return - - ; + return + + ; }; diff --git a/gui/react/src/components/reusable/ContextMenu.tsx b/gui/react/src/components/reusable/ContextMenu.tsx index dc08610..41fa4a6 100644 --- a/gui/react/src/components/reusable/ContextMenu.tsx +++ b/gui/react/src/components/reusable/ContextMenu.tsx @@ -12,54 +12,54 @@ export type ContextMenuProps = { } const buttonSx: SxProps = { - '&:hover': { - background: 'rgb(0, 30, 60)' - }, - fontSize: '0.7rem', - minHeight: '30px', - justifyContent: 'center', - p: 0 + '&:hover': { + background: 'rgb(0, 30, 60)' + }, + fontSize: '0.7rem', + minHeight: '30px', + justifyContent: 'center', + p: 0 }; function ContextMenu(props: ContextMenuProps) { - const [anchor, setAnchor] = React.useState( { x: 0, y: 0 } ); + const [anchor, setAnchor] = React.useState( { x: 0, y: 0 } ); - const [show, setShow] = React.useState(false); + const [show, setShow] = React.useState(false); - React.useEffect(() => { - const { popupItem: ref } = props; - if (ref.current === null) - return; - const listener = (ev: MouseEvent) => { - ev.preventDefault(); - setAnchor({ x: ev.x + 10, y: ev.y + 10 }); - setShow(true); - }; - ref.current.addEventListener('contextmenu', listener); + React.useEffect(() => { + const { popupItem: ref } = props; + if (ref.current === null) + return; + const listener = (ev: MouseEvent) => { + ev.preventDefault(); + setAnchor({ x: ev.x + 10, y: ev.y + 10 }); + setShow(true); + }; + ref.current.addEventListener('contextmenu', listener); - return () => { - if (ref.current) - ref.current.removeEventListener('contextmenu', listener); - }; - }, [ props.popupItem ]); + return () => { + if (ref.current) + ref.current.removeEventListener('contextmenu', listener); + }; + }, [ props.popupItem ]); - return show ? - - {props.options.map((item, i) => { - return item === 'divider' ? : - ; - })} - - ; + })} + + - - : <>; + + + : <>; } export default ContextMenu; diff --git a/gui/react/src/components/reusable/LinearProgressWithLabel.tsx b/gui/react/src/components/reusable/LinearProgressWithLabel.tsx index 28ac451..295251b 100644 --- a/gui/react/src/components/reusable/LinearProgressWithLabel.tsx +++ b/gui/react/src/components/reusable/LinearProgressWithLabel.tsx @@ -7,18 +7,18 @@ import React from 'react'; export type LinearProgressWithLabelProps = LinearProgressProps & { value: number }; const LinearProgressWithLabel: React.FC = (props) => { - return ( - - - - - - {`${Math.round( - props.value, - )}%`} - - - ); + return ( + + + + + + {`${Math.round( + props.value, + )}%`} + + + ); }; export default LinearProgressWithLabel; \ No newline at end of file diff --git a/gui/react/src/components/reusable/MultiSelect.tsx b/gui/react/src/components/reusable/MultiSelect.tsx index 5e3b272..56ae3e7 100644 --- a/gui/react/src/components/reusable/MultiSelect.tsx +++ b/gui/react/src/components/reusable/MultiSelect.tsx @@ -12,63 +12,63 @@ export type MultiSelectProps = { const ITEM_HEIGHT = 48; const ITEM_PADDING_TOP = 8; const MenuProps = { - PaperProps: { - style: { - maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP, - width: 250 + PaperProps: { + style: { + maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP, + width: 250 + } } - } }; function getStyles(name: string, personName: readonly string[], theme: Theme) { - return { - fontWeight: + return { + fontWeight: (personName ?? []).indexOf(name) === -1 - ? theme.typography.fontWeightRegular - : theme.typography.fontWeightMedium - }; + ? theme.typography.fontWeightRegular + : theme.typography.fontWeightMedium + }; } const MultiSelect: React.FC = (props) => { - const theme = useTheme(); + const theme = useTheme(); - return
- - {props.title} - - -
; + return
+ + {props.title} + + +
; }; export default MultiSelect; \ No newline at end of file diff --git a/gui/react/src/hooks/useStore.tsx b/gui/react/src/hooks/useStore.tsx index 9d9b302..3c3699d 100644 --- a/gui/react/src/hooks/useStore.tsx +++ b/gui/react/src/hooks/useStore.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { StoreAction, StoreContext, StoreState } from '../provider/Store'; const useStore = () => { - const context = React.useContext(StoreContext as unknown as React.Context<[StoreState, React.Dispatch>]>); - if (!context) { - throw new Error('useStore must be used under Store'); - } - return context; + const context = React.useContext(StoreContext as unknown as React.Context<[StoreState, React.Dispatch>]>); + if (!context) { + throw new Error('useStore must be used under Store'); + } + return context; }; export default useStore; \ No newline at end of file diff --git a/gui/react/src/index.tsx b/gui/react/src/index.tsx index 42f0a07..ebaa1cd 100644 --- a/gui/react/src/index.tsx +++ b/gui/react/src/index.tsx @@ -17,35 +17,35 @@ document.body.style.justifyContent = 'center'; const notistackRef = React.createRef(); const onClickDismiss = (key: SnackbarKey | undefined) => () => { - if (notistackRef.current) - notistackRef.current.closeSnackbar(key); + if (notistackRef.current) + notistackRef.current.closeSnackbar(key); }; const container = document.getElementById('root'); const root = createRoot(container as HTMLElement); root.render( - - - ( - - - - )} - > - - - - + + + ( + + + + )} + > + + + + ); \ No newline at end of file diff --git a/gui/react/src/provider/ErrorHandler.tsx b/gui/react/src/provider/ErrorHandler.tsx index e2ae86f..e5135ba 100644 --- a/gui/react/src/provider/ErrorHandler.tsx +++ b/gui/react/src/provider/ErrorHandler.tsx @@ -10,30 +10,30 @@ export default class ErrorHandler extends React.Component<{ } }> { - constructor(props: { + constructor(props: { children: React.ReactNode|React.ReactNode[] }) { - super(props); - this.state = { error: undefined }; - } + super(props); + this.state = { error: undefined }; + } - componentDidCatch(er: Error, stack: React.ErrorInfo) { - this.setState({ error: { er, stack } }); - } + componentDidCatch(er: Error, stack: React.ErrorInfo) { + this.setState({ error: { er, stack } }); + } - render(): React.ReactNode { - return this.state.error ? - - - {`${this.state.error.er.name}: ${this.state.error.er.message}`} -
- {this.state.error.stack.componentStack?.split('\n').map(a => { - return <> - {a} -
- ; - })} -
-
: this.props.children; - } + render(): React.ReactNode { + return this.state.error ? + + + {`${this.state.error.er.name}: ${this.state.error.er.message}`} +
+ {this.state.error.stack.componentStack?.split('\n').map(a => { + return <> + {a} +
+ ; + })} +
+
: this.props.children; + } } \ No newline at end of file diff --git a/gui/react/src/provider/MessageChannel.tsx b/gui/react/src/provider/MessageChannel.tsx index 56e6147..f0f0768 100644 --- a/gui/react/src/provider/MessageChannel.tsx +++ b/gui/react/src/provider/MessageChannel.tsx @@ -12,233 +12,233 @@ import { GUIConfig } from '../../../../modules/module.cfg-loader'; export type FrontEndMessages = (MessageHandler & { randomEvents: RandomEventHandler, logout: () => Promise }); export class RandomEventHandler { - private handler: { + private handler: { [eventName in keyof RandomEvents]: Handler[] } = { - progress: [], - finish: [], - queueChange: [], - current: [] - }; + progress: [], + finish: [], + queueChange: [], + current: [] + }; - public on(name: T, listener: Handler) { - if (Object.prototype.hasOwnProperty.call(this.handler, name)) { - this.handler[name].push(listener as any); - } else { - this.handler[name] = [ listener as any ]; + public on(name: T, listener: Handler) { + if (Object.prototype.hasOwnProperty.call(this.handler, name)) { + this.handler[name].push(listener as any); + } else { + this.handler[name] = [ listener as any ]; + } } - } - public emit(name: keyof RandomEvents, data: RandomEvent) { - (this.handler[name] ?? []).forEach(handler => handler(data as any)); - } + public emit(name: keyof RandomEvents, data: RandomEvent) { + (this.handler[name] ?? []).forEach(handler => handler(data as any)); + } - public removeListener(name: T, listener: Handler) { - this.handler[name] = (this.handler[name] as Handler[]).filter(a => a !== listener) as any; - } + public removeListener(name: T, listener: Handler) { + this.handler[name] = (this.handler[name] as Handler[]).filter(a => a !== listener) as any; + } } export const messageChannelContext = React.createContext(undefined); async function messageAndResponse(socket: WebSocket, msg: WSMessage): Promise> { - const id = v4(); - const ret = new Promise>((resolve) => { - const handler = function({ data }: MessageEvent) { - const parsed = JSON.parse(data.toString()) as WSMessageWithID; - if (parsed.id === id) { - socket.removeEventListener('message', handler); - resolve(parsed); - } - }; - socket.addEventListener('message', handler); - }); - const toSend = msg as WSMessageWithID; - toSend.id = id; + const id = v4(); + const ret = new Promise>((resolve) => { + const handler = function({ data }: MessageEvent) { + const parsed = JSON.parse(data.toString()) as WSMessageWithID; + if (parsed.id === id) { + socket.removeEventListener('message', handler); + resolve(parsed); + } + }; + socket.addEventListener('message', handler); + }); + const toSend = msg as WSMessageWithID; + toSend.id = id; - socket.send(JSON.stringify(toSend)); - return ret; + socket.send(JSON.stringify(toSend)); + return ret; } const MessageChannelProvider: FCWithChildren = ({ children }) => { - const [store, dispatch] = useStore(); - const [socket, setSocket] = React.useState(); - const [publicWS, setPublicWS] = React.useState(); - const [usePassword, setUsePassword] = React.useState<'waiting'|'yes'|'no'>('waiting'); - const [isSetup, setIsSetup] = React.useState<'waiting'|'yes'|'no'>('waiting'); + const [store, dispatch] = useStore(); + const [socket, setSocket] = React.useState(); + const [publicWS, setPublicWS] = React.useState(); + const [usePassword, setUsePassword] = React.useState<'waiting'|'yes'|'no'>('waiting'); + const [isSetup, setIsSetup] = React.useState<'waiting'|'yes'|'no'>('waiting'); - const { enqueueSnackbar } = useSnackbar(); + const { enqueueSnackbar } = useSnackbar(); - React.useEffect(() => { - const wss = new WebSocket(`${location.protocol == 'https:' ? 'wss' : 'ws'}://${process.env.NODE_ENV === 'development' ? 'localhost:3000' : window.location.host}/public`); - wss.addEventListener('open', () => { - setPublicWS(wss); - }); - wss.addEventListener('error', () => { - enqueueSnackbar('Unable to connect to server. Please reload the page to try again.', { variant: 'error' }); - }); - }, []); - - React.useEffect(() => { - (async () => { - if (!publicWS) - return; - setUsePassword((await messageAndResponse(publicWS, { name: 'requirePassword', data: undefined })).data ? 'yes' : 'no'); - setIsSetup((await messageAndResponse(publicWS, { name: 'isSetup', data: undefined })).data ? 'yes' : 'no'); - })(); - }, [publicWS]); - - const connect = (ev?: React.FormEvent) => { - let search = new URLSearchParams(); - if (ev) { - ev.preventDefault(); - const formData = new FormData(ev.currentTarget); - const password = formData.get('password')?.toString(); - if (!password) - return enqueueSnackbar('Please provide both a username and password', { - variant: 'error' + React.useEffect(() => { + const wss = new WebSocket(`${location.protocol == 'https:' ? 'wss' : 'ws'}://${process.env.NODE_ENV === 'development' ? 'localhost:3000' : window.location.host}/public`); + wss.addEventListener('open', () => { + setPublicWS(wss); }); - search = new URLSearchParams({ - password - }); - } + wss.addEventListener('error', () => { + enqueueSnackbar('Unable to connect to server. Please reload the page to try again.', { variant: 'error' }); + }); + }, []); - const wws = new WebSocket(`${location.protocol == 'https:' ? 'wss' : 'ws'}://${process.env.NODE_ENV === 'development' ? 'localhost:3000' : window.location.host}/private?${search}`, ); - wws.addEventListener('open', () => { - console.log('[INFO] [WS] Connected'); - setSocket(wws); - }); - wws.addEventListener('error', (er) => { - console.error('[ERROR] [WS]', er); - enqueueSnackbar('Unable to connect to server. Please check the password and try again.', { - variant: 'error' - }); - }); - }; + React.useEffect(() => { + (async () => { + if (!publicWS) + return; + setUsePassword((await messageAndResponse(publicWS, { name: 'requirePassword', data: undefined })).data ? 'yes' : 'no'); + setIsSetup((await messageAndResponse(publicWS, { name: 'isSetup', data: undefined })).data ? 'yes' : 'no'); + })(); + }, [publicWS]); - const setup = async (ev: React.FormEvent) => { - ev.preventDefault(); - if (!socket) - return enqueueSnackbar('Invalid state: socket not found', { variant: 'error' }); - const formData = new FormData(ev.currentTarget); - const password = formData.get('password'); - const data = { - port: parseInt(formData.get('port')?.toString() ?? '') ?? 3000, - password: password ? password.toString() : undefined - } as GUIConfig; - await messageAndResponse(socket, { name: 'setupServer', data }); - enqueueSnackbar(`The following settings have been set: Port=${data.port}, Password=${data.password ?? 'noPasswordRequired'}`, { - variant: 'success', - persist: true - }); - enqueueSnackbar('Please restart the server now.', { - variant: 'info', - persist: true - }); - }; + const connect = (ev?: React.FormEvent) => { + let search = new URLSearchParams(); + if (ev) { + ev.preventDefault(); + const formData = new FormData(ev.currentTarget); + const password = formData.get('password')?.toString(); + if (!password) + return enqueueSnackbar('Please provide both a username and password', { + variant: 'error' + }); + search = new URLSearchParams({ + password + }); + } - const randomEventHandler = React.useMemo(() => new RandomEventHandler(), []); - - React.useEffect(() => { - (async () => { - if (!socket) - return; - const currentService = await messageAndResponse(socket, { name: 'type', data: undefined }); - if (currentService.data !== undefined) - return dispatch({ type: 'service', payload: currentService.data }); - if (store.service !== currentService.data) - messageAndResponse(socket, { name: 'setup', data: store.service }); - })(); - }, [store.service, dispatch, socket]); - - React.useEffect(() => { - if (!socket) - return; - /* finish is a placeholder */ - const listener = (initalData: MessageEvent) => { - const data = JSON.parse(initalData.data) as RandomEvent<'finish'>; - randomEventHandler.emit(data.name, data); + const wws = new WebSocket(`${location.protocol == 'https:' ? 'wss' : 'ws'}://${process.env.NODE_ENV === 'development' ? 'localhost:3000' : window.location.host}/private?${search}`, ); + wws.addEventListener('open', () => { + console.log('[INFO] [WS] Connected'); + setSocket(wws); + }); + wws.addEventListener('error', (er) => { + console.error('[ERROR] [WS]', er); + enqueueSnackbar('Unable to connect to server. Please check the password and try again.', { + variant: 'error' + }); + }); }; - socket.addEventListener('message', listener); - return () => { - socket.removeEventListener('message', listener); + + const setup = async (ev: React.FormEvent) => { + ev.preventDefault(); + if (!socket) + return enqueueSnackbar('Invalid state: socket not found', { variant: 'error' }); + const formData = new FormData(ev.currentTarget); + const password = formData.get('password'); + const data = { + port: parseInt(formData.get('port')?.toString() ?? '') ?? 3000, + password: password ? password.toString() : undefined + } as GUIConfig; + await messageAndResponse(socket, { name: 'setupServer', data }); + enqueueSnackbar(`The following settings have been set: Port=${data.port}, Password=${data.password ?? 'noPasswordRequired'}`, { + variant: 'success', + persist: true + }); + enqueueSnackbar('Please restart the server now.', { + variant: 'info', + persist: true + }); }; - }, [ socket ]); - if (usePassword === 'waiting') - return <>; + const randomEventHandler = React.useMemo(() => new RandomEventHandler(), []); - if (socket === undefined) { - if (usePassword === 'no') { - connect(undefined); - return <>; - } - return - - - - + React.useEffect(() => { + (async () => { + if (!socket) + return; + const currentService = await messageAndResponse(socket, { name: 'type', data: undefined }); + if (currentService.data !== undefined) + return dispatch({ type: 'service', payload: currentService.data }); + if (store.service !== currentService.data) + messageAndResponse(socket, { name: 'setup', data: store.service }); + })(); + }, [store.service, dispatch, socket]); + + React.useEffect(() => { + if (!socket) + return; + /* finish is a placeholder */ + const listener = (initalData: MessageEvent) => { + const data = JSON.parse(initalData.data) as RandomEvent<'finish'>; + randomEventHandler.emit(data.name, data); + }; + socket.addEventListener('message', listener); + return () => { + socket.removeEventListener('message', listener); + }; + }, [ socket ]); + + if (usePassword === 'waiting') + return <>; + + if (socket === undefined) { + if (usePassword === 'no') { + connect(undefined); + return <>; + } + return + + + + Login - - - - - + + + + + You need to login in order to use this tool. - - - ; - } + + + ; + } - if (isSetup === 'no') { - return - - - - + if (isSetup === 'no') { + return + + + + Confirm - - - - - - + + + + + + Please enter data that will be set to use this tool. -
+
Leave blank to use no password (NOT RECOMMENDED)! -
-
-
; - } +
+
+ ; + } - const messageHandler: FrontEndMessages = { - name: 'default', - auth: async (data) => (await messageAndResponse(socket, { name: 'auth', data })).data, - version: async () => (await messageAndResponse(socket, { name: 'version', data: undefined })).data, - checkToken: async () => (await messageAndResponse(socket, { name: 'checkToken', data: undefined })).data, - search: async (data) => (await messageAndResponse(socket, { name: 'search', data })).data, - handleDefault: async (data) => (await messageAndResponse(socket, { name: 'default', data })).data, - availableDubCodes: async () => (await messageAndResponse(socket, { name: 'availableDubCodes', data: undefined})).data, - availableSubCodes: async () => (await messageAndResponse(socket, { name: 'availableSubCodes', data: undefined })).data, - resolveItems: async (data) => (await messageAndResponse(socket, { name: 'resolveItems', data })).data, - listEpisodes: async (data) => (await messageAndResponse(socket, { name: 'listEpisodes', data })).data, - randomEvents: randomEventHandler, - downloadItem: (data) => messageAndResponse(socket, { name: 'downloadItem', data }), - isDownloading: async () => (await messageAndResponse(socket, { name: 'isDownloading', data: undefined })).data, - openFolder: async (data) => messageAndResponse(socket, { name: 'openFolder', data }), - logout: async () => (await messageAndResponse(socket, { name: 'changeProvider', data: undefined })).data, - openFile: async (data) => await messageAndResponse(socket, { name: 'openFile', data }), - openURL: async (data) => await messageAndResponse(socket, { name: 'openURL', data }), - getQueue: async () => (await messageAndResponse(socket, { name: 'getQueue', data: undefined })).data, - removeFromQueue: async (data) => await messageAndResponse(socket, { name: 'removeFromQueue', data }), - clearQueue: async () => await messageAndResponse(socket, { name: 'clearQueue', data: undefined }), - setDownloadQueue: async (data) => await messageAndResponse(socket, { name: 'setDownloadQueue', data }), - getDownloadQueue: async () => (await messageAndResponse(socket, { name: 'getDownloadQueue', data: undefined })).data, - }; + const messageHandler: FrontEndMessages = { + name: 'default', + auth: async (data) => (await messageAndResponse(socket, { name: 'auth', data })).data, + version: async () => (await messageAndResponse(socket, { name: 'version', data: undefined })).data, + checkToken: async () => (await messageAndResponse(socket, { name: 'checkToken', data: undefined })).data, + search: async (data) => (await messageAndResponse(socket, { name: 'search', data })).data, + handleDefault: async (data) => (await messageAndResponse(socket, { name: 'default', data })).data, + availableDubCodes: async () => (await messageAndResponse(socket, { name: 'availableDubCodes', data: undefined})).data, + availableSubCodes: async () => (await messageAndResponse(socket, { name: 'availableSubCodes', data: undefined })).data, + resolveItems: async (data) => (await messageAndResponse(socket, { name: 'resolveItems', data })).data, + listEpisodes: async (data) => (await messageAndResponse(socket, { name: 'listEpisodes', data })).data, + randomEvents: randomEventHandler, + downloadItem: (data) => messageAndResponse(socket, { name: 'downloadItem', data }), + isDownloading: async () => (await messageAndResponse(socket, { name: 'isDownloading', data: undefined })).data, + openFolder: async (data) => messageAndResponse(socket, { name: 'openFolder', data }), + logout: async () => (await messageAndResponse(socket, { name: 'changeProvider', data: undefined })).data, + openFile: async (data) => await messageAndResponse(socket, { name: 'openFile', data }), + openURL: async (data) => await messageAndResponse(socket, { name: 'openURL', data }), + getQueue: async () => (await messageAndResponse(socket, { name: 'getQueue', data: undefined })).data, + removeFromQueue: async (data) => await messageAndResponse(socket, { name: 'removeFromQueue', data }), + clearQueue: async () => await messageAndResponse(socket, { name: 'clearQueue', data: undefined }), + setDownloadQueue: async (data) => await messageAndResponse(socket, { name: 'setDownloadQueue', data }), + getDownloadQueue: async () => (await messageAndResponse(socket, { name: 'getDownloadQueue', data: undefined })).data, + }; - return - {children} - ; + return + {children} + ; }; export default MessageChannelProvider; diff --git a/gui/react/src/provider/QueueProvider.tsx b/gui/react/src/provider/QueueProvider.tsx index dc31db9..833ff17 100644 --- a/gui/react/src/provider/QueueProvider.tsx +++ b/gui/react/src/provider/QueueProvider.tsx @@ -6,30 +6,30 @@ import { RandomEvent } from '../../../../@types/randomEvents'; export const queueContext = React.createContext([]); const QueueProvider: FCWithChildren = ({ children }) => { - const msg = React.useContext(messageChannelContext); + const msg = React.useContext(messageChannelContext); - const [ready, setReady] = React.useState(false); - const [queue, setQueue] = React.useState([]); + const [ready, setReady] = React.useState(false); + const [queue, setQueue] = React.useState([]); - React.useEffect(() => { - if (msg && !ready) { - msg.getQueue().then(data => { - setQueue(data); - setReady(true); - }); - } - const listener = (ev: RandomEvent<'queueChange'>) => { - setQueue(ev.data); - }; - msg?.randomEvents.on('queueChange', listener); - return () => { - msg?.randomEvents.removeListener('queueChange', listener); - }; - }, [ msg ]); + React.useEffect(() => { + if (msg && !ready) { + msg.getQueue().then(data => { + setQueue(data); + setReady(true); + }); + } + const listener = (ev: RandomEvent<'queueChange'>) => { + setQueue(ev.data); + }; + msg?.randomEvents.on('queueChange', listener); + return () => { + msg?.randomEvents.removeListener('queueChange', listener); + }; + }, [ msg ]); - return - {children} - ; + return + {children} + ; }; export default QueueProvider; \ No newline at end of file diff --git a/gui/react/src/provider/ServiceProvider.tsx b/gui/react/src/provider/ServiceProvider.tsx index 173aa3e..16cc5ca 100644 --- a/gui/react/src/provider/ServiceProvider.tsx +++ b/gui/react/src/provider/ServiceProvider.tsx @@ -8,28 +8,28 @@ type Services = 'crunchy'|'hidive'|'ao'|'adn'; export const serviceContext = React.createContext(undefined); const ServiceProvider: FCWithChildren = ({ children }) => { - const [ { service }, dispatch ] = useStore(); + const [ { service }, dispatch ] = useStore(); - const setService = (s: StoreState['service']) => { - dispatch({ - type: 'service', - payload: s - }); - }; + const setService = (s: StoreState['service']) => { + dispatch({ + type: 'service', + payload: s + }); + }; - return service === undefined ? - - Please select your service - - - - - - - - : - {children} - ; + return service === undefined ? + + Please select your service + + + + + + + + : + {children} + ; }; export default ServiceProvider; \ No newline at end of file diff --git a/gui/react/src/provider/Store.tsx b/gui/react/src/provider/Store.tsx index 15d50ec..2e0f8f7 100644 --- a/gui/react/src/provider/Store.tsx +++ b/gui/react/src/provider/Store.tsx @@ -32,35 +32,35 @@ export type StoreAction = { } const Reducer = (state: StoreState, action: StoreAction): StoreState => { - switch(action.type) { - default: - return { ...state, [action.type]: action.payload }; - } + switch(action.type) { + default: + return { ...state, [action.type]: action.payload }; + } }; const initialState: StoreState = { - downloadOptions: { - id: '', - q: 0, - e: '', - dubLang: [ 'jpn' ], - dlsubs: [ 'all' ], - fileName: '', - dlVideoOnce: false, - all: false, - but: false, - noaudio: false, - novids: false, - simul: false - }, - service: undefined, - episodeListing: [], - version: '', + downloadOptions: { + id: '', + q: 0, + e: '', + dubLang: [ 'jpn' ], + dlsubs: [ 'all' ], + fileName: '', + dlVideoOnce: false, + all: false, + but: false, + noaudio: false, + novids: false, + simul: false + }, + service: undefined, + episodeListing: [], + version: '', }; const Store: FCWithChildren = ({children}) => { - const [state, dispatch] = React.useReducer(Reducer, initialState); - /*React.useEffect(() => { + const [state, dispatch] = React.useReducer(Reducer, initialState); + /*React.useEffect(() => { if (!state.unsavedChanges.has) return; const unsavedChanges = (ev: BeforeUnloadEvent, lang: LanguageContextType) => { @@ -79,11 +79,11 @@ const Store: FCWithChildren = ({children}) => { return () => window.removeEventListener('beforeunload', windowListener); }, [state.unsavedChanges.has]);*/ - return ( - - {children} - - ); + return ( + + {children} + + ); }; /* Importent Notice -- The 'queue' generic will be overriden */ diff --git a/gui/react/tsconfig.json b/gui/react/tsconfig.json index b13020e..5eecbe8 100644 --- a/gui/react/tsconfig.json +++ b/gui/react/tsconfig.json @@ -1,29 +1,29 @@ { - "compilerOptions": { - "outDir": "./build", - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "CommonJS", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - //"noEmit": true, - "jsx": "react-jsx", - "downlevelIteration": true - }, - "include": [ - "./src", - "./webpack.config.ts" - ] + "compilerOptions": { + "outDir": "./build", + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "CommonJS", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + //"noEmit": true, + "jsx": "react-jsx", + "downlevelIteration": true + }, + "include": [ + "./src", + "./webpack.config.ts" + ] } \ No newline at end of file diff --git a/gui/react/webpack.config.ts b/gui/react/webpack.config.ts index a5e485f..0901205 100644 --- a/gui/react/webpack.config.ts +++ b/gui/react/webpack.config.ts @@ -4,55 +4,55 @@ import path from 'path'; import type { Configuration as DevServerConfig } from 'webpack-dev-server'; const config: Configuration & DevServerConfig = { - devServer: { - proxy: [ - { - target: 'http://localhost:3000', - context: ['/public', '/private'], - ws: true - } - ], - }, - entry: './src/index.tsx', - mode: 'production', - output: { - path: path.resolve(process.cwd(), './build'), - filename: 'index.js', - }, - target: 'web', - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'], - }, - performance: false, - module: { - rules: [ - { - test: /\.(ts|tsx)$/, - exclude: /node_modules/, - use: { - 'loader': 'babel-loader', - options: { - presets: [ - '@babel/typescript', - '@babel/preset-react', - ['@babel/preset-env', { - targets: 'defaults' - }] - ] - } - }, - }, - { - test: /\.css$/i, - use: ['style-loader', 'css-loader'], - }, - ], - }, - plugins: [ - new HtmlWebpackPlugin({ - template: path.join(process.cwd(), 'public', 'index.html') - }) - ] + devServer: { + proxy: [ + { + target: 'http://localhost:3000', + context: ['/public', '/private'], + ws: true + } + ], + }, + entry: './src/index.tsx', + mode: 'production', + output: { + path: path.resolve(process.cwd(), './build'), + filename: 'index.js', + }, + target: 'web', + resolve: { + extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'], + }, + performance: false, + module: { + rules: [ + { + test: /\.(ts|tsx)$/, + exclude: /node_modules/, + use: { + 'loader': 'babel-loader', + options: { + presets: [ + '@babel/typescript', + '@babel/preset-react', + ['@babel/preset-env', { + targets: 'defaults' + }] + ] + } + }, + }, + { + test: /\.css$/i, + use: ['style-loader', 'css-loader'], + }, + ], + }, + plugins: [ + new HtmlWebpackPlugin({ + template: path.join(process.cwd(), 'public', 'index.html') + }) + ] }; export default config; diff --git a/package.json b/package.json index d3b7ba8..25b1094 100644 --- a/package.json +++ b/package.json @@ -1,120 +1,120 @@ { - "name": "multi-downloader-nx", - "short_name": "aniDL", - "version": "5.5.6", - "description": "Downloader for Crunchyroll, Hidive, AnimeOnegai, and AnimationDigitalNetwork with CLI and GUI", - "keywords": [ - "download", - "downloader", - "hidive", - "crunchy", - "crunchyroll", - "util", - "utility", - "cli", - "gui" - ], - "engines": { - "node": ">=18", - "pnpm": ">=7" - }, - "author": "AnimeDL ", - "contributors": [ - { - "name": "AnimeDL " - }, - { - "name": "AniDL " - }, - { - "name": "AnidlSupport " - } - ], - "homepage": "https://github.com/anidl/multi-downloader-nx", - "repository": { - "type": "git", - "url": "https://github.com/anidl/multi-downloader-nx.git" - }, - "bugs": { - "url": "https://github.com/anidl/multi-downloader-nx/issues" - }, - "license": "MIT", - "dependencies": { - "@bufbuild/buf": "^1.57.2", - "@bufbuild/protobuf": "^2.8.0", - "@bufbuild/protoc-gen-es": "^2.8.0", - "@yao-pkg/pkg": "^6.6.0", - "binary-parser": "^2.2.1", - "binary-parser-encoder": "^1.5.3", - "bn.js": "^5.2.2", - "cors": "^2.8.5", - "elliptic": "^6.6.1", - "esbuild": "^0.25.10", - "express": "^5.1.0", - "fast-xml-parser": "^5.2.5", - "ffprobe": "^1.1.2", - "fs-extra": "^11.3.2", - "iso-639": "^0.2.2", - "leven": "^3.1.0", - "log4js": "^6.9.1", - "long": "^5.3.2", - "lookpath": "^1.2.3", - "m3u8-parsed": "^2.0.0", - "mpd-parser": "^1.3.1", - "node-forge": "^1.3.1", - "ofetch": "^1.4.1", - "open": "^8.4.2", - "protobufjs": "^7.5.4", - "puppeteer-real-browser": "^1.4.4", - "ws": "^8.18.3", - "yaml": "^2.8.1", - "yargs": "^17.7.2" - }, - "devDependencies": { - "@eslint/js": "^9.35.0", - "@types/bn.js": "^5.2.0", - "@types/cors": "^2.8.19", - "@types/elliptic": "^6.4.18", - "@types/express": "^5.0.3", - "@types/ffprobe": "^1.1.8", - "@types/fs-extra": "^11.0.4", - "@types/node": "^24.5.1", - "@types/node-forge": "^1.3.14", - "@types/ws": "^8.18.1", - "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^8.44.0", - "@typescript-eslint/parser": "^8.44.0", - "eslint": "^9.35.0", - "protoc": "^1.1.3", - "removeNPMAbsolutePaths": "^3.0.1", - "ts-node": "^10.9.2", - "typescript": "^5.9.2", - "typescript-eslint": "^8.44.0" - }, - "scripts": { - "prestart": "pnpm run tsc test", - "start": "pnpm prestart && cd lib && node gui.js", - "gui": "cd ./gui/react/ && pnpm start", - "docs": "ts-node modules/build-docs.ts", - "tsc": "ts-node tsc.ts", - "proto:compile": "protoc --plugin=protoc-gen-ts_proto=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_opt=\"esModuleInterop=true\" --ts_proto_opt=\"forceLong=long\" --ts_proto_opt=\"env=node\" --ts_proto_out=. modules/*.proto", - "prebuild-cli": "pnpm run tsc false false", - "build-windows-cli": "pnpm run prebuild-cli && cd lib && node modules/build windows-x64", - "build-linux-cli": "pnpm run prebuild-cli && cd lib && node modules/build linuxstatic-x64", - "build-arm-cli": "pnpm run prebuild-cli && cd lib && node modules/build linux-arm64", - "build-macos-cli": "pnpm run prebuild-cli && cd lib && node modules/build macos-x64", - "build-alpine-cli": "pnpm run prebuild-cli && cd lib && node modules/build alpine-x64", - "build-android-cli": "pnpm run prebuild-cli && cd lib && node modules/build linuxstatic-armv7", - "prebuild-gui": "pnpm run tsc", - "build-windows-gui": "pnpm run prebuild-gui && cd lib && node modules/build windows-x64 true", - "build-linux-gui": "pnpm run prebuild-gui && cd lib && node modules/build linuxstatic-x64 true", - "build-arm-gui": "pnpm run prebuild-gui && cd lib && node modules/build linux-arm64 true", - "build-macos-gui": "pnpm run prebuild-gui && cd lib && node modules/build macos-x64 true", - "build-alpine-gui": "pnpm run prebuild-gui && cd lib && node modules/build alpine-x64 true", - "build-android-gui": "pnpm run prebuild-gui && cd lib && node modules/build linuxstatic-armv7 true", - "eslint": "npx eslint .", - "eslint-fix": "npx eslint . --fix", - "pretest": "pnpm run tsc", - "test": "pnpm run pretest && cd lib && node modules/build windows-x64 && node modules/build linuxstatic-x64 && node modules/build macos-x64" - } -} + "name": "multi-downloader-nx", + "short_name": "aniDL", + "version": "5.5.6", + "description": "Downloader for Crunchyroll, Hidive, AnimeOnegai, and AnimationDigitalNetwork with CLI and GUI", + "keywords": [ + "download", + "downloader", + "hidive", + "crunchy", + "crunchyroll", + "util", + "utility", + "cli", + "gui" + ], + "engines": { + "node": ">=18", + "pnpm": ">=7" + }, + "author": "AnimeDL ", + "contributors": [ + { + "name": "AnimeDL " + }, + { + "name": "AniDL " + }, + { + "name": "AnidlSupport " + } + ], + "homepage": "https://github.com/anidl/multi-downloader-nx", + "repository": { + "type": "git", + "url": "https://github.com/anidl/multi-downloader-nx.git" + }, + "bugs": { + "url": "https://github.com/anidl/multi-downloader-nx/issues" + }, + "license": "MIT", + "dependencies": { + "@bufbuild/buf": "^1.57.2", + "@bufbuild/protobuf": "^2.8.0", + "@bufbuild/protoc-gen-es": "^2.8.0", + "@yao-pkg/pkg": "^6.6.0", + "binary-parser": "^2.2.1", + "binary-parser-encoder": "^1.5.3", + "bn.js": "^5.2.2", + "cors": "^2.8.5", + "elliptic": "^6.6.1", + "esbuild": "^0.25.10", + "express": "^5.1.0", + "fast-xml-parser": "^5.2.5", + "ffprobe": "^1.1.2", + "fs-extra": "^11.3.2", + "iso-639": "^0.2.2", + "leven": "^3.1.0", + "log4js": "^6.9.1", + "long": "^5.3.2", + "lookpath": "^1.2.3", + "m3u8-parsed": "^2.0.0", + "mpd-parser": "^1.3.1", + "node-forge": "^1.3.1", + "ofetch": "^1.4.1", + "open": "^8.4.2", + "protobufjs": "^7.5.4", + "puppeteer-real-browser": "^1.4.4", + "ws": "^8.18.3", + "yaml": "^2.8.1", + "yargs": "^17.7.2" + }, + "devDependencies": { + "@eslint/js": "^9.35.0", + "@types/bn.js": "^5.2.0", + "@types/cors": "^2.8.19", + "@types/elliptic": "^6.4.18", + "@types/express": "^5.0.3", + "@types/ffprobe": "^1.1.8", + "@types/fs-extra": "^11.0.4", + "@types/node": "^24.5.1", + "@types/node-forge": "^1.3.14", + "@types/ws": "^8.18.1", + "@types/yargs": "^17.0.33", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", + "eslint": "^9.35.0", + "protoc": "^1.1.3", + "removeNPMAbsolutePaths": "^3.0.1", + "ts-node": "^10.9.2", + "typescript": "^5.9.2", + "typescript-eslint": "^8.44.0" + }, + "scripts": { + "prestart": "pnpm run tsc test", + "start": "pnpm prestart && cd lib && node gui.js", + "gui": "cd ./gui/react/ && pnpm start", + "docs": "ts-node modules/build-docs.ts", + "tsc": "ts-node tsc.ts", + "proto:compile": "protoc --plugin=protoc-gen-ts_proto=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_opt=\"esModuleInterop=true\" --ts_proto_opt=\"forceLong=long\" --ts_proto_opt=\"env=node\" --ts_proto_out=. modules/*.proto", + "prebuild-cli": "pnpm run tsc false false", + "build-windows-cli": "pnpm run prebuild-cli && cd lib && node modules/build windows-x64", + "build-linux-cli": "pnpm run prebuild-cli && cd lib && node modules/build linuxstatic-x64", + "build-arm-cli": "pnpm run prebuild-cli && cd lib && node modules/build linux-arm64", + "build-macos-cli": "pnpm run prebuild-cli && cd lib && node modules/build macos-x64", + "build-alpine-cli": "pnpm run prebuild-cli && cd lib && node modules/build alpine-x64", + "build-android-cli": "pnpm run prebuild-cli && cd lib && node modules/build linuxstatic-armv7", + "prebuild-gui": "pnpm run tsc", + "build-windows-gui": "pnpm run prebuild-gui && cd lib && node modules/build windows-x64 true", + "build-linux-gui": "pnpm run prebuild-gui && cd lib && node modules/build linuxstatic-x64 true", + "build-arm-gui": "pnpm run prebuild-gui && cd lib && node modules/build linux-arm64 true", + "build-macos-gui": "pnpm run prebuild-gui && cd lib && node modules/build macos-x64 true", + "build-alpine-gui": "pnpm run prebuild-gui && cd lib && node modules/build alpine-x64 true", + "build-android-gui": "pnpm run prebuild-gui && cd lib && node modules/build linuxstatic-armv7 true", + "eslint": "npx eslint .", + "eslint-fix": "npx eslint . --fix", + "pretest": "pnpm run tsc", + "test": "pnpm run pretest && cd lib && node modules/build windows-x64 && node modules/build linuxstatic-x64 && node modules/build macos-x64" + } +} \ No newline at end of file diff --git a/tsc.ts b/tsc.ts index 16e7d19..81f0cac 100644 --- a/tsc.ts +++ b/tsc.ts @@ -10,156 +10,156 @@ const isTest = argv.length > 0 && argv[0] === 'test'; const isGUI = !(argv.length > 1 && argv[1] === 'false'); if (!isTest) - buildIgnore = [ - '*/\\.env', - './config/setup.json' - ]; + buildIgnore = [ + '*/\\.env', + './config/setup.json' + ]; if (!isGUI) - buildIgnore = buildIgnore.concat([ - './gui*', - './build*', - 'gui.ts' - ]); + buildIgnore = buildIgnore.concat([ + './gui*', + './build*', + 'gui.ts' + ]); const ignore = [ - ...buildIgnore, - '*/\\.git*', - './lib*', - '*/@types*', - './out*', - './bin/mkvtoolnix*', - './config/token.yml$', - './config/updates.json$', - './config/*_token.yml$', - './config/*_sess.yml$', - './config/*_profile.yml$', - '*/\\.eslint*', - '*/*\\.tsx?$', - './fonts*', - './gui/react*', - './dev.js$', - '*/node_modules/*', - './widevine/*', - './playready/*', - './videos/*', - './logs/*', + ...buildIgnore, + '*/\\.git*', + './lib*', + '*/@types*', + './out*', + './bin/mkvtoolnix*', + './config/token.yml$', + './config/updates.json$', + './config/*_token.yml$', + './config/*_sess.yml$', + './config/*_profile.yml$', + '*/\\.eslint*', + '*/*\\.tsx?$', + './fonts*', + './gui/react*', + './dev.js$', + '*/node_modules/*', + './widevine/*', + './playready/*', + './videos/*', + './logs/*', ].map(a => a.replace(/\*/g, '[^]*').replace(/\.\//g, escapeRegExp(__dirname) + '/').replace(/\//g, path.sep === '\\' ? '\\\\' : '/')).map(a => new RegExp(a, 'i')); export { ignore }; (async () => { - const waitForProcess = async (proc: ChildProcess) => { - return new Promise((resolve, reject) => { - proc.stdout?.on('data', console.log); - proc.stderr?.on('data', console.error); - proc.on('close', resolve); - proc.on('error', reject); - }); - }; + const waitForProcess = async (proc: ChildProcess) => { + return new Promise((resolve, reject) => { + proc.stdout?.on('data', console.log); + proc.stderr?.on('data', console.error); + proc.on('close', resolve); + proc.on('error', reject); + }); + }; - process.stdout.write('Removing lib dir... '); - removeSync('lib'); - process.stdout.write('✓\nRunning tsc... '); - const tsc = exec('npx tsc'); + process.stdout.write('Removing lib dir... '); + removeSync('lib'); + process.stdout.write('✓\nRunning tsc... '); + const tsc = exec('npx tsc'); - await waitForProcess(tsc); - - if (!isGUI) { - fs.emptyDirSync(path.join('lib', 'gui')); - fs.rmdirSync(path.join('lib', 'gui')); - } + await waitForProcess(tsc); - if (!isTest && isGUI) { - process.stdout.write('✓\nBuilding react... '); + if (!isGUI) { + fs.emptyDirSync(path.join('lib', 'gui')); + fs.rmdirSync(path.join('lib', 'gui')); + } - const installReactDependencies = exec('pnpm install', { - cwd: path.join(__dirname, 'gui', 'react'), - }); + if (!isTest && isGUI) { + process.stdout.write('✓\nBuilding react... '); - await waitForProcess(installReactDependencies); - - const react = exec('pnpm run build', { - cwd: path.join(__dirname, 'gui', 'react'), - env: { - ...process.env, - CI: 'false' - } - }); - - await waitForProcess(react); - } + const installReactDependencies = exec('pnpm install', { + cwd: path.join(__dirname, 'gui', 'react'), + }); - process.stdout.write('✓\nCopying files... '); - if (!isTest && isGUI) { - copyDir(path.join(__dirname, 'gui', 'react', 'build'), path.join(__dirname, 'lib', 'gui', 'server', 'build')); - } + await waitForProcess(installReactDependencies); - const files = readDir(__dirname); - files.forEach(item => { - const itemPath = path.join(__dirname, 'lib', item.path.replace(__dirname, '')); - if (item.stats.isDirectory()) { - if (!fs.existsSync(itemPath)) - fs.mkdirSync(itemPath); - } else { - copyFileSync(item.path, itemPath); - } - }); + const react = exec('pnpm run build', { + cwd: path.join(__dirname, 'gui', 'react'), + env: { + ...process.env, + CI: 'false' + } + }); - process.stdout.write('✓\nInstalling dependencies... '); - if (!isTest) { - const dependencies = exec(`pnpm install ${isGUI ? '' : '-P'}`, { - cwd: path.join(__dirname, 'lib') - }); - await waitForProcess(dependencies); - } + await waitForProcess(react); + } - process.stdout.write('✓\n'); + process.stdout.write('✓\nCopying files... '); + if (!isTest && isGUI) { + copyDir(path.join(__dirname, 'gui', 'react', 'build'), path.join(__dirname, 'lib', 'gui', 'server', 'build')); + } + + const files = readDir(__dirname); + files.forEach(item => { + const itemPath = path.join(__dirname, 'lib', item.path.replace(__dirname, '')); + if (item.stats.isDirectory()) { + if (!fs.existsSync(itemPath)) + fs.mkdirSync(itemPath); + } else { + copyFileSync(item.path, itemPath); + } + }); + + process.stdout.write('✓\nInstalling dependencies... '); + if (!isTest) { + const dependencies = exec(`pnpm install ${isGUI ? '' : '-P'}`, { + cwd: path.join(__dirname, 'lib') + }); + await waitForProcess(dependencies); + } + + process.stdout.write('✓\n'); })(); -function readDir (dir: string): { - path: string, - stats: fs.Stats +function readDir(dir: string): { + path: string, + stats: fs.Stats }[] { - const items: { - path: string, - stats: fs.Stats - }[] = []; - const content = fs.readdirSync(dir); - itemLoop: for (const item of content) { - const itemPath = path.join(dir, item); - for (const ignoreItem of ignore) { - if (ignoreItem.test(itemPath)) - continue itemLoop; - } - const stats = fs.statSync(itemPath); - items.push({ - path: itemPath, - stats - }); - if (stats.isDirectory()) { - items.push(...readDir(itemPath)); - } - } - return items; + const items: { + path: string, + stats: fs.Stats + }[] = []; + const content = fs.readdirSync(dir); + itemLoop: for (const item of content) { + const itemPath = path.join(dir, item); + for (const ignoreItem of ignore) { + if (ignoreItem.test(itemPath)) + continue itemLoop; + } + const stats = fs.statSync(itemPath); + items.push({ + path: itemPath, + stats + }); + if (stats.isDirectory()) { + items.push(...readDir(itemPath)); + } + } + return items; } async function copyDir(src: string, dest: string) { - await fs.promises.mkdir(dest, { recursive: true }); - const entries = await fs.promises.readdir(src, { withFileTypes: true }); + await fs.promises.mkdir(dest, { recursive: true }); + const entries = await fs.promises.readdir(src, { withFileTypes: true }); - for (const entry of entries) { - const srcPath = path.join(src, entry.name); - const destPath = path.join(dest, entry.name); + for (const entry of entries) { + const srcPath = path.join(src, entry.name); + const destPath = path.join(dest, entry.name); - entry.isDirectory() ? - await copyDir(srcPath, destPath) : - await fs.promises.copyFile(srcPath, destPath); - } + entry.isDirectory() ? + await copyDir(srcPath, destPath) : + await fs.promises.copyFile(srcPath, destPath); + } } function escapeRegExp(string: string): string { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 43398a5..8a11d1f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,20 @@ { - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "outDir": "./lib", - "strict": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "downlevelIteration": true, - "jsx": "react" - }, - "exclude": [ - "./videos", - "./tsc.ts", - "lib/**/*", - "gui/react/**/*" - ] + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "outDir": "./lib", + "strict": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "downlevelIteration": true, + "jsx": "react" + }, + "exclude": [ + "./videos", + "./tsc.ts", + "lib/**/*", + "gui/react/**/*" + ] } \ No newline at end of file