|
|
@@ -15,7 +15,7 @@ import { common } from '@kit.AbilityKit';
|
|
|
// CSJAdCreator,
|
|
|
// CSJAdSdk, CSJNativeExpressAd, NativeExpressAdListener } from '@csj/openadsdk';
|
|
|
import { PrintBiddingTokenUtils } from '../common/util/PrintBiddintTokenUtils';
|
|
|
-import { ArrayList } from '@kit.ArkTS';
|
|
|
+import { ArrayList, JSON, taskpool } from '@kit.ArkTS';
|
|
|
import { CSJUtil } from '../common/util/CSJUtil';
|
|
|
import { StreamContent } from '../view/StreamContent';
|
|
|
import { AvSessionController } from '../controller/AvSessionController';
|
|
|
@@ -41,9 +41,10 @@ import OnlineUpdateLog from '../dialog/OnlineUpdateLog';
|
|
|
import { LocalMusic } from '../view/LocalMusic';
|
|
|
import { ChartsCount } from './ChartsCount';
|
|
|
import { image } from '@kit.ImageKit';
|
|
|
-import { Playlist } from '../viewmodel/Playlist';
|
|
|
+import { Playlist, PlaylistSong } from '../viewmodel/Playlist';
|
|
|
import PlaylistTable from '../common/util/PlaylistTable';
|
|
|
import { convertPlaylistSongsToVideoItems } from './PlaylistDetailPage';
|
|
|
+import MediaTable from '../common/util/MediaTable';
|
|
|
|
|
|
// import { FFmpeg, FFProgressMessageParser } from '@sj/ffmpeg';
|
|
|
|
|
|
@@ -1082,22 +1083,13 @@ struct NewIndex {
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
|
|
|
.onClick(async () => {
|
|
|
- if (!this.playlistTable) {
|
|
|
- ToastUtil.showToast('歌单功能初始化中,请稍后再试')
|
|
|
- return
|
|
|
- }
|
|
|
- // 加载歌单歌曲
|
|
|
- const playlistSongs = await this.playlistTable.queryPlaylistSongs(playlist.id)
|
|
|
- if(ArrayUtil.isEmpty(playlistSongs)){
|
|
|
- this.openPlaylist(playlist)//如果为空进入编辑歌单
|
|
|
- }else{
|
|
|
- this.currentSongList = await convertPlaylistSongsToVideoItems(this.context,playlistSongs)
|
|
|
- this.currentSongListName= playlist.name
|
|
|
- this.currentSongListID = playlist.id
|
|
|
- this.modeType = 4//切换到歌单模式
|
|
|
- }
|
|
|
+ this.currentSongListName = playlist.name;
|
|
|
+ this.currentSongListID = playlist.id;
|
|
|
+ this.mType === 0
|
|
|
+ this.modeType = 4
|
|
|
+ this.doShowDrawer();
|
|
|
+
|
|
|
|
|
|
- this.doShowDrawer()
|
|
|
})
|
|
|
.bindContextMenu(this.MenuBuilder(playlist), ResponseType.LongPress,
|
|
|
{
|
|
|
@@ -1231,7 +1223,7 @@ struct NewIndex {
|
|
|
async initPlaylistTable() {
|
|
|
try {
|
|
|
this.playlistTable = new PlaylistTable(this.context)
|
|
|
- console.info('歌单数据库初始化成功')
|
|
|
+ console.info('onecold 歌单数据库初始化成功')
|
|
|
|
|
|
// 等待数据库初始化完成后再加载数据
|
|
|
setTimeout(async () => {
|
|
|
@@ -1251,12 +1243,12 @@ struct NewIndex {
|
|
|
const playlists = await this.playlistTable.queryAllPlaylists()
|
|
|
this.playlistList = playlists
|
|
|
console.info(`onecold 成功加载 ${playlists.length} 个歌单`)
|
|
|
- if(ArrayUtil.isNotEmpty(this.playlistList)){
|
|
|
- const playlistSongs = await this.playlistTable.queryPlaylistSongs(this.playlistList[0].id)
|
|
|
- this.currentSongList = await convertPlaylistSongsToVideoItems(this.context,playlistSongs)
|
|
|
- this.currentSongListName= this.playlistList[0].name
|
|
|
- this.currentSongListID = this.playlistList[0].id
|
|
|
- }
|
|
|
+ // if(ArrayUtil.isNotEmpty(this.playlistList)){
|
|
|
+ // const playlistSongs = await this.playlistTable.queryPlaylistSongs(this.playlistList[0].id)
|
|
|
+ // this.currentSongList = await convertPlaylistSongsToVideoItems(this.context,playlistSongs)
|
|
|
+ // this.currentSongListName= this.playlistList[0].name
|
|
|
+ // this.currentSongListID = this.playlistList[0].id
|
|
|
+ // }
|
|
|
|
|
|
} else {
|
|
|
console.warn('onecold 歌单表未初始化')
|
|
|
@@ -1282,7 +1274,8 @@ function themeColorWithAlpha(themeColor: string, alpha: number, isDarkMode: bool
|
|
|
|
|
|
// 定义接口
|
|
|
interface HiCarAspectRatio {
|
|
|
- ratio: number;
|
|
|
- name: string;
|
|
|
+ context: Context;
|
|
|
+ playlistId: string;
|
|
|
}
|
|
|
|
|
|
+
|