通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖

pull/1583/head
lyswhut 2023-09-20 13:41:25 +08:00
parent 52630aa735
commit 5364b7a09b
7 changed files with 30 additions and 5 deletions

View File

@ -11,6 +11,10 @@
- 新增Scheme URL对播放器的控制操作新增的操作包含 播放、暂停、下一首、上一首等详情看Scheme URL文档
### 优化
- 通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖
### 修复
- 修复音频输出设备设置在重启软件后被重置的问题(#1568

View File

@ -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",

View File

@ -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": "重命名",

View File

@ -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": "重命名",

View File

@ -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)

View File

@ -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)

View File

@ -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)