From 5364b7a09b654c7d3bd8d517fd40c0a4b615663a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 20 Sep 2023 13:41:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=AD=8C=E6=9B=B2=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E4=B8=8D=E5=96=9C=E6=AC=A2=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=E6=97=B6=E9=9C=80=E8=A6=81=E4=BA=8C=E6=AC=A1=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E9=98=B2=E6=AD=A2=E6=89=8B=E6=8A=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 4 ++++ src/lang/en-us.json | 4 +++- src/lang/zh-cn.json | 4 +++- src/lang/zh-tw.json | 4 +++- .../components/material/OnlineList/useMusicActions.js | 9 +++++++++ src/renderer/views/Download/useTaskActions.js | 2 +- src/renderer/views/List/MusicList/useMusicActions.js | 8 +++++++- 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 15c80e68..88ee9aac 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -11,6 +11,10 @@ - 新增Scheme URL对播放器的控制操作,新增的操作包含 播放、暂停、下一首、上一首等,详情看Scheme URL文档 +### 优化 + +- 通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖 + ### 修复 - 修复音频输出设备设置在重启软件后被重置的问题(#1568) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 46e56603..d2e026de 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -8,6 +8,7 @@ "btn_confirm": "Confirm", "btn_save": "Save", "cancel_button_text": "Cancel", + "cancel_button_text_2": "No, no, no, wrong click", "close": "Close", "comment__hot_load_error": "Hot comments failed to load, click to try to reload", "comment__hot_loading": "Hot comments are loading", @@ -138,6 +139,7 @@ "list_update_modal__title": "List update management", "list_update_modal__update": "Sync", "lists__add_local_file_desc": "Select song file", + "lists__dislike_music_tip": "Do you really dislike {name}?", "lists__duplicate": "Duplicate song", "lists__export": "Export", "lists__export_part_desc": "Choose where to save the list file", @@ -149,7 +151,7 @@ "lists__new_list_btn": "Create list", "lists__new_list_input": "New list...", "lists__remove": "Remove", - "lists__remove music_tip": "Do you really want to remove the selected {len} songs?", + "lists__remove_music_tip": "Do you really want to remove the selected {len} songs?", "lists__remove_tip": "Do you really want to remove {name}?", "lists__remove_tip_button": "Yes, that's right", "lists__rename": "Rename", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 69d0bc93..2ef533d1 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -8,6 +8,7 @@ "btn_confirm": "确定", "btn_save": "保存", "cancel_button_text": "我不", + "cancel_button_text_2": "不不不,点错了", "close": "关闭", "comment__hot_load_error": "热门评论加载失败,点击尝试重新加载", "comment__hot_loading": "热门评论加载中", @@ -138,6 +139,7 @@ "list_update_modal__title": "列表更新管理", "list_update_modal__update": "立即更新", "lists__add_local_file_desc": "选择歌曲文件", + "lists__dislike_music_tip": "你真的不喜欢 {name} 吗?", "lists__duplicate": "重复歌曲", "lists__export": "导出", "lists__export_part_desc": "选择列表文件保存位置", @@ -149,7 +151,7 @@ "lists__new_list_btn": "新建列表", "lists__new_list_input": "新列表...", "lists__remove": "删除", - "lists__remove music_tip": "你真的要移除所选的 {len} 首歌曲吗?", + "lists__remove_music_tip": "你真的要移除所选的 {len} 首歌曲吗?", "lists__remove_tip": "你真的想要移除 {name} 吗?", "lists__remove_tip_button": "是的 没错", "lists__rename": "重命名", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 1fb07363..c5eefae2 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -8,6 +8,7 @@ "btn_confirm": "確定", "btn_save": "保存", "cancel_button_text": "取消", + "cancel_button_text_2": "不不不,點錯了", "close": "關閉", "comment__hot_load_error": "熱門評論加載失敗,點擊嘗試重新加載", "comment__hot_loading": "熱門評論加載中", @@ -138,6 +139,7 @@ "list_update_modal__title": "列表更新管理", "list_update_modal__update": "立即更新", "lists__add_local_file_desc": "選擇歌曲文件", + "lists__dislike_music_tip": "你真的不喜歡 {name} 嗎?", "lists__duplicate": "重複歌曲", "lists__export": "導出", "lists__export_part_desc": "選擇列表文件保存位置", @@ -149,7 +151,7 @@ "lists__new_list_btn": "新建列表", "lists__new_list_input": "新列表...", "lists__remove": "刪除", - "lists__remove music_tip": "你真的要移除所選的 {len} 首歌曲嗎?", + "lists__remove_music_tip": "你真的要移除所選的 {len} 首歌曲嗎?", "lists__remove_tip": "你真的想要移除 {name} 嗎?", "lists__remove_tip_button": "是的 沒錯", "lists__rename": "重命名", diff --git a/src/renderer/components/material/OnlineList/useMusicActions.js b/src/renderer/components/material/OnlineList/useMusicActions.js index 53a87af6..b9fb27d4 100644 --- a/src/renderer/components/material/OnlineList/useMusicActions.js +++ b/src/renderer/components/material/OnlineList/useMusicActions.js @@ -5,10 +5,13 @@ import { toOldMusicInfo } from '@renderer/utils' import { addDislikeInfo, hasDislike } from '@renderer/core/dislikeList' import { playNext } from '@renderer/core/player' import { playMusicInfo } from '@renderer/store/player/state' +import { dialog } from '@renderer/plugins/Dialog' +import { useI18n } from '@renderer/plugins/i18n' export default ({ props }) => { const router = useRouter() + const t = useI18n() const handleSearch = index => { const info = props.list[index] @@ -29,6 +32,12 @@ export default ({ props }) => { const handleDislikeMusic = async(index) => { const minfo = props.list[index] + const confirm = await dialog.confirm({ + message: t('lists__dislike_music_tip', { name: minfo.name }), + cancelButtonText: t('cancel_button_text_2'), + confirmButtonText: t('confirm_button_text'), + }) + if (!confirm) return await addDislikeInfo([{ name: minfo.name, singer: minfo.singer }]) if (hasDislike(playMusicInfo.musicInfo)) { playNext(true) diff --git a/src/renderer/views/Download/useTaskActions.js b/src/renderer/views/Download/useTaskActions.js index 68177ebf..b8efa6b9 100644 --- a/src/renderer/views/Download/useTaskActions.js +++ b/src/renderer/views/Download/useTaskActions.js @@ -52,7 +52,7 @@ export default ({ list, selectedList, removeAllSelect }) => { if (selectedList.value.length && !single) { // const confirm = await (selectedList.value.length > 1 // ? dialog.confirm({ - // message: t('lists__remove music_tip', { len: selectedList.value.length }), + // message: t('lists__remove_music_tip', { len: selectedList.value.length }), // confirmButtonText: t('lists__remove_tip_button'), // }) // : Promise.resolve(true) diff --git a/src/renderer/views/List/MusicList/useMusicActions.js b/src/renderer/views/List/MusicList/useMusicActions.js index 9135ae26..7664ee16 100644 --- a/src/renderer/views/List/MusicList/useMusicActions.js +++ b/src/renderer/views/List/MusicList/useMusicActions.js @@ -39,6 +39,12 @@ export default ({ props, list, selectedList, removeAllSelect }) => { const handleDislikeMusic = async(index) => { const minfo = list.value[index] + const confirm = await dialog.confirm({ + message: t('lists__dislike_music_tip', { name: minfo.name }), + cancelButtonText: t('cancel_button_text_2'), + confirmButtonText: t('confirm_button_text'), + }) + if (!confirm) return await addDislikeInfo([{ name: minfo.name, singer: minfo.singer }]) if (hasDislike(playMusicInfo.musicInfo)) { playNext(true) @@ -49,7 +55,7 @@ export default ({ props, list, selectedList, removeAllSelect }) => { if (selectedList.value.length && !single) { const confirm = await (selectedList.value.length > 1 ? dialog.confirm({ - message: t('lists__remove music_tip', { len: selectedList.value.length }), + message: t('lists__remove_music_tip', { len: selectedList.value.length }), confirmButtonText: t('lists__remove_tip_button'), }) : Promise.resolve(true)