mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
添加导入文件错误时的指引提示
This commit is contained in:
parent
4dc6d0aaac
commit
ad3fd66a44
@ -7,6 +7,7 @@
|
||||
|
||||
- 支持mg源的歌词翻译(之前添加的歌曲需要去设置清空缓存才会刷新歌词)
|
||||
- 添加歌曲列表更新操作的二次确认
|
||||
- 添加导入文件错误时的指引提示
|
||||
|
||||
### 修复
|
||||
|
||||
|
@ -52,7 +52,12 @@
|
||||
"list_import_part_button_confirm": "Overwrite",
|
||||
"list_import_part_confirm": "The imported list ({{importName}}) has the same ID as the local list ({{localName}}). Do you overwrite the local list?",
|
||||
"list_import_part_desc": "Select list file",
|
||||
"list_import_part_tip_failed": "This does not seem to be a single list file",
|
||||
"list_import_tip__alldata": "This is a backup file of all data, you need to go here to import:\nSettings -> Backup & Restore -> List Data -> Import List",
|
||||
"list_import_tip__failed": "Import failed",
|
||||
"list_import_tip__playlist": "This is a list backup file, you need to go here to import:\nSettings -> Backup & Restore -> List Data -> Import List",
|
||||
"list_import_tip__playlist_part": "This is a single list file, you need to go here to import:\nMy Lists -> Click the menu button to the right of any list name -> Select Import from the pop-up menu",
|
||||
"list_import_tip__setting": "This is a settings backup file, the mobile terminal does not support importing such files",
|
||||
"list_import_tip__unknown": "Unknown file type, please try upgrading to the latest version and try again",
|
||||
"list_loading": "Loading...",
|
||||
"list_multi_add_title_first_add": "Add selected",
|
||||
"list_multi_add_title_first_move": "Move the selected one",
|
||||
@ -78,6 +83,7 @@
|
||||
"never_show": "Never show again",
|
||||
"notifications_check_tip": "You have not allowed LX Music to display notifications, or the Music Service in the LX Music notification settings has been disabled, which will prevent you from using the notification bar to pause, switch songs, etc. Do you want to enable it?",
|
||||
"notifications_check_title": "Notification permission reminder",
|
||||
"ok": "OK",
|
||||
"parent_dir_name": "Parent directory",
|
||||
"pause": "Pause",
|
||||
"play": "Play",
|
||||
@ -111,7 +117,6 @@
|
||||
"setting_backup_part_export_setting_desc": "Save the list to...",
|
||||
"setting_backup_part_import_list": "Import List",
|
||||
"setting_backup_part_import_list_desc": "Select the list of backup files",
|
||||
"setting_backup_part_import_list_tip_failed": "This does not seem to be a playlist file 😲",
|
||||
"setting_backup_part_import_list_tip_runing": "🚀I am trying to import...\nIf the list is too big, it may take some time⏳",
|
||||
"setting_backup_part_import_list_tip_success": "Import successful 🎉",
|
||||
"setting_backup_part_import_list_tip_unzip": "📦File parsing...\nIf the file is too large, it may take some time⏳",
|
||||
|
@ -52,7 +52,12 @@
|
||||
"list_import_part_button_confirm": "覆盖掉",
|
||||
"list_import_part_confirm": "导入的列表({{importName}})与本地列表({{localName}})的ID相同,是否覆盖本地列表?",
|
||||
"list_import_part_desc": "选择列表文件",
|
||||
"list_import_part_tip_failed": "这似乎不是单个的列表文件哦",
|
||||
"list_import_tip__failed": "导入失败",
|
||||
"list_import_tip__alldata": "这是一个所有数据备份文件,你需要去这里导入:\n设置 -> 备份与恢复 -> 列表数据 -> 导入列表",
|
||||
"list_import_tip__playlist": "这是一个列表备份文件,你需要去这里导入:\n设置 -> 备份与恢复 -> 列表数据 -> 导入列表",
|
||||
"list_import_tip__playlist_part": "这是一个单列表文件,你需要去这里导入:\n我的列表 -> 点击任意一个列表名右侧的菜单按钮 -> 在弹出的菜单中选择导入",
|
||||
"list_import_tip__setting": "这是一个设置备份文件,移动端不支持导入此类文件",
|
||||
"list_import_tip__unknown": "未知的文件类型,请尝试升级到最新版本后再试",
|
||||
"list_loading": "加载中...",
|
||||
"list_multi_add_title_first_add": "添加已选的",
|
||||
"list_multi_add_title_first_move": "移动已选的",
|
||||
@ -79,6 +84,7 @@
|
||||
"never_show": "不再提醒",
|
||||
"notifications_check_tip": "你没有允许LX Music显示通知,或LX Music通知设置里的Music Service通知被禁用,这将无法使用通知栏进行暂停、切歌等操作,是否去开启?",
|
||||
"notifications_check_title": "通知权限提醒",
|
||||
"ok": "我知道了",
|
||||
"parent_dir_name": "父级目录",
|
||||
"pause": "暂停",
|
||||
"play": "播放",
|
||||
@ -112,7 +118,6 @@
|
||||
"setting_backup_part_export_setting_desc": "选择设置保存位置",
|
||||
"setting_backup_part_import_list": "导入列表",
|
||||
"setting_backup_part_import_list_desc": "选择列表备份文件",
|
||||
"setting_backup_part_import_list_tip_failed": "这似乎不是播放列表文件哦😲",
|
||||
"setting_backup_part_import_list_tip_runing": "🚀正在努力导入中...\n若列表太大可能需要一些时间⏳",
|
||||
"setting_backup_part_import_list_tip_success": "导入成功🎉",
|
||||
"setting_backup_part_import_list_tip_unzip": "📦文件解析中...\n若文件太大可能需要一些时间⏳",
|
||||
|
@ -11,7 +11,7 @@ import Menu from '@/components/common/Menu'
|
||||
import ConfirmAlert from '@/components/common/ConfirmAlert'
|
||||
import Input from '@/components/common/Input'
|
||||
import { filterFileName } from '@/utils'
|
||||
import { getListScrollPosition, saveListScrollPosition, toast, handleSaveFile, handleReadFile, confirmDialog } from '@/utils/tools'
|
||||
import { getListScrollPosition, saveListScrollPosition, toast, handleSaveFile, handleReadFile, confirmDialog, showImportTip } from '@/utils/tools'
|
||||
import { LIST_SCROLL_POSITION_KEY, LXM_FILE_EXT_RXP } from '@/config/constant'
|
||||
import musicSdk from '@/utils/music'
|
||||
import ChoosePath from '@/components/common/ChoosePath'
|
||||
@ -95,7 +95,7 @@ const ImportExport = ({ actionType, visible, hide, selectedListRef }) => {
|
||||
case 'import':
|
||||
toast(t('setting_backup_part_import_list_tip_unzip'))
|
||||
importList(path).then(async listData => {
|
||||
if (listData.type != 'playListPart') return toast(t('list_import_part_tip_failed'))
|
||||
if (listData.type != 'playListPart') return showImportTip(listData.type)
|
||||
const targetList = global.allList[listData.data.id]
|
||||
if (targetList) {
|
||||
const confirm = await confirmDialog({
|
||||
@ -141,7 +141,7 @@ const ImportExport = ({ actionType, visible, hide, selectedListRef }) => {
|
||||
})
|
||||
break
|
||||
}
|
||||
}, [actionType, createUserList, hide, setList, t])
|
||||
}, [actionType, createUserList, hide, selectedListRef, setList, t])
|
||||
|
||||
return (
|
||||
<ChoosePath
|
||||
|
@ -10,7 +10,7 @@ import SubTitle from '../components/SubTitle'
|
||||
import Button from '../components/Button'
|
||||
import ChoosePath from '@/components/common/ChoosePath'
|
||||
import { useTranslation } from '@/plugins/i18n'
|
||||
import { toast, handleSaveFile, handleReadFile, confirmDialog } from '@/utils/tools'
|
||||
import { toast, handleSaveFile, handleReadFile, confirmDialog, showImportTip } from '@/utils/tools'
|
||||
|
||||
const exportAllList = async(allList, path) => {
|
||||
const data = JSON.parse(JSON.stringify({
|
||||
@ -169,7 +169,7 @@ export default memo(() => {
|
||||
handleImportPartList(listData)
|
||||
break
|
||||
|
||||
default: return toast(t('setting_backup_part_import_list_tip_failed'))
|
||||
default: return showImportTip(listData.type)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -408,6 +408,38 @@ export const deduplicationList = list => {
|
||||
})
|
||||
}
|
||||
|
||||
export const showImportTip = type => {
|
||||
let message
|
||||
switch (type) {
|
||||
case 'defautlList':
|
||||
case 'playList':
|
||||
message = i18n.t('list_import_tip__playlist')
|
||||
break
|
||||
case 'setting':
|
||||
message = i18n.t('list_import_tip__setting')
|
||||
break
|
||||
case 'allData':
|
||||
message = i18n.t('list_import_tip__alldata')
|
||||
break
|
||||
case 'playListPart':
|
||||
message = i18n.t('list_import_tip__playlist_part')
|
||||
break
|
||||
|
||||
default:
|
||||
message = i18n.t('list_import_tip__unknown')
|
||||
break
|
||||
}
|
||||
Alert.alert(
|
||||
i18n.t('list_import_tip__failed'),
|
||||
message,
|
||||
[
|
||||
{
|
||||
text: i18n.t('ok'),
|
||||
},
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
deviceLanguage,
|
||||
|
Loading…
x
Reference in New Issue
Block a user