/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { FileUtil, StrUtil } from '@pura/harmony-utils'; import { CommonConstants } from '../common/constants/CommonConstants'; @Observed export class VideoItem { id: string; name: string;//视频和音频文件名称,音频如果是音乐取歌曲名称值 filePath: string type:number videoSize:number; cTime:string;//创建时间 parentPath:string; isFav:number; size?:string; pixelMapPath?: string; artist?: string; album?: string; fileName?: string;//音乐文件的真实文件名称 lastPlayed?:Date; duration?:string//时长 mimeType?:string//类型 sampleRate?:string//音频的采样率单位为Hz trackCount?:string//轨道数量 lastPlayedStr?:string;//最后播放时间 playCount?:number//播放次数 lyricContent?:string//歌词内容 md5Str?:string//直接用来保存音质的判断 extra_json?:string pyStr?:string//中文歌曲名称拼音的首字母 bit_rate?:string//比特率 probe_score?:number//评分 year?:string//年份 nb_streams?:number//流数量 nb_programs?:number//节目数量 genre?:string//风格 track?:string//音轨号 bits_per_raw_sample?:string//位深 channels?:string//声道数 channel_layout?:string//声道布局:stereo为标准立体声(左+右) start_time?:string//起始时间: ALBUMARTIST?:string//专辑艺术家 COMPOSER?:string//作曲家 LYRICIST?:string//作词家 COMMENT?:string//注释 disc?:string//碟号 webdav_account_id?: string// WebDAV账号ID,用于获取认证信息 remote_rel_path?: string // 远程相对路径(去掉协议+host+端口),便于重构URL navArtistId?: string; navAlbumId?: string; baiduFsId?: string // 百度网盘 fs_id constructor(name: string, id: string, filePath: string, type:number,videoSize:number,cTime: string, size?: string,pixelMapPath?: string,artist?: string,album?: string,fileName?: string, lastPlayed?:Date) { this.name = name; this.id = id; this.filePath = filePath; this.type = type; this.videoSize = videoSize; this.cTime = cTime; if(StrUtil.isNotEmpty(this.filePath)&&this.type===CommonConstants.TYPE_LOCAL){ try { this.parentPath = FileUtil.getParentPath(this.filePath); }catch (e) { this.parentPath='' } }else{ this.parentPath = '' } this.isFav = 0; this.size = size; this.pixelMapPath = pixelMapPath; this.artist = artist; this.album = album; this.fileName = fileName; this.lastPlayed = lastPlayed; this.playCount = 0 this.md5Str = '' this.extra_json = '' this.pyStr = '' } }