新增“双击列表里的歌曲时自动切换到当前列表播放”设置
parent
748a420b64
commit
8e5b144f00
|
@ -1,6 +1,7 @@
|
|||
### 优化
|
||||
|
||||
- 过滤tx源某些不支持播放的歌曲,解决播放此类内容会导致意外的问题
|
||||
- 新增“双击列表里的歌曲时自动切换到当前列表播放”设置,此功能仅对歌单、排行榜有效,默认关闭
|
||||
|
||||
### 修复
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ const path = require('path')
|
|||
const os = require('os')
|
||||
|
||||
const defaultSetting = {
|
||||
version: '1.0.48',
|
||||
version: '1.0.49',
|
||||
player: {
|
||||
togglePlayMethod: 'listLoop',
|
||||
highQuality: false,
|
||||
|
@ -36,6 +36,7 @@ const defaultSetting = {
|
|||
},
|
||||
},
|
||||
list: {
|
||||
isClickPlayList: false,
|
||||
isShowAlbumName: true,
|
||||
isShowSource: true,
|
||||
isSaveScrollLocation: true,
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
"setting__list_add_music_location_type": "Position when adding a song to the list",
|
||||
"setting__list_add_music_location_type_bottom": "Bottom",
|
||||
"setting__list_add_music_location_type_top": "Top",
|
||||
"setting__list_click_action": "Automatically switch to the current list when double-clicking a song in the list (only valid for playlists and rankings)",
|
||||
"setting__list_scroll": "Remember the position of the scroll bar of the playlist (only valid for my music classification)",
|
||||
"setting__list_source": "Show song source (only valid for my music category)",
|
||||
"setting__network": "Network",
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
"setting__list_add_music_location_type": "添加歌曲到列表时的位置",
|
||||
"setting__list_add_music_location_type_bottom": "底部",
|
||||
"setting__list_add_music_location_type_top": "顶部",
|
||||
"setting__list_click_action": "双击列表里的歌曲时自动切换到当前列表播放(仅对歌单、排行榜有效)",
|
||||
"setting__list_scroll": "记住播放列表滚动条位置(仅对我的音乐分类有效)",
|
||||
"setting__list_source": "显示歌曲源(仅对我的音乐分类有效)",
|
||||
"setting__network": "网络设置",
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
"setting__list_add_music_location_type": "添加歌曲到列表時的位置",
|
||||
"setting__list_add_music_location_type_bottom": "底部",
|
||||
"setting__list_add_music_location_type_top": "頂部",
|
||||
"setting__list_click_action": "雙擊列表裡的歌曲時自動切換到當前列表播放(僅對歌單、排行榜有效)",
|
||||
"setting__list_scroll": "記住播放列表滾動條位置(僅對我的音樂分類有效)",
|
||||
"setting__list_source": "顯示歌曲源(僅對我的音樂分類有效)",
|
||||
"setting__network": "網絡設置",
|
||||
|
|
|
@ -50,7 +50,7 @@ div(:class="$style.songList")
|
|||
|
||||
<script>
|
||||
import { clipboardWriteText, assertApiSupport } from '@renderer/utils'
|
||||
import { ref, useCssModule } from '@renderer/utils/vueTools'
|
||||
import { ref, useCssModule, useRefGetter } from '@renderer/utils/vueTools'
|
||||
import useList from './useList'
|
||||
import useMenu from './useMenu'
|
||||
import usePlay from './usePlay'
|
||||
|
@ -95,7 +95,7 @@ export default {
|
|||
type: String,
|
||||
},
|
||||
},
|
||||
emits: ['show-menu', 'togglePage'],
|
||||
emits: ['show-menu', 'play-list', 'togglePage'],
|
||||
setup(props, { emit }) {
|
||||
const rightClickSelectedIndex = ref(-1)
|
||||
const dom_listContent = ref(null)
|
||||
|
@ -103,18 +103,20 @@ export default {
|
|||
|
||||
const styles = useCssModule()
|
||||
|
||||
const setting = useRefGetter('setting')
|
||||
|
||||
const {
|
||||
selectedList,
|
||||
listItemHeight,
|
||||
handleSelectData,
|
||||
removeAllSelect,
|
||||
} = useList({ props, emit })
|
||||
} = useList({ props })
|
||||
|
||||
const {
|
||||
handlePlayMusic,
|
||||
handlePlayMusicLater,
|
||||
doubleClickPlay,
|
||||
} = usePlay({ selectedList, props, removeAllSelect })
|
||||
} = usePlay({ selectedList, props, removeAllSelect, setting, emit })
|
||||
|
||||
const {
|
||||
isShowListAdd,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { useCommit } from '@renderer/utils/vueTools'
|
|||
import { defaultList } from '@renderer/core/share/list'
|
||||
import { getList } from '@renderer/core/share/utils'
|
||||
|
||||
export default ({ selectedList, props, removeAllSelect }) => {
|
||||
export default ({ selectedList, props, removeAllSelect, setting, emit }) => {
|
||||
let clickTime = 0
|
||||
let clickIndex = -1
|
||||
|
||||
|
@ -47,7 +47,11 @@ export default ({ selectedList, props, removeAllSelect }) => {
|
|||
clickIndex = index
|
||||
return
|
||||
}
|
||||
handlePlayMusic(index, true)
|
||||
if (setting.value.list.isClickPlayList) {
|
||||
emit('play-list', index)
|
||||
} else {
|
||||
handlePlayMusic(index, true)
|
||||
}
|
||||
clickTime = 0
|
||||
clickIndex = -1
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<material-online-list
|
||||
ref="songList"
|
||||
@show-menu="hideListsMenu"
|
||||
@play-list="handlePlayList"
|
||||
@toggle-page="handleGetList"
|
||||
:rowWidth="{r1: '5%', r2: 'auto', r3: '22%', r4: '22%', r5: '9%', r6: '15%'}"
|
||||
:page="page"
|
||||
|
@ -219,13 +220,13 @@ export default {
|
|||
sourceListId: `board__${boardId}`,
|
||||
})
|
||||
},
|
||||
async playSongListDetail({ boardId, id }) {
|
||||
async playSongListDetail({ boardId, id, index = 0 }) {
|
||||
let isPlayingList = false
|
||||
const list = this.tabId == boardId ? [...this.list] : null
|
||||
if (list?.length) {
|
||||
this.setTempList({
|
||||
list,
|
||||
index: 0,
|
||||
index,
|
||||
id,
|
||||
})
|
||||
isPlayingList = true
|
||||
|
@ -242,11 +243,18 @@ export default {
|
|||
} else {
|
||||
this.setTempList({
|
||||
list: fullList,
|
||||
index: 0,
|
||||
index,
|
||||
id,
|
||||
})
|
||||
}
|
||||
},
|
||||
handlePlayList(index) {
|
||||
this.playSongListDetail({
|
||||
boardId: this.tabId,
|
||||
id: `board__${this.source}__${this.tabId}`,
|
||||
index,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -5,6 +5,8 @@ dd
|
|||
base-checkbox(id="setting_list_showSource_enable" v-model="currentStting.list.isShowSource" :label="$t('setting__list_source')")
|
||||
.gap-top
|
||||
base-checkbox(id="setting_list_scroll_enable" v-model="currentStting.list.isSaveScrollLocation" :label="$t('setting__list_scroll')")
|
||||
.gap-top
|
||||
base-checkbox(id="setting_list_clickAction_enable" v-model="currentStting.list.isClickPlayList" :label="$t('setting__list_click_action')")
|
||||
dd(:tips="$t('setting__basic_sourcename_title')")
|
||||
h3#list_addMusicLocationType {{$t('setting__list_add_music_location_type')}}
|
||||
div
|
||||
|
|
|
@ -14,7 +14,7 @@ div(:class="$style.container")
|
|||
base-btn(:class="$style.headerRightBtn" :disabled="detailLoading" @click="playSongListDetail") {{$t('list__play')}}
|
||||
base-btn(:class="$style.headerRightBtn" :disabled="detailLoading" @click="addSongListDetail") {{$t('list__collect')}}
|
||||
base-btn(:class="$style.headerRightBtn" @click="hideListDetail") {{$t('back')}}
|
||||
material-online-list(ref="songList" @toggle-page="handleToggleListDetailPage" :page="listDetail.page" :limit="listDetail.limit" :total="listDetail.total"
|
||||
material-online-list(ref="songList" @play-list="playSongListDetail" @toggle-page="handleToggleListDetailPage" :page="listDetail.page" :limit="listDetail.limit" :total="listDetail.total"
|
||||
:list="listDetail.list" :noItem="isGetDetailFailed ? $t('list__load_failed') : $t('list__loading')")
|
||||
transition(enter-active-class="animated-fast fadeIn" leave-active-class="animated-fast fadeOut")
|
||||
div(:class="$style.songListContainer" v-show="!isVisibleListDetail")
|
||||
|
@ -315,14 +315,14 @@ export default {
|
|||
sourceListId: this.listDetail.id,
|
||||
})
|
||||
},
|
||||
async playSongListDetail() {
|
||||
async playSongListDetail(index = 0) {
|
||||
if (!this.listDetail.info.name) return
|
||||
const id = `${this.listDetail.source}__${this.listDetail.id}`
|
||||
let isPlayingList = false
|
||||
if (this.listDetail.list?.length) {
|
||||
this.setTempList({
|
||||
list: [...this.listDetail.list],
|
||||
index: 0,
|
||||
index,
|
||||
id,
|
||||
})
|
||||
isPlayingList = true
|
||||
|
@ -339,7 +339,7 @@ export default {
|
|||
} else {
|
||||
this.setTempList({
|
||||
list,
|
||||
index: 0,
|
||||
index,
|
||||
id,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue