|
@@ -3334,7 +3334,7 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
// 右侧居中的字母表索引
|
|
// 右侧居中的字母表索引
|
|
|
|
|
|
|
|
- this.indexBuilder()
|
|
|
|
|
|
|
+ this.indexBuilder()
|
|
|
|
|
|
|
|
|
|
|
|
|
this.topTitleBar()
|
|
this.topTitleBar()
|
|
@@ -6015,7 +6015,8 @@ export struct LocalMusic {
|
|
|
right: this.currentBreakpoint !== BreakpointTypeEnum.SM ? 40 : 20
|
|
right: this.currentBreakpoint !== BreakpointTypeEnum.SM ? 40 : 20
|
|
|
})
|
|
})
|
|
|
Column() {
|
|
Column() {
|
|
|
- Text(this.isShowFileName&&item.type!=CommonConstants.TYPE_IS_DIR?item.fileName :item.name.startsWith('.') ? item.name.replace(/\./g, '') : item.name)
|
|
|
|
|
|
|
+ Text(this.isShowFileName&&this.modeType !== 2&&this.modeType !== 3&&
|
|
|
|
|
+ item.type!=CommonConstants.TYPE_IS_DIR?item.fileName :item.name.startsWith('.') ? item.name.replace(/\./g, '') : item.name)
|
|
|
.fontSize(this.twoFingerType == 1 ? 12 : this.twoFingerType == 2 ? 15 : 18)
|
|
.fontSize(this.twoFingerType == 1 ? 12 : this.twoFingerType == 2 ? 15 : 18)
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.fontWeight(FontWeight.Bold)
|
|
.fontWeight(FontWeight.Bold)
|
|
@@ -7343,7 +7344,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
// 检查当前播放歌曲是否在已加载的列表中
|
|
// 检查当前播放歌曲是否在已加载的列表中
|
|
|
const targetIndex = Utility.getIndexFromList(this.videoLocalList, this.currentSong.filePath);
|
|
const targetIndex = Utility.getIndexFromList(this.videoLocalList, this.currentSong.filePath);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (targetIndex > 0) {
|
|
if (targetIndex > 0) {
|
|
|
// 歌曲在当前列表中,直接滚动
|
|
// 歌曲在当前列表中,直接滚动
|
|
|
console.info("heanup locateCurrentSong: 找到歌曲,索引=" + targetIndex);
|
|
console.info("heanup locateCurrentSong: 找到歌曲,索引=" + targetIndex);
|
|
@@ -11255,7 +11256,7 @@ export struct LocalMusic {
|
|
|
title: {
|
|
title: {
|
|
|
title:this.getPlayListDisplayCount()==0?Utility.resourceToString(this.context, $r('app.string.current_play_list'))
|
|
title:this.getPlayListDisplayCount()==0?Utility.resourceToString(this.context, $r('app.string.current_play_list'))
|
|
|
:Utility.resourceToString(this.context, $r('app.string.current_play_list'))
|
|
:Utility.resourceToString(this.context, $r('app.string.current_play_list'))
|
|
|
- + `(${this.getPlayListDisplayCount()}首)`
|
|
|
|
|
|
|
+ + `(${this.getPlayListDisplayCount()}首)`
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
@@ -13099,7 +13100,7 @@ export struct LocalMusic {
|
|
|
.height(24);
|
|
.height(24);
|
|
|
|
|
|
|
|
Toggle({ type: ToggleType.Switch, isOn: this.isGeKongPlayNext })
|
|
Toggle({ type: ToggleType.Switch, isOn: this.isGeKongPlayNext })
|
|
|
- .selectedColor(this.themeColor)
|
|
|
|
|
|
|
+ .selectedColor(this.themeColor)
|
|
|
.switchPointColor(Color.White)
|
|
.switchPointColor(Color.White)
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
.margin({ right: 15 })
|
|
.margin({ right: 15 })
|
|
@@ -14088,7 +14089,7 @@ export struct LocalMusic {
|
|
|
if(this.isShowSingleLineLyric){
|
|
if(this.isShowSingleLineLyric){
|
|
|
this.lyricControllerSingle.updatePosition(position + this.timeOffset * 1000);
|
|
this.lyricControllerSingle.updatePosition(position + this.timeOffset * 1000);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 蓝牙歌词更新逻辑
|
|
// 蓝牙歌词更新逻辑
|
|
|
if (this.bluetoothLyricEnabled && this.isBluetoothConnected && this.lyricContent && this.currentSong) {
|
|
if (this.bluetoothLyricEnabled && this.isBluetoothConnected && this.lyricContent && this.currentSong) {
|
|
|
const currentLyricLine = LyricUtil.getCurrentLyricLine(this.lyricContent, position + this.timeOffset * 1000);
|
|
const currentLyricLine = LyricUtil.getCurrentLyricLine(this.lyricContent, position + this.timeOffset * 1000);
|
|
@@ -15940,13 +15941,13 @@ export struct LocalMusic {
|
|
|
// 阈值常量
|
|
// 阈值常量
|
|
|
const UNPLAYED_THRESHOLD = 10; // 剩余未播放歌曲阈值
|
|
const UNPLAYED_THRESHOLD = 10; // 剩余未播放歌曲阈值
|
|
|
const LOAD_MORE_PAGES = 3; // 每次加载页数
|
|
const LOAD_MORE_PAGES = 3; // 每次加载页数
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 获取网盘播放列表
|
|
// 获取网盘播放列表
|
|
|
const navidromeList = getNavidromeVideoItems();
|
|
const navidromeList = getNavidromeVideoItems();
|
|
|
const webdavList = getWebdavVideoItems();
|
|
const webdavList = getWebdavVideoItems();
|
|
|
const isNavidrome = navidromeList.length > 0;
|
|
const isNavidrome = navidromeList.length > 0;
|
|
|
const remoteList = isNavidrome ? navidromeList : webdavList;
|
|
const remoteList = isNavidrome ? navidromeList : webdavList;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (remoteList.length > 0) {
|
|
if (remoteList.length > 0) {
|
|
|
// 将当前歌加入历史栈
|
|
// 将当前歌加入历史栈
|
|
|
if (this.currentSong) {
|
|
if (this.currentSong) {
|
|
@@ -15963,9 +15964,9 @@ export struct LocalMusic {
|
|
|
let unplayedCount = isNavidrome ? getUnplayedCount() : remoteList.length;
|
|
let unplayedCount = isNavidrome ? getUnplayedCount() : remoteList.length;
|
|
|
const totalCount = remoteList.length;
|
|
const totalCount = remoteList.length;
|
|
|
const playedCount = isNavidrome ? getPlayedCount() : 0;
|
|
const playedCount = isNavidrome ? getPlayedCount() : 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `randomPlay(网盘模式): 总数${totalCount}, 已播放${playedCount}, 未播放${unplayedCount}`);
|
|
Logger.info(TAG, `randomPlay(网盘模式): 总数${totalCount}, 已播放${playedCount}, 未播放${unplayedCount}`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果未播放数量不足阈值,且还有更多数据,触发加载更多页
|
|
// 如果未播放数量不足阈值,且还有更多数据,触发加载更多页
|
|
|
if (isNavidrome && unplayedCount < UNPLAYED_THRESHOLD && hasMoreData()) {
|
|
if (isNavidrome && unplayedCount < UNPLAYED_THRESHOLD && hasMoreData()) {
|
|
|
Logger.info(TAG, `randomPlay(网盘模式): 未播放(${unplayedCount})不足阈值(${UNPLAYED_THRESHOLD}),触发加载更多`);
|
|
Logger.info(TAG, `randomPlay(网盘模式): 未播放(${unplayedCount})不足阈值(${UNPLAYED_THRESHOLD}),触发加载更多`);
|
|
@@ -15987,7 +15988,7 @@ export struct LocalMusic {
|
|
|
clearPlayedHistory();
|
|
clearPlayedHistory();
|
|
|
// 排除当前歌曲
|
|
// 排除当前歌曲
|
|
|
const currentFilePath = this.currentSong?.filePath;
|
|
const currentFilePath = this.currentSong?.filePath;
|
|
|
- candidates = currentFilePath
|
|
|
|
|
|
|
+ candidates = currentFilePath
|
|
|
? getNavidromeVideoItems().filter(v => v.filePath !== currentFilePath)
|
|
? getNavidromeVideoItems().filter(v => v.filePath !== currentFilePath)
|
|
|
: getNavidromeVideoItems();
|
|
: getNavidromeVideoItems();
|
|
|
}
|
|
}
|
|
@@ -16002,12 +16003,12 @@ export struct LocalMusic {
|
|
|
if (candidates.length > 0) {
|
|
if (candidates.length > 0) {
|
|
|
const randomIndex = Math.floor(Math.random() * candidates.length);
|
|
const randomIndex = Math.floor(Math.random() * candidates.length);
|
|
|
const randomSong = candidates[randomIndex];
|
|
const randomSong = candidates[randomIndex];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 标记为已播放
|
|
// 标记为已播放
|
|
|
if (isNavidrome) {
|
|
if (isNavidrome) {
|
|
|
markAsPlayed(randomSong.filePath);
|
|
markAsPlayed(randomSong.filePath);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `randomPlay(网盘模式): 从${candidates.length}首候选中随机选择: ${randomSong.name}`);
|
|
Logger.info(TAG, `randomPlay(网盘模式): 从${candidates.length}首候选中随机选择: ${randomSong.name}`);
|
|
|
|
|
|
|
|
// 将选中的歌曲加入播放列表(如果不存在)
|
|
// 将选中的歌曲加入播放列表(如果不存在)
|
|
@@ -16981,21 +16982,21 @@ export struct LocalMusic {
|
|
|
// 保存歌单的歌曲路径列表,用于随机播放
|
|
// 保存歌单的歌曲路径列表,用于随机播放
|
|
|
this.currentPlaylistSongFilePaths = songs.map(song => song.filePath);
|
|
this.currentPlaylistSongFilePaths = songs.map(song => song.filePath);
|
|
|
const actualTotal = totalCount ?? songs.length;
|
|
const actualTotal = totalCount ?? songs.length;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果是网盘播放,保存服务端总数到全局存储
|
|
// 如果是网盘播放,保存服务端总数到全局存储
|
|
|
if (totalCount && totalCount > 0 && songs.length > 0) {
|
|
if (totalCount && totalCount > 0 && songs.length > 0) {
|
|
|
const firstSong = songs[0];
|
|
const firstSong = songs[0];
|
|
|
- if (firstSong && (isNavidromeType(firstSong.type) ||
|
|
|
|
|
- isJellyfinType(firstSong.type) ||
|
|
|
|
|
- isEmbyType(firstSong.type) ||
|
|
|
|
|
- isAudioStationType(firstSong.type) ||
|
|
|
|
|
- isPlexType(firstSong.type) ||
|
|
|
|
|
- isDaoLiYuType(firstSong.type))) {
|
|
|
|
|
|
|
+ if (firstSong && (isNavidromeType(firstSong.type) ||
|
|
|
|
|
+ isJellyfinType(firstSong.type) ||
|
|
|
|
|
+ isEmbyType(firstSong.type) ||
|
|
|
|
|
+ isAudioStationType(firstSong.type) ||
|
|
|
|
|
+ isPlexType(firstSong.type) ||
|
|
|
|
|
+ isDaoLiYuType(firstSong.type))) {
|
|
|
setNavidromeTotalCount(totalCount);
|
|
setNavidromeTotalCount(totalCount);
|
|
|
Logger.info('heanup finishLoadingPlaylist', `已保存服务端总数到全局存储: ${totalCount}`);
|
|
Logger.info('heanup finishLoadingPlaylist', `已保存服务端总数到全局存储: ${totalCount}`);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info('heanup finishLoadingPlaylist', `保存歌单歌曲路径列表,已加载=${this.currentPlaylistSongFilePaths.length}, 服务端总数=${actualTotal}`);
|
|
Logger.info('heanup finishLoadingPlaylist', `保存歌单歌曲路径列表,已加载=${this.currentPlaylistSongFilePaths.length}, 服务端总数=${actualTotal}`);
|
|
|
|
|
|
|
|
if (songs[startIndex]) {
|
|
if (songs[startIndex]) {
|