允许设置其他优先播放的歌曲音质 (#1839)
* 在线播放更高音质 * 修改对应翻译 * 设置-播放设置-优先播放320k音质选项改为“优先播放的音质” * 修复拼写 * 优化 --------- Co-authored-by: lyswhut <lyswhut@qq.com>pull/1869/head
parent
87852acb14
commit
ab3f118588
|
@ -1,32 +1,3 @@
|
||||||
### 新增
|
### 变更
|
||||||
|
|
||||||
- 主题编辑器添加“深色字体”选项,启用后将减少字体颜色梯度,各类字体(正文、标签字体等)颜色将更接近,这有助于解决创建全透明主题时可能出现的字体配色问题(#1799)
|
- 设置-播放设置-优先播放320k音质选项改为“优先播放的音质”,允许选择更高优先播放的音质,如果歌曲及音源支持的话(#1839)
|
||||||
- 新增在线自定义源导入功能,允许通过http/https链接导入自定义源
|
|
||||||
- 新增HTTP开放API服务,默认关闭,该服务可以为第三方软件提供调用LX的能力,可用API看[说明文档](https://lyswhut.github.io/lx-music-doc/desktop/open-api)(#1824)
|
|
||||||
- 托盘菜单新增播放、切歌、收藏控制
|
|
||||||
- 添加当前软件版本所对应的代码提交版本、提交时间的显示,可到设置-版本更新查看
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
|
|
||||||
- 主题设置默认折叠其他主题以优化进入设置界面时的性能
|
|
||||||
- 不再丢弃kg源逐行歌词(@helloplhm-qwq)
|
|
||||||
- 支持kw源排行榜显示大小(revert @Folltoshe #1460)
|
|
||||||
- 托盘菜单添加多语言支持(#1802)
|
|
||||||
- 优化本地歌曲换源匹配机制
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
|
|
||||||
- 修复某些情况下歌曲加载时间过长时不会自动跳到下一首的问题
|
|
||||||
- 修复mg歌词在某些情况下获取失败的问题(#1783)
|
|
||||||
- 修复mg歌单搜索(@helloplhm-qwq)
|
|
||||||
- 修复kg最新评论无法获取的问题(@helloplhm-qwq)
|
|
||||||
- 修复更新超时弹窗在非更新阶段意外弹出的问题(#1797)
|
|
||||||
- 修复网络代理设置没有对自定义源的网络请求生效的问题(#1814)
|
|
||||||
|
|
||||||
### 移除
|
|
||||||
|
|
||||||
- 移除未使用的网络代理设置用户名、密码设置,实际上在 v1.20.0 起这两个设置就没有在被内部使用
|
|
||||||
|
|
||||||
### 其他
|
|
||||||
|
|
||||||
- 更新 electron 到 v28.3.0
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ const defaultSetting: LX.AppSetting = {
|
||||||
|
|
||||||
'player.startupAutoPlay': false,
|
'player.startupAutoPlay': false,
|
||||||
'player.togglePlayMethod': 'listLoop',
|
'player.togglePlayMethod': 'listLoop',
|
||||||
'player.highQuality': false,
|
'player.playQuality': '128k',
|
||||||
'player.isShowTaskProgess': true,
|
'player.isShowTaskProgess': true,
|
||||||
'player.volume': 1,
|
'player.volume': 1,
|
||||||
'player.powerSaveBlocker': true,
|
'player.powerSaveBlocker': true,
|
||||||
|
|
|
@ -89,9 +89,9 @@ declare global {
|
||||||
'player.togglePlayMethod': 'listLoop' | 'random' | 'list' | 'singleLoop' | 'none'
|
'player.togglePlayMethod': 'listLoop' | 'random' | 'list' | 'singleLoop' | 'none'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否优先播放320k音质
|
* 优先播放的音质
|
||||||
*/
|
*/
|
||||||
'player.highQuality': boolean
|
'player.playQuality': LX.Quality
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示任务栏进度条
|
* 是否显示任务栏进度条
|
||||||
|
|
|
@ -57,7 +57,6 @@ export default (setting: any): Partial<LX.AppSetting> => {
|
||||||
setting['common.controlBtnPosition'] = setting.controlBtnPosition
|
setting['common.controlBtnPosition'] = setting.controlBtnPosition
|
||||||
|
|
||||||
setting['player.togglePlayMethod'] = setting.player?.togglePlayMethod
|
setting['player.togglePlayMethod'] = setting.player?.togglePlayMethod
|
||||||
setting['player.highQuality'] = setting.player?.highQuality
|
|
||||||
setting['player.isShowTaskProgess'] = setting.player?.isShowTaskProgess
|
setting['player.isShowTaskProgess'] = setting.player?.isShowTaskProgess
|
||||||
setting['player.volume'] = setting.player?.volume
|
setting['player.volume'] = setting.player?.volume
|
||||||
setting['player.isMute'] = setting.player?.isMute
|
setting['player.isMute'] = setting.player?.isMute
|
||||||
|
|
|
@ -518,8 +518,8 @@
|
||||||
"setting__play_mediaDevice_title": "Select a media device for audio output",
|
"setting__play_mediaDevice_title": "Select a media device for audio output",
|
||||||
"setting__play_media_device_error_tip": "This function conflicts with advanced audio functions (audio visualization, sound effect settings). These functions have been enabled when you start the software this time. This setting is not available for now. Please close these functions and restart the software before modifying this setting.",
|
"setting__play_media_device_error_tip": "This function conflicts with advanced audio functions (audio visualization, sound effect settings). These functions have been enabled when you start the software this time. This setting is not available for now. Please close these functions and restart the software before modifying this setting.",
|
||||||
"setting__play_media_device_tip": "This feature conflicts with Audio Visualization, both cannot be enabled at the same time, would you like to turn Audio Visualization off and apply the selected audio output settings?",
|
"setting__play_media_device_tip": "This feature conflicts with Audio Visualization, both cannot be enabled at the same time, would you like to turn Audio Visualization off and apply the selected audio output settings?",
|
||||||
|
"setting__play_playQuality": "Prioritize playback sound quality",
|
||||||
"setting__play_power_save_blocker": "Prevent computer from sleeping while playing songs",
|
"setting__play_power_save_blocker": "Prevent computer from sleeping while playing songs",
|
||||||
"setting__play_quality": "Priority playback of 320K quality songs (if available)",
|
|
||||||
"setting__play_save_play_time": "Remember playback progress",
|
"setting__play_save_play_time": "Remember playback progress",
|
||||||
"setting__play_startup_auto_play": "Play music automatically after launching the software",
|
"setting__play_startup_auto_play": "Play music automatically after launching the software",
|
||||||
"setting__play_task_bar": "Show playing progress on the taskbar",
|
"setting__play_task_bar": "Show playing progress on the taskbar",
|
||||||
|
|
|
@ -518,8 +518,8 @@
|
||||||
"setting__play_mediaDevice_title": "选择声音输出的媒体设备",
|
"setting__play_mediaDevice_title": "选择声音输出的媒体设备",
|
||||||
"setting__play_media_device_error_tip": "此功能与高级音频功能(音频可视化、音效设置)冲突,你本次启动软件时已启用这些功能,此设置暂不可用,请 关闭这些功能 并 重启 软件后,再来修改此设置。",
|
"setting__play_media_device_error_tip": "此功能与高级音频功能(音频可视化、音效设置)冲突,你本次启动软件时已启用这些功能,此设置暂不可用,请 关闭这些功能 并 重启 软件后,再来修改此设置。",
|
||||||
"setting__play_media_device_tip": "此功能与音频可视化功能冲突,两者无法同时启用,是否将音频可视化关闭 并 应用所选音频输出设置?",
|
"setting__play_media_device_tip": "此功能与音频可视化功能冲突,两者无法同时启用,是否将音频可视化关闭 并 应用所选音频输出设置?",
|
||||||
|
"setting__play_playQuality": "优先播放的音质",
|
||||||
"setting__play_power_save_blocker": "播放歌曲时阻止电脑休眠",
|
"setting__play_power_save_blocker": "播放歌曲时阻止电脑休眠",
|
||||||
"setting__play_quality": "优先播放320K品质的歌曲(如果可用)",
|
|
||||||
"setting__play_save_play_time": "记住播放进度",
|
"setting__play_save_play_time": "记住播放进度",
|
||||||
"setting__play_startup_auto_play": "启动软件后自动播放音乐",
|
"setting__play_startup_auto_play": "启动软件后自动播放音乐",
|
||||||
"setting__play_task_bar": "在任务栏上显示当前歌曲播放进度",
|
"setting__play_task_bar": "在任务栏上显示当前歌曲播放进度",
|
||||||
|
|
|
@ -518,8 +518,8 @@
|
||||||
"setting__play_mediaDevice_title": "選擇聲音輸出的媒體設備",
|
"setting__play_mediaDevice_title": "選擇聲音輸出的媒體設備",
|
||||||
"setting__play_media_device_error_tip": "此功能與進階音訊功能(音訊視覺化、音效設定)衝突,你本次啟動軟體時已啟用這些功能,此設定暫不可用,請 關閉這些功能 並 重新啟動 軟體後,再來修改此設定。",
|
"setting__play_media_device_error_tip": "此功能與進階音訊功能(音訊視覺化、音效設定)衝突,你本次啟動軟體時已啟用這些功能,此設定暫不可用,請 關閉這些功能 並 重新啟動 軟體後,再來修改此設定。",
|
||||||
"setting__play_media_device_tip": "此功能與音訊視覺化功能衝突,兩者無法同時啟用,是否將音訊視覺化關閉 並 應用所選音訊輸出設定?",
|
"setting__play_media_device_tip": "此功能與音訊視覺化功能衝突,兩者無法同時啟用,是否將音訊視覺化關閉 並 應用所選音訊輸出設定?",
|
||||||
|
"setting__play_playQuality": "優先播放的音質",
|
||||||
"setting__play_power_save_blocker": "播放歌曲時阻止電腦休眠",
|
"setting__play_power_save_blocker": "播放歌曲時阻止電腦休眠",
|
||||||
"setting__play_quality": "優先播放320K品質的歌曲(如果可用)",
|
|
||||||
"setting__play_save_play_time": "記住播放進度",
|
"setting__play_save_play_time": "記住播放進度",
|
||||||
"setting__play_startup_auto_play": "啟動軟體後自動播放音樂",
|
"setting__play_startup_auto_play": "啟動軟體後自動播放音樂",
|
||||||
"setting__play_task_bar": "在工作列上顯示目前歌曲播放進度",
|
"setting__play_task_bar": "在工作列上顯示目前歌曲播放進度",
|
||||||
|
|
|
@ -51,7 +51,7 @@ export const getMusicUrl = async({ musicInfo, quality, isRefresh, allowToggleSou
|
||||||
|
|
||||||
// // return Promise.reject(new Error('该歌曲没有可播放的音频'))
|
// // return Promise.reject(new Error('该歌曲没有可播放的音频'))
|
||||||
// }
|
// }
|
||||||
const targetQuality = quality ?? getPlayQuality(appSetting['player.highQuality'], musicInfo)
|
const targetQuality = quality ?? getPlayQuality(appSetting['player.playQuality'], musicInfo)
|
||||||
const cachedUrl = await getStoreMusicUrl(musicInfo, targetQuality)
|
const cachedUrl = await getStoreMusicUrl(musicInfo, targetQuality)
|
||||||
if (cachedUrl && !isRefresh) return cachedUrl
|
if (cachedUrl && !isRefresh) return cachedUrl
|
||||||
|
|
||||||
|
|
|
@ -210,10 +210,19 @@ export const getOnlineOtherSourcePicByLocal = async(musicInfo: LX.Music.MusicInf
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPlayQuality = (highQuality: boolean, musicInfo: LX.Music.MusicInfoOnline): LX.Quality => {
|
export const TRY_QUALITYS_LIST = ['flac24bit', 'flac', '320k'] as const
|
||||||
|
type TryQualityType = typeof TRY_QUALITYS_LIST[number]
|
||||||
|
export const getPlayQuality = (highQuality: LX.Quality, musicInfo: LX.Music.MusicInfoOnline): LX.Quality => {
|
||||||
let type: LX.Quality = '128k'
|
let type: LX.Quality = '128k'
|
||||||
let list = qualityList.value[musicInfo.source]
|
if (TRY_QUALITYS_LIST.includes(highQuality as TryQualityType)) {
|
||||||
if (highQuality && musicInfo.meta._qualitys['320k'] && list?.includes('320k')) type = '320k'
|
let list = qualityList.value[musicInfo.source]
|
||||||
|
|
||||||
|
let t = TRY_QUALITYS_LIST
|
||||||
|
.slice(TRY_QUALITYS_LIST.indexOf(highQuality as TryQualityType))
|
||||||
|
.find(q => musicInfo.meta._qualitys[q] && list?.includes(q))
|
||||||
|
|
||||||
|
if (t) type = t
|
||||||
|
}
|
||||||
return type
|
return type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +247,7 @@ export const getOnlineOtherSourceMusicUrl = async({ musicInfos, quality, onToggl
|
||||||
if (retryedSource.includes(musicInfo.source)) continue
|
if (retryedSource.includes(musicInfo.source)) continue
|
||||||
retryedSource.push(musicInfo.source)
|
retryedSource.push(musicInfo.source)
|
||||||
if (!assertApiSupport(musicInfo.source)) continue
|
if (!assertApiSupport(musicInfo.source)) continue
|
||||||
itemQuality = quality ?? getPlayQuality(appSetting['player.highQuality'], musicInfo)
|
itemQuality = quality ?? getPlayQuality(appSetting['player.playQuality'], musicInfo)
|
||||||
if (!musicInfo.meta._qualitys[itemQuality]) continue
|
if (!musicInfo.meta._qualitys[itemQuality]) continue
|
||||||
|
|
||||||
console.log('try toggle to: ', musicInfo.source, musicInfo.name, musicInfo.singer, musicInfo.interval)
|
console.log('try toggle to: ', musicInfo.source, musicInfo.name, musicInfo.singer, musicInfo.interval)
|
||||||
|
@ -285,7 +294,7 @@ export const handleGetOnlineMusicUrl = async({ musicInfo, quality, onToggleSourc
|
||||||
}> => {
|
}> => {
|
||||||
if (!await window.lx.apiInitPromise[0]) throw new Error('source init failed')
|
if (!await window.lx.apiInitPromise[0]) throw new Error('source init failed')
|
||||||
// console.log(musicInfo.source)
|
// console.log(musicInfo.source)
|
||||||
const targetQuality = quality ?? getPlayQuality(appSetting['player.highQuality'], musicInfo)
|
const targetQuality = quality ?? getPlayQuality(appSetting['player.playQuality'], musicInfo)
|
||||||
|
|
||||||
let reqPromise
|
let reqPromise
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import { toRaw, markRawList } from '@common/utils/vueTools'
|
import { toRaw, markRawList } from '@common/utils/vueTools'
|
||||||
import { qualityList } from '@renderer/store'
|
// import { qualityList } from '@renderer/store'
|
||||||
import { clearPlayedList } from '@renderer/store/player/action'
|
import { clearPlayedList } from '@renderer/store/player/action'
|
||||||
import { appSetting } from '@renderer/store/setting'
|
import { appSetting } from '@renderer/store/setting'
|
||||||
import { dislikeInfo } from '@renderer/store/dislikeList'
|
import { dislikeInfo } from '@renderer/store/dislikeList'
|
||||||
import { setPowerSaveBlocker as setPowerSaveBlockerRemote } from '@renderer/utils/ipc'
|
import { setPowerSaveBlocker as setPowerSaveBlockerRemote } from '@renderer/utils/ipc'
|
||||||
|
|
||||||
export const getPlayType = (highQuality: boolean, musicInfo: LX.Music.MusicInfo | LX.Download.ListItem): LX.Quality | null => {
|
// export const getPlayType = (highQuality: boolean, musicInfo: LX.Music.MusicInfo | LX.Download.ListItem): LX.Quality | null => {
|
||||||
if ('progress' in musicInfo || musicInfo.source == 'local') return null
|
// if ('progress' in musicInfo || musicInfo.source == 'local') return null
|
||||||
let type: LX.Quality = '128k'
|
// let type: LX.Quality = '128k'
|
||||||
let list = qualityList.value[musicInfo.source]
|
// let list = qualityList.value[musicInfo.source]
|
||||||
if (highQuality && musicInfo.meta._qualitys['320k'] && list?.includes('320k')) type = '320k'
|
// if (highQuality && musicInfo.meta._qualitys['320k'] && list?.includes('320k')) type = '320k'
|
||||||
return type
|
// return type
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过滤列表中已播放的歌曲
|
* 过滤列表中已播放的歌曲
|
||||||
|
|
|
@ -19,12 +19,19 @@ dd
|
||||||
base-checkbox(id="setting_player_lyric_s2t" :model-value="appSetting['player.isS2t']" :label="$t('setting__play_lyric_s2t')" @update:model-value="updateSetting({'player.isS2t': $event})")
|
base-checkbox(id="setting_player_lyric_s2t" :model-value="appSetting['player.isS2t']" :label="$t('setting__play_lyric_s2t')" @update:model-value="updateSetting({'player.isS2t': $event})")
|
||||||
.gap-top
|
.gap-top
|
||||||
base-checkbox(id="setting_player_lyric_play_lxlrc" :model-value="appSetting['player.isPlayLxlrc']" :label="$t('setting__play_lyric_lxlrc')" @update:model-value="updateSetting({'player.isPlayLxlrc': $event})")
|
base-checkbox(id="setting_player_lyric_play_lxlrc" :model-value="appSetting['player.isPlayLxlrc']" :label="$t('setting__play_lyric_lxlrc')" @update:model-value="updateSetting({'player.isPlayLxlrc': $event})")
|
||||||
.gap-top
|
|
||||||
base-checkbox(id="setting_player_highQuality" :model-value="appSetting['player.highQuality']" :label="$t('setting__play_quality')" @update:model-value="updateSetting({'player.highQuality': $event})")
|
|
||||||
.gap-top
|
.gap-top
|
||||||
base-checkbox(id="setting_player_showTaskProgess" :model-value="appSetting['player.isShowTaskProgess']" :label="$t('setting__play_task_bar')" @update:model-value="updateSetting({'player.isShowTaskProgess': $event})")
|
base-checkbox(id="setting_player_showTaskProgess" :model-value="appSetting['player.isShowTaskProgess']" :label="$t('setting__play_task_bar')" @update:model-value="updateSetting({'player.isShowTaskProgess': $event})")
|
||||||
.gap-top
|
.gap-top
|
||||||
base-checkbox(id="setting_player_isMediaDeviceRemovedStopPlay" :model-value="appSetting['player.isMediaDeviceRemovedStopPlay']" :label="$t('setting__play_mediaDevice_remove_stop_play')" @update:model-value="updateSetting({'player.isMediaDeviceRemovedStopPlay': $event})")
|
base-checkbox(id="setting_player_isMediaDeviceRemovedStopPlay" :model-value="appSetting['player.isMediaDeviceRemovedStopPlay']" :label="$t('setting__play_mediaDevice_remove_stop_play')" @update:model-value="updateSetting({'player.isMediaDeviceRemovedStopPlay': $event})")
|
||||||
|
|
||||||
|
dd
|
||||||
|
h3#basic_play_quality {{ $t('setting__play_playQuality') }}
|
||||||
|
div
|
||||||
|
base-checkbox.gap-left(
|
||||||
|
v-for="item in playQualityList" :id="`setting_play_quality_${item}`" :key="item"
|
||||||
|
name="setting_play_quality" need :model-value="appSetting['player.playQuality']" :value="item" :label="item"
|
||||||
|
@update:model-value="updateSetting({'player.playQuality': $event})")
|
||||||
|
|
||||||
dd(:aria-label="$t('setting__play_mediaDevice_title')")
|
dd(:aria-label="$t('setting__play_mediaDevice_title')")
|
||||||
h3#play_mediaDevice {{ $t('setting__play_mediaDevice') }}
|
h3#play_mediaDevice {{ $t('setting__play_mediaDevice') }}
|
||||||
div
|
div
|
||||||
|
@ -39,12 +46,14 @@ import { useI18n } from '@renderer/plugins/i18n'
|
||||||
import { appSetting, updateSetting } from '@renderer/store/setting'
|
import { appSetting, updateSetting } from '@renderer/store/setting'
|
||||||
import { setPowerSaveBlocker } from '@renderer/core/player/utils'
|
import { setPowerSaveBlocker } from '@renderer/core/player/utils'
|
||||||
import { isPlay } from '@renderer/store/player/state'
|
import { isPlay } from '@renderer/store/player/state'
|
||||||
|
import { TRY_QUALITYS_LIST } from '@renderer/core/music/utils'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SettingPlay',
|
name: 'SettingPlay',
|
||||||
setup() {
|
setup() {
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
|
const playQualityList = [...TRY_QUALITYS_LIST, '128k'].reverse()
|
||||||
|
|
||||||
const mediaDevices = ref([])
|
const mediaDevices = ref([])
|
||||||
const getMediaDevice = async() => {
|
const getMediaDevice = async() => {
|
||||||
|
@ -105,6 +114,7 @@ export default {
|
||||||
mediaDeviceId,
|
mediaDeviceId,
|
||||||
handleMediaDeviceIdChnage,
|
handleMediaDeviceIdChnage,
|
||||||
handleUpdatePowerSaveBlocker,
|
handleUpdatePowerSaveBlocker,
|
||||||
|
playQualityList,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue