diff --git a/src/_locales/cmn-CN.yml b/src/_locales/cmn-CN.yml index 62b2a50e..3f3f2c9b 100644 --- a/src/_locales/cmn-CN.yml +++ b/src/_locales/cmn-CN.yml @@ -13,6 +13,7 @@ common: second: 秒前 please_log_in_first: 请先登录 login: 登录 + save_to_watch_later: 稍后再看 settings: title: 设置 select_language: 界面语文 @@ -132,10 +133,12 @@ dock: history: 观看历史 dark_mode: 暗色模式 light_mode: 亮色模式 + watch_later: 稍后再看 settings: 设置 home: not_interested_in: 对哪方面不感兴趣? video_removed: 视频已移除 + save_to_watch_later: 添加到稍后再看 anime: total_episodes: 全 {ep} 话 update_to_n_episodes: 更新至 {ep} 话 @@ -169,3 +172,14 @@ history: turn_on_watch_history_confirm: |- 要开启观看历史吗? 你确定要开启观看历史吗? +watch_later: + title: 稍后再看 + play_all: 播放全部 + clear_all: 清空稍后再看 + clear_all_confirm: |- + 要清空稍后再看吗? + 该操作无法撤销,你确定要清空稍后再看吗? + remove_watched_videos: 清除已观看的视频 + remove_watched_videos_confirm: |- + 要清除已观看的视频吗? + 该操作无法撤销,你确定要清除已观看的视频吗? \ No newline at end of file diff --git a/src/_locales/cmn-TW.yml b/src/_locales/cmn-TW.yml index 3e097b21..71ad76a0 100644 --- a/src/_locales/cmn-TW.yml +++ b/src/_locales/cmn-TW.yml @@ -13,6 +13,7 @@ common: second: 秒前 please_log_in_first: 請先登入 login: 登入 + save_to_watch_later: 稍後觀看 settings: title: 設定 select_language: 介面語文 @@ -130,6 +131,7 @@ dock: home: 首頁 anime: 動畫 history: 觀看記錄 + watch_later: 稍後觀看 dark_mode: 深色模式 light_mode: 淺色模式 settings: 設定 @@ -169,3 +171,14 @@ history: turn_on_watch_history_confirm: |- 要啟用觀看記錄嗎? 你確定要啟用觀看記錄嗎? +watch_later: + title: 稍後觀看 + play_all: 全部播放 + clear_all: 清空稍後觀看 + clear_all_confirm: |- + 要清空稍後觀看的影片嗎? + 此操作無法撤消,你確定要清空稍後觀看的影片嗎? + remove_watched_videos: 移除看過的影片 + remove_watched_videos_confirm: |- + 要移除看過的影片嗎? + 此操作無法撤消,你確定要移除看過的影片嗎? \ No newline at end of file diff --git a/src/_locales/en.yml b/src/_locales/en.yml index b10435d3..bb378616 100644 --- a/src/_locales/en.yml +++ b/src/_locales/en.yml @@ -13,6 +13,7 @@ common: second: second ago | seconds ago please_log_in_first: Please log in first login: Login + save_to_watch_later: Save to Watch later settings: title: Settings select_language: Language @@ -131,6 +132,7 @@ dock: home: Home anime: Anime history: History + watch_later: Watch later dark_mode: Dark Mode light_mode: Light Mode settings: Settings @@ -159,14 +161,24 @@ history: title: Watch History search_watch_history: Search watch history clear_all_watch_history: Clear all watch history - clear_all_watch_history_confirm: >- - Clear all watch history? - - This operation cannot be reversed. Are you sure you want to clear all watch - history? + clear_all_watch_history_confirm: |- + Clear all watch history? + This operation cannot be reversed. Are you sure you want to clear all watch history? pause_watch_history: Pause watch history pause_watch_history_confirm: |- - Pause watch history? + Pause watch history? Are you sure you want to pause watch history? turn_on_watch_history: Turn on watch history turn_on_watch_history_confirm: Turn on watch history? Are you sure you want to turn on watch history? +watch_later: + title: Watch Later + play_all: Play all + clear_all: Clear all watch later + clear_all_confirm: |- + Clear all watch later? + This operation cannot be reversed. Are you sure you want to clear all watch later? + remove_watched_videos: Remove watched videos + remove_watched_videos_confirm: |- + Remove watched videos? + This operation cannot be reversed. Are you sure you want to remove watched videos? + diff --git a/src/_locales/jyut.yml b/src/_locales/jyut.yml index 8ec6f7e7..b23a55a3 100644 --- a/src/_locales/jyut.yml +++ b/src/_locales/jyut.yml @@ -13,6 +13,7 @@ common: second: 秒前 please_log_in_first: 唔該登入先 login: 登入 + save_to_watch_later: 陣間至睇 settings: title: 校做 select_language: 介面語文 @@ -130,6 +131,7 @@ dock: home: 主頁 anime: 動畫 history: 收睇記錄 + watch_later: 陣間至睇 dark_mode: 深色模式 light_mode: 淺色模式 settings: 校做 @@ -160,12 +162,23 @@ history: pause_watch_history: 暫停進行收睇記錄 clear_all_watch_history: 剷晒啲收睇記錄 clear_all_watch_history_confirm: |- - 諗住剷晒啲收睇記錄? + 係咪要剷晒啲收睇記錄呀? 噉做冇得返轉頭噃,你確定要剷晒啲收睇記錄? pause_watch_history_confirm: |- - 諗住暫停進行收睇記錄? + 係咪要暫停進行收睇記錄呀? 你確定要暫停暫停進行收睇記錄? search_watch_history: 搵吓收睇記錄 turn_on_watch_history_confirm: |- - 諗住開返收睇記錄? + 係咪要開返收睇記錄呀? 你確定要開返收睇記錄? +watch_later: + title: 陣間至睇 + play_all: 播晒佢哋 + clear_all: 剷曬陣間至睇啲片 + clear_all_confirm: |- + 係咪要剷曬陣間至睇啲片呀? + 噉做冇得返轉頭噃,你確定要剷曬陣間至睇啲片? + remove_watched_videos: 剷走睇過啲片 + remove_watched_videos_confirm: |- + 係咪要剷走你睇過啲片呀? + 噉做冇得返轉頭噃,你確定要剷走你睇過啲片? \ No newline at end of file diff --git a/src/background/messageListeners/watchLater.ts b/src/background/messageListeners/watchLater.ts index 40c4d2f3..2a1b0f9e 100644 --- a/src/background/messageListeners/watchLater.ts +++ b/src/background/messageListeners/watchLater.ts @@ -19,12 +19,13 @@ export const setupWatchLaterMsgLstnr = () => { } // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/history&toview/toview.md#%E5%88%A0%E9%99%A4%E7%A8%8D%E5%90%8E%E5%86%8D%E7%9C%8B%E8%A7%86%E9%A2%91 else if (message.contentScriptQuery === 'removeFromWatchLater') { - const url = 'https://api.bilibili.com/x/v2/history/toview/del' + const url = `https://api.bilibili.com/x/v2/history/toview/del?${message.aid ? `aid=${message.aid}` : ''}` return fetch(url, { method: 'POST', body: new URLSearchParams({ csrf: message.csrf, - aid: message.aid, + // aid: message.aid, + viewed: message.viewed, }), }) .then(response => response.json()) @@ -39,6 +40,19 @@ export const setupWatchLaterMsgLstnr = () => { .then(data => data) .catch(error => console.error(error)) } + // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/history&toview/toview.md#%E6%B8%85%E7%A9%BA%E7%A8%8D%E5%90%8E%E5%86%8D%E7%9C%8B%E8%A7%86%E9%A2%91%E5%88%97%E8%A1%A8 + else if (message.contentScriptQuery === 'clearAllWatchLater') { + const url = 'https://api.bilibili.com/x/v2/history/toview/clear' + return fetch(url, { + method: 'POST', + body: new URLSearchParams({ + csrf: message.csrf, + }), + }) + .then(response => response.json()) + .then(data => data) + .catch(error => console.error(error)) + } }) }) } diff --git a/src/components/Button.vue b/src/components/Button.vue index c0aaf47b..0549ff2d 100644 --- a/src/components/Button.vue +++ b/src/components/Button.vue @@ -10,6 +10,10 @@ interface Props { size?: 'small' | 'medium' | 'large' /** @description enable frosted glass effect */ frosted?: boolean + secondary?: boolean + color?: string + textColor?: string + strong?: boolean } // const props = withDefaults(defineProps(), {}) @@ -26,10 +30,14 @@ const handleClick = (evt: MouseEvent) => { - + - +

-
+
-