From 4165e1029e23093ef8bfc08f5dcdbd1fc78f8903 Mon Sep 17 00:00:00 2001 From: lanyeeee Date: Sun, 17 Aug 2025 04:51:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=89=8D=E7=AB=AF=E7=94=A8=E4=B8=8D=E5=88=B0=E7=9A=84?= =?UTF-8?q?command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands.rs | 89 +------------------------------------ src-tauri/src/lib.rs | 7 --- src/bindings.ts | 93 --------------------------------------- 3 files changed, 1 insertion(+), 188 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 74361a8..3667fdd 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -9,10 +9,7 @@ use crate::{ extensions::AppHandleExt, logger, types::{ - bangumi_info::{BangumiInfo, EpInBangumi}, - bangumi_media_url::BangumiMediaUrl, - cheese_info::CheeseInfo, - cheese_media_url::CheeseMediaUrl, + bangumi_info::EpInBangumi, create_download_task_params::CreateDownloadTaskParams, fav_folders::FavFolders, fav_info::FavInfo, @@ -22,8 +19,6 @@ use crate::{ get_normal_info_params::GetNormalInfoParams, get_user_video_info_params::GetUserVideoInfoParams, normal_info::NormalInfo, - normal_media_url::NormalMediaUrl, - player_info::PlayerInfo, qrcode_data::QrcodeData, qrcode_status::QrcodeStatus, search_params::SearchParams, @@ -37,12 +32,6 @@ use crate::{ }, }; -#[tauri::command] -#[specta::specta] -pub fn greet(name: &str) -> String { - format!("Hello, {}! You've been greeted from Rust!", name) -} - #[tauri::command(async)] #[specta::specta] #[allow(clippy::needless_pass_by_value)] @@ -143,34 +132,6 @@ pub async fn get_normal_info( Ok(normal_info) } -#[tauri::command(async)] -#[specta::specta] -pub async fn get_bangumi_info( - app: AppHandle, - params: GetBangumiInfoParams, -) -> CommandResult { - let bili_client = app.get_bili_client(); - let bangumi_info = bili_client - .get_bangumi_info(params) - .await - .map_err(|err| CommandError::from("获取番剧视频信息失败", err))?; - Ok(bangumi_info) -} - -#[tauri::command(async)] -#[specta::specta] -pub async fn get_cheese_info( - app: AppHandle, - params: GetCheeseInfoParams, -) -> CommandResult { - let bili_client = app.get_bili_client(); - let cheese_info = bili_client - .get_cheese_info(params) - .await - .map_err(|err| CommandError::from("获取课程视频信息失败", err))?; - Ok(cheese_info) -} - #[tauri::command(async)] #[specta::specta] pub async fn get_user_video_info( @@ -185,54 +146,6 @@ pub async fn get_user_video_info( Ok(user_video_info) } -#[tauri::command(async)] -#[specta::specta] -pub async fn get_normal_url( - app: AppHandle, - bvid: String, - cid: i64, -) -> CommandResult { - let bili_client = app.get_bili_client(); - let media_url = bili_client - .get_normal_url(&bvid, cid) - .await - .map_err(|err| CommandError::from("获取普通视频url失败", err))?; - Ok(media_url) -} - -#[tauri::command(async)] -#[specta::specta] -pub async fn get_bangumi_url(app: AppHandle, cid: i64) -> CommandResult { - let bili_client = app.get_bili_client(); - let media_url = bili_client - .get_bangumi_url(cid) - .await - .map_err(|err| CommandError::from("获取番剧视频url失败", err))?; - Ok(media_url) -} - -#[tauri::command(async)] -#[specta::specta] -pub async fn get_cheese_url(app: AppHandle, ep_id: i64) -> CommandResult { - let bili_client = app.get_bili_client(); - let media_url = bili_client - .get_cheese_url(ep_id) - .await - .map_err(|err| CommandError::from("获取课程视频url失败", err))?; - Ok(media_url) -} - -#[tauri::command(async)] -#[specta::specta] -pub async fn get_player_info(app: AppHandle, aid: i64, cid: i64) -> CommandResult { - let bili_client = app.get_bili_client(); - let player_info = bili_client - .get_player_info(aid, cid) - .await - .map_err(|err| CommandError::from("获取播放器信息失败", err))?; - Ok(player_info) -} - #[tauri::command(async)] #[specta::specta] pub async fn get_fav_folders(app: AppHandle, uid: i64) -> CommandResult { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index e7a291c..53c5c3c 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -34,20 +34,13 @@ fn generate_context() -> tauri::Context { pub fn run() { let builder = tauri_specta::Builder::::new() .commands(tauri_specta::collect_commands![ - greet, get_config, save_config, generate_qrcode, get_qrcode_status, get_user_info, get_normal_info, - get_bangumi_info, - get_cheese_info, get_user_video_info, - get_normal_url, - get_bangumi_url, - get_cheese_url, - get_player_info, get_fav_folders, get_fav_info, get_watch_later_info, diff --git a/src/bindings.ts b/src/bindings.ts index 2e20dcd..aa49acf 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -5,9 +5,6 @@ export const commands = { -async greet(name: string) : Promise { - return await TAURI_INVOKE("greet", { name }); -}, async getConfig() : Promise { return await TAURI_INVOKE("get_config"); }, @@ -51,22 +48,6 @@ async getNormalInfo(params: GetNormalInfoParams) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_bangumi_info", { params }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, -async getCheeseInfo(params: GetCheeseInfoParams) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_cheese_info", { params }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, async getUserVideoInfo(params: GetUserVideoInfoParams) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_user_video_info", { params }) }; @@ -75,38 +56,6 @@ async getUserVideoInfo(params: GetUserVideoInfoParams) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_normal_url", { bvid, cid }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, -async getBangumiUrl(cid: number) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_bangumi_url", { cid }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, -async getCheeseUrl(epId: number) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_cheese_url", { epId }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, -async getPlayerInfo(aid: number, cid: number) : Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("get_player_info", { aid, cid }) }; -} catch (e) { - if(e instanceof Error) throw e; - else return { status: "error", error: e as any }; -} -}, async getFavFolders(uid: number) : Promise> { try { return { status: "ok", data: await TAURI_INVOKE("get_fav_folders", { uid }) }; @@ -205,10 +154,8 @@ export type ArgueInfo = { argue_msg: string; argue_type: number; argue_link: str export type AudioQuality = "Unknown" | "64K" | "132K" | "192K" | "Dolby" | "HiRes" export type AudioTask = { selected: boolean; url: string; audio_quality: AudioQuality; content_length: number; chunks: MediaChunk[]; completed: boolean } export type Author = { mid: number; name: string; face: string } -export type AvatarIcon = { icon_resource: IconResource } export type BadgeInfo = { bg_color: string; bg_color_night: string; text: string } export type BangumiInfo = { activity: Activity; actors: string; alias: string; areas: Area[]; bkg_cover: string; cover: string; delivery_fragment_video: boolean; enable_vt: boolean; episodes: EpInBangumi[]; evaluate: string; hide_ep_vv_vt_dm: number; icon_font: IconFont; jp_title: string; link: string; media_id: number; mode: number; new_ep: NewEp; payment: PaymentInBangumi | null; play_strategy: PlayStrategy | null; positive: Positive; publish: Publish; rating: Rating | null; record: string; rights: RightsInBangumi; season_id: number; season_title: string; seasons: Season[]; section: SectionInBangumi[] | null; series: Series; share_copy: string; share_sub_title: string; share_url: string; show: Show; show_season_type: number; square_cover: string; staff: string; stat: StatInBangumi; status: number; styles: string[]; subtitle: string; title: string; total: number; type: number; up_info: UpInfoInBangumi | null; user_status: UserStatusInBangumi } -export type BangumiMediaUrl = { accept_format: string; code: number; seek_param: string; is_preview: number; fnval: number; video_project: boolean; fnver: number; type: string; bp: number; seek_type: string; result: string; vip_type: number | null; from: string; video_codecid: number; record_info: RecordInfo | null; is_drm: boolean; no_rexcode: number; format: string; support_formats: SupportFormatInBangumi[]; message: string; accept_quality: number[]; quality: number; timelength: number; durls: DurlInBangumi[]; has_paid: boolean; vip_status: number | null; error_code: number; dash: DashInBangumi | null; clip_info_list: ClipInfoList[]; accept_description: string[]; status: number } export type BangumiSearchResult = { ep: EpInBangumi | null; info: BangumiInfo } export type Brief = { content: string; img: Img[]; title: string; type: number } export type CanvasConfig = { @@ -267,9 +214,7 @@ outline: number; */ time_offset: number } export type CheeseInfo = { abtest_info: AbtestInfo; be_subscription: boolean; brief: Brief; consulting: Consulting; cooperation: Cooperation; course_content: string; cover: string; ep_count: number; episode_page: EpPage; episode_sort: number; episode_tag: EpTag; episodes: EpInCheese[]; expiry_day: number; expiry_info_content: string; faq: Faq; faq1: Faq1; is_enable_cash: boolean; is_series: boolean; live_ep_count: number; opened_ep_count: number; paid_jump: PaidJump; paid_view: boolean; payment: Payment; previewed_purchase_note: PreviewedPurchaseNote; purchase_format_note: PurchaseFormatNote; purchase_note: PurchaseNote; purchase_protocol: PurchaseProtocol; recommend_seasons: RecommendSeason[]; release_bottom_info: string; release_info: string; release_info2: string; release_status: string; season_id: number; season_tag: number; share_url: string; short_link: string; show_watermark: boolean; stat: StatInCheese; status: number; stop_sell: boolean; subscription_update_count_cycle_text: string; subtitle: string; title: string; up_info: UpInfoInCheese; update_status: number; user_status: UserStatusInCheese; watermark_interval: number } -export type CheeseMediaUrl = { accept_format: string; code: number; seek_param: string; is_preview: number; fnval: number; video_project: boolean; play_view_business_info: PlayViewBusinessInfo | null; fnver: number; type: string; result: string; seek_type: string; from: string; video_codecid: number; no_rexcode: number; format: string; support_formats: SupportFormatInCheese[]; message: string; accept_quality: number[]; quality: number; timelength: number; durls: DurlInCheese[]; has_paid: boolean; dash: DashInCheese | null; accept_description: string[]; status: number } export type CheeseSearchResult = { ep: EpInCheese | null; info: CheeseInfo } -export type ClipInfoList = { materialNo: number; start: number; end: number; toastText: string; clipType: string } export type CntInfo = { collect: number; play: number; thumb_up: number; share: number } export type CntInfoInMedia = { collect: number; play: number; danmaku: number; vt: number; play_switch: number; reply: number; view_text_1: string } export type CodecType = "Unknown" | "Audio" | "AVC" | "HEVC" | "AV1" @@ -284,23 +229,14 @@ export type CreateCheeseDownloadTaskParams = { ep_ids: number[]; info: CheeseInf export type CreateDownloadTaskParams = { Normal: CreateNormalDownloadTaskParams } | { Bangumi: CreateBangumiDownloadTaskParams } | { Cheese: CreateCheeseDownloadTaskParams } export type CreateNormalDownloadTaskParams = { info: NormalInfo; aid_cid_pairs: ([number, number | null])[] } export type DanmakuTask = { xml_selected: boolean; ass_selected: boolean; json_selected: boolean; completed: boolean } -export type DashInBangumi = { duration: number; min_buffer_time: number; video: MediaInBangumi[]; audio: MediaInBangumi[] | null } -export type DashInCheese = { duration: number; min_buffer_time: number; video: MediaInCheese[]; audio: MediaInCheese[] | null } -export type DashInNormal = { duration: number; min_buffer_time: number; video: MediaInNormal[]; audio: MediaInNormal[] | null; dolby: Dolby; flac: Flac | null } export type DescV2 = { raw_text: string; type: number; biz_id: number } export type Dimension = { width: number; height: number; rotate: number } export type DimensionInBangumi = { height: number; rotate: number; width: number } export type DimensionInWatchLater = { width: number; height: number; rotate: number } -export type Dolby = { type: number; audio: MediaInNormal[] | null } export type DownloadEvent = { event: "Speed"; data: { speed: string } } | { event: "TaskCreate"; data: { state: DownloadTaskState; progress: DownloadProgress } } | { event: "TaskStateUpdate"; data: { task_id: string; state: DownloadTaskState } } | { event: "TaskSleeping"; data: { task_id: string; remaining_sec: number } } | { event: "TaskDelete"; data: { task_id: string } } | { event: "ProgressPreparing"; data: { task_id: string } } | { event: "ProgressUpdate"; data: { progress: DownloadProgress } } export type DownloadProgress = { task_id: string; episode_type: EpisodeType; aid: number; bvid: string | null; cid: number; ep_id: number | null; duration: number; pub_ts: number; collection_title: string; part_title: string | null; part_order: number | null; episode_title: string; episode_order: number; up_name: string | null; up_uid: number | null; up_avatar: string | null; episode_dir: string; filename: string; video_task: VideoTask; audio_task: AudioTask; merge_task: MergeTask; subtitle_task: SubtitleTask; danmaku_task: DanmakuTask; cover_task: CoverTask; nfo_task: NfoTask; json_task: JsonTask; create_ts: number; completed_ts: number | null } export type DownloadTaskState = "Pending" | "Downloading" | "Paused" | "Completed" | "Failed" -export type DurlDetailInBangumi = { size: number; ahead: string; length: number; vhead: string; backup_url: string[]; url: string; order: number; md5: string } -export type DurlDetailInCheese = { size: number; ahead: string; length: number; vhead: string; backup_url: string[]; url: string; order: number; md5: string } -export type DurlInBangumi = { durl: DurlDetailInBangumi[]; quality: number } -export type DurlInCheese = { durl: DurlDetailInCheese[]; quality: number } export type Ed = { end: number; start: number } -export type ElecHighLevel = { privilege_type: number; title: string; sub_title: string; show_button: boolean; button_text: string; jump_url: string; intro: string; new: boolean; question_text: string; qa_title: string } export type EpInBangumi = { aid: number; badge: string; badge_info: BadgeInfo; badge_type: number | null; bvid: string | null; cid: number; cover: string; dimension: DimensionInBangumi | null; duration: number | null; enable_vt: boolean; ep_id: number; from: string | null; id: number; is_view_hide: boolean; link: string; link_type: string | null; long_title: string | null; pub_time: number; pv: number; release_date: string | null; rights: RightsInBangumiEp | null; section_type: number; share_copy: string | null; share_url: string | null; short_link: string | null; showDrmLoginDialog: boolean; show_title: string | null; skip: Skip | null; status: number; subtitle: string | null; title: string; vid: string | null; icon_font: IconFont | null } export type EpInCheese = { aid: number; catalogue_index: number; cid: number; cover: string; duration: number; ep_status: number; episode_can_view: boolean; from: string; id: number; index: number; label: string | null; page: number; play: number; play_way: number; playable: boolean; release_date: number; show_vt: boolean; status: number; subtitle: string; title: string; watched: boolean; watchedHistory: number } export type EpInNormal = { season_id: number; section_id: number; id: number; aid: number; cid: number; title: string; attribute: number; arc: Arc; page: PageInNormalEp; bvid: string; pages: PageInNormalEp[] } @@ -314,8 +250,6 @@ export type Faq1Item = { answer: string; question: string } export type FavFolders = { count: number; list: Folder[] } export type FavInfo = { info: Info; medias: MediaInFav[] | null; has_more: boolean; ttl: number } export type FavSearchResult = FavInfo -export type Fawkes = { config_version: number; ff_version: number } -export type Flac = { display: boolean; audio: MediaInNormal | null } export type Folder = { id: number; fid: number; mid: number; attr: number; title: string; fav_state: number; media_count: number } export type GetBangumiInfoParams = { EpId: number } | { SeasonId: number } export type GetCheeseInfoParams = { EpId: number } | { SeasonId: number } @@ -325,23 +259,16 @@ export type GetUserVideoInfoParams = { pn: number; mid: number } export type Honor = { aid: number; type: number; desc: string; weekly_recommend_num: number } export type HonorReply = { honor: Honor[] | null } export type IconFont = { name: string; text: string } -export type IconResource = Record export type Img = { aspect_ratio: number; url: string } export type Info = { id: number; fid: number; mid: number; attr: number; title: string; cover: string; upper: Upper; cover_type: number; cnt_info: CntInfo; type: number; intro: string; ctime: number; mtime: number; state: number; fav_state: number; like_state: number; media_count: number; is_top: boolean } -export type IpInfo = { ip: string; zone_ip: string; zone_id: number; country: string; province: string; city: string } export type JsonTask = { selected: boolean; completed: boolean } export type JsonValue = null | boolean | number | string | JsonValue[] | { [key in string]: JsonValue } -export type LabelInPlayerInfo = { path: string; text: string; label_theme: string; text_color: string; bg_style: number; bg_color: string; border_color: string; use_img_label: boolean; img_label_uri_hans: string; img_label_uri_hant: string; img_label_uri_hans_static: string; img_label_uri_hant_static: string } export type LabelInUserInfo = { path: string; text: string; label_theme: string; text_color: string; bg_style: number; bg_color: string; border_color: string; use_img_label: boolean; img_label_uri_hans: string; img_label_uri_hant: string; img_label_uri_hans_static: string; img_label_uri_hant_static: string } -export type LevelInfoInPlayerInfo = { current_level: number; current_min: number; current_exp: number; next_exp: number; level_up: number } export type LevelInfoInUserInfo = { current_level: number; current_min: number; current_exp: number } export type LogEvent = { timestamp: string; level: LogLevel; fields: { [key in string]: JsonValue }; target: string; filename: string; line_number: number } export type LogLevel = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" export type MediaChunk = { start: number; end: number; completed: boolean } -export type MediaInBangumi = { start_with_sap: number; bandwidth: number; sar: string; backup_url: string[]; codecs: string; base_url: string; segment_base: SegmentBaseInBangumi; mime_type: string; frame_rate: string; codecid: number; size: number; width: number; id: number; height: number; md5: string } -export type MediaInCheese = { start_with_sap: number; bandwidth: number; sar: string; codecs: string; base_url: string; backup_url: string[]; segment_base: SegmentBaseInCheese; frame_rate: string; codecid: number; size: number; mime_type: string; width: number; id: number; height: number; md5: string } export type MediaInFav = { id: number; type: number; title: string; cover: string; intro: string; page: number; duration: number; upper: UpperInMedia; attr: number; cnt_info: CntInfoInMedia; link: string; ctime: number; pubtime: number; fav_time: number; bv_id: string; bvid: string; ugc: Ugc | null; media_list_link: string } -export type MediaInNormal = { id: number; start_with_sap: number; bandwidth: number; sar: string; codecs: string; base_url: string; backup_url: string[]; segment_base: SegmentBaseInNormal; mime_type: string; frame_rate: string; width: number; height: number; codecid: number } export type MediaInWatchLater = { aid: number; videos: number; tid: number; tname: string; copyright: number; pic: string; title: string; pubdate: number; ctime: number; desc: string; state: number; duration: number; redirect_url: string | null; mission_id: number | null; rights: RightsInWatchLater; owner: OwnerInWatchLater; stat: StatInWatchLater; dynamic: string; dimension: DimensionInWatchLater; short_link_v2: string; up_from_v2: number | null; first_frame: string | null; pub_location: string | null; cover43: string; tidv2: number; tnamev2: string; pid_v2: number; pid_name_v2: string; page: PageInWatchLater; count: number; cid: number; progress: number; add_at: number; bvid: string; uri: string; enable_vt: number; view_text_1: string; card_type: number; left_icon_type: number; left_text: string; right_icon_type: number; right_text: string; arc_state: number; pgc_label: string; show_up: boolean; forbid_fav: boolean; forbid_sort: boolean; season_title: string; long_title: string; index_title: string; c_source: string; season_id: number | null } export type MergeTask = { selected: boolean; completed: boolean } export type MetaInUserVideo = { id: number; title: string; cover: string; mid: number; intro: string; sign_state: number; attribute: number; stat: StatInUserVideo; ep_count: number; first_aid: number; ptime: number; ep_num: number } @@ -349,13 +276,10 @@ export type NewEp = { desc: string; id: number; is_new: number; title: string } export type NewEpInSeason = { cover: string; id: number; index_show: string } export type NfoTask = { selected: boolean; completed: boolean } export type NormalInfo = { bvid: string; aid: number; videos: number; tid: number; tid_v2: number; tname: string; tname_v2: string; copyright: number; pic: string; title: string; pubdate: number; ctime: number; desc: string; desc_v2: DescV2[] | null; state: number; duration: number; rights: Rights; owner: OwnerInNormal; stat: StatInNormal; argue_info: ArgueInfo; dynamic: string; cid: number; dimension: Dimension; teenage_mode: number; is_chargeable_season: boolean; is_story: boolean; is_upower_exclusive: boolean; is_upower_play: boolean; is_upower_preview: boolean; enable_vt: number; vt_display: string; is_upower_exclusive_with_qa: boolean; no_cache: boolean; pages: PageInNormal[]; subtitle: SubtitleInNormal; staff: Staff[] | null; ugc_season: UgcSeason | null; is_season_display: boolean; user_garb: UserGarb; honor_reply: HonorReply; like_icon: string; need_jump_bv: boolean; disable_show_up_info: boolean; is_story_play: number; is_view_self: boolean } -export type NormalMediaUrl = { from: string; result: string; message: string; quality: number; format: string; timelength: number; accept_format: string; accept_description: string[]; accept_quality: number[]; video_codecid: number; seek_param: string; seek_type: string; dash: DashInNormal; support_formats: SupportFormatInNormal[]; last_play_time: number; last_play_cid: number; play_conf: PlayConf } export type NormalSearchResult = NormalInfo export type Official = { role: number; title: string; desc: string; type: number } export type OfficialVerify = { type: number; desc: string } -export type OnlineSwitch = { enable_gray_dash_playback: string; new_broadcast: string; realtime_dm: string; subtitle_submit_switch: string } export type Op = { end: number; start: number } -export type Options = { is_360: boolean; without_vip: boolean } export type OwnerInNormal = { mid: number; name: string; face: string } export type OwnerInWatchLater = { mid: number; name: string; face: string } export type PageInNormal = { cid: number; page: number; from: string; part: string; duration: number; vid: string; weblink: string; dimension: Dimension; ctime: number } @@ -368,10 +292,7 @@ export type Payment = { bp_enough: number; desc: string; my_bp: number; pay_shad export type PaymentInBangumi = { discount: number; pay_type: PayType; price: string; promotion: string; tip: string; view_start_time: number; vip_discount: number; vip_first_promotion: string; vip_price: string; vip_promotion: string } export type PendantInCheese = { image: string; name: string; pid: number } export type PendantInUserInfo = { pid: number; name: string; image: string; expire: number; image_enhance: string; image_enhance_frame: string; n_pid: number } -export type PlayConf = { is_new_description: boolean } export type PlayStrategy = { strategies: string[] } -export type PlayViewBusinessInfo = { user_status: UserStatusInCheeseUrl } -export type PlayerInfo = { aid: number; bvid: string; allow_bp: boolean; no_share: boolean; cid: number; max_limit: number; page_no: number; has_next: boolean; ip_info: IpInfo; login_mid: number; login_mid_hash: string; is_owner: boolean; name: string; permission: string; level_info: LevelInfoInPlayerInfo; vip: VipInPlayerInfo; answer_status: number; block_time: number; role: string; last_play_time: number; last_play_cid: number; now_time: number; online_count: number; need_login_subtitle: boolean; subtitle: SubtitleInPlayerInfo; view_points: ViewPoint[]; preview_toast: string; options: Options; online_switch: OnlineSwitch; fawkes: Fawkes; show_switch: ShowSwitch; toast_block: boolean; is_upower_exclusive: boolean; is_upower_play: boolean; is_ugc_pay_preview: boolean; elec_high_level: ElecHighLevel; disable_show_up_info: boolean; is_upower_exclusive_with_qa: boolean } export type Positive = { id: number; title: string } export type PreferAudioQuality = "Best" | "64K" | "132K" | "192K" | "Dolby" | "HiRes" export type PreferCodecType = "Unknown" | "AVC" | "HEVC" | "AV1" @@ -386,7 +307,6 @@ export type QrcodeData = { url: string; qrcode_key: string } export type QrcodeStatus = { url: string; refresh_token: string; timestamp: number; code: number; message: string } export type Rating = { count: number; score: number } export type RecommendSeason = { cover: string; ep_count: string; id: number; season_url: string; subtitle: string; title: string; view: number } -export type RecordInfo = { record_icon: string; record: string } export type Rights = { bp: number; elec: number; download: number; movie: number; pay: number; hd5: number; no_reprint: number; autoplay: number; ugc_pay: number; is_cooperation: number; ugc_pay_preview: number; no_background: number; clean_mode: number; is_stein_gate: number; is_360: number; no_share: number; arc_pay: number; free_watch: number } export type RightsInBangumi = { allow_bp: number; allow_bp_rank: number; allow_download: number; allow_review: number; area_limit: number; ban_area_show: number; can_watch: number; copyright: string; forbid_pre: number; freya_white: number; is_cover_show: number; is_preview: number; only_vip_download: number; resource: string; watch_platform: number } export type RightsInBangumiEp = { allow_dm: number; allow_download: number; area_limit: number } @@ -397,12 +317,8 @@ export type SearchResult = { Normal: NormalSearchResult } | { Bangumi: BangumiSe export type Season = { badge: string; badge_info: BadgeInfo; badge_type: number; cover: string; enable_vt: boolean; horizontal_cover_1610: string; horizontal_cover_169: string; icon_font: IconFont; media_id: number; new_ep: NewEpInSeason; season_id: number; season_title: string; season_type: number; stat: StatInSeason } export type SectionInBangumi = { attr: number; episodes: EpInBangumi[]; id: number; title: string; type: number; type2: number } export type SectionInNormal = { season_id: number; id: number; title: string; type: number; episodes: EpInNormal[] } -export type SegmentBaseInBangumi = { initialization: string; index_range: string } -export type SegmentBaseInCheese = { initialization: string; index_range: string } -export type SegmentBaseInNormal = { initialization: string; index_range: string } export type Series = { display_type: number; series_id: number; series_title: string } export type Show = { wide_screen: number } -export type ShowSwitch = { long_progress: boolean } export type Skip = { ed: Ed; op: Op } export type Staff = { mid: number; title: string; name: string; face: string; follower: number; label_style: number } export type StatInBangumi = { coins: number; danmakus: number; favorite: number; favorites: number; follow_text: string; likes: number; reply: number; share: number; views: number; vt: number } @@ -414,13 +330,8 @@ export type StatInSeason = { favorites: number; series_follow: number; views: nu export type StatInUserVideo = { season_id: number; view: number; danmaku: number; reply: number; favorite: number; coin: number; share: number; like: number; mtime: number; vt: number; vv: number } export type StatInWatchLater = { aid: number; view: number; danmaku: number; reply: number; favorite: number; coin: number; share: number; now_rank: number; his_rank: number; like: number; dislike: number; vt: number; vv: number } export type SubtitleDetailInNormal = { id: number; lan: string; lan_doc: string; is_lock: boolean; subtitle_url: string; type: number; id_str: string; ai_type: number; ai_status: number } -export type SubtitleDetailInPlayerInfo = { id: number; lan: string; lan_doc: string; is_lock: boolean; subtitle_url: string; type: number; id_str: string; ai_type: number; ai_status: number } export type SubtitleInNormal = { allow_submit: boolean; list: SubtitleDetailInNormal[] } -export type SubtitleInPlayerInfo = { allow_submit: boolean; lan: string; lan_doc: string; subtitles: SubtitleDetailInPlayerInfo[] } export type SubtitleTask = { selected: boolean; completed: boolean } -export type SupportFormatInBangumi = { display_desc: string; has_preview: boolean; sub_description: string; superscript: string; need_login: boolean | null; codecs: string[]; format: string; description: string; need_vip: boolean | null; attribute: number; quality: number; new_description: string } -export type SupportFormatInCheese = { display_desc: string; superscript: string; need_login: boolean; codecs: string[]; format: string; description: string; quality: number; new_description: string } -export type SupportFormatInNormal = { quality: number; format: string; new_description: string; display_desc: string; superscript: string; codecs: string[] } export type Ugc = { first_cid: number } export type UgcSeason = { id: number; title: string; cover: string; mid: number; intro: string; sign_state: number; attribute: number; sections: SectionInNormal[]; stat: StatInNormalSeason; ep_count: number; season_type: number; is_pay_season: boolean; enable_vt: number } export type UpInfoInBangumi = { avatar: string; mid: number; uname: string } @@ -431,19 +342,15 @@ export type UserGarb = { url_image_ani_cut: string } export type UserInfo = { isLogin: boolean; email_verified: number; face: string; face_nft: number; face_nft_type: number; level_info: LevelInfoInUserInfo; mid: number; mobile_verified: number; money: number; moral: number; official: Official; officialVerify: OfficialVerify; pendant: PendantInUserInfo; scores: number; uname: string; vipDueDate: number; vipStatus: number; vipType: number; vip_pay_type: number; vip_theme_type: number; vip_label: VipLabel; vip_avatar_subscript: number; vip_nickname_color: string; vip: VipInUserInfo; wallet: Wallet | null; has_shop: boolean; shop_url: string; answer_status: number; is_senior_member: number; wbi_img: WbiImg; is_jury: boolean } export type UserStatusInBangumi = { area_limit: number; ban_area_show: number; follow: number; follow_status: number; login: number; pay: number; pay_pack_paid: number; sponsor: number } export type UserStatusInCheese = { bp: number; expire_at: number; favored: number; favored_count: number; is_expired: boolean; is_first_paid: boolean; payed: number; user_expiry_content: string } -export type UserStatusInCheeseUrl = { watch_progress: WatchProgress } export type UserVideoInfo = { list: UserVideoList; page: PageInUserVideo } export type UserVideoList = { vlist: EpInUserVideo[] } export type UserVideoSearchResult = UserVideoInfo export type VideoQuality = "Unknown" | "240P" | "360P" | "480P" | "720P" | "720P60" | "1080P" | "AiRepair" | "1080P+" | "1080P60" | "4K" | "HDR" | "Dolby" | "8K" export type VideoTask = { selected: boolean; url: string; video_quality: VideoQuality; codec_type: CodecType; content_length: number; chunks: MediaChunk[]; completed: boolean } -export type ViewPoint = { type: number; from: number; to: number; content: string; img_url: string | null; logo_url: string | null; team_type: string; team_name: string } -export type VipInPlayerInfo = { type: number; status: number; due_date: number; vip_pay_type: number; theme_type: number; label: LabelInPlayerInfo; avatar_subscript: number; nickname_color: string; role: number; avatar_subscript_url: string; tv_vip_status: number; tv_vip_pay_type: number; tv_due_date: number; avatar_icon: AvatarIcon } export type VipInUserInfo = { type: number; status: number; due_date: number; vip_pay_type: number; theme_type: number; label: LabelInUserInfo; avatar_subscript: number; nickname_color: string; role: number; avatar_subscript_url: string; tv_vip_status: number; tv_vip_pay_type: number; tv_due_date: number } export type VipLabel = { path: string; text: string; label_theme: string; text_color: string; bg_style: number; bg_color: string; border_color: string; use_img_label: boolean; img_label_uri_hans: string; img_label_uri_hant: string; img_label_uri_hans_static: string; img_label_uri_hant_static: string } export type Wallet = { mid: number; bcoin_balance: number; coupon_balance: number; coupon_due_time: number } export type WatchLaterInfo = { count: number; list: MediaInWatchLater[] } -export type WatchProgress = { current_watch_progress: number; last_ep_id: number; last_ep_index: string; last_time: number } export type WbiImg = { img_url: string; sub_url: string } /** tauri-specta globals **/