不处理可能存在翻译的歌词

This commit is contained in:
lyswhut 2022-05-22 01:52:20 +08:00
parent a1b96b55aa
commit 2a367cd75e
2 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,4 @@
从这个版本起,你可以将桌面歌词拖动到状态栏上,然后将歌词字体调小后配合新增的歌词窗口宽度、行数设置,模拟出状态栏歌词的效果。
从这个版本起,你可以将桌面歌词拖动到状态栏上,然后将歌词字体调小后配合新增的歌词窗口宽度、行数设置,模拟出类似状态栏歌词的效果。
如果你的设备装有Xposed框架可以使用状态栏版详情看GitHub置顶issue它通过调用第三方Xposed模块【墨•状态栏歌词】的API支持来状态栏歌词感谢@ftevxk)。
但考虑到要依赖第三方应用并且是Xposed模块预计用的人会比较少所以暂不考虑将此特性包含在正式版中。

View File

@ -14,6 +14,7 @@ export default {
for (const item of arr) {
if (lrcSet.has(item.time)) {
if (lrc.length < 2) continue
const tItem = lrc.pop()
tItem.time = lrc[lrc.length - 1].time
lrcT.push(tItem)
@ -24,15 +25,16 @@ export default {
}
}
if (lrcT.length) {
if (lrc.length * 0.4 < lrcT.length) { // 翻译数量需大于歌词数量的0.4倍,否则认为没有翻译
const tItem = lrc.pop()
tItem.time = lrc[lrc.length - 1].time
lrcT.push(tItem)
} else {
lrc = arr
lrcT = []
}
if (lrcT.length > lrc.length * 0.3) {
throw new Error('failed')
// if (lrc.length * 0.4 < lrcT.length) { // 翻译数量需大于歌词数量的0.4倍,否则认为没有翻译
// const tItem = lrc.pop()
// tItem.time = lrc[lrc.length - 1].time
// lrcT.push(tItem)
// } else {
// lrc = arr
// lrcT = []
// }
}
return {