|
|
@@ -1,5 +1,5 @@
|
|
|
import relationalStore from '@ohos.data.relationalStore';
|
|
|
-import { StrUtil } from '@pura/harmony-utils';
|
|
|
+import { LogUtil, StrUtil } from '@pura/harmony-utils';
|
|
|
import { VideoItem } from '../../viewmodel/VideoItem';
|
|
|
import Logger from './Logger';
|
|
|
import RdbUtils from './RdbUtils';
|
|
|
@@ -295,7 +295,7 @@ export default class MediaTable {
|
|
|
try {
|
|
|
const predicates = new relationalStore.RdbPredicates(RdbUtils.MEDIA_TABLE.tableName);
|
|
|
predicates.equalTo('parentPath', path);
|
|
|
-
|
|
|
+ LogUtil.info('onecold parentPath = '+path)
|
|
|
// 2. 执行查询并处理结果
|
|
|
this.accountTable.query(predicates, (resultSet: relationalStore.ResultSet) => {
|
|
|
// 3. 复用已有的解析逻辑
|
|
|
@@ -509,7 +509,7 @@ export default class MediaTable {
|
|
|
const index = rs.getColumnIndex(col);
|
|
|
return index >= 0 ? rs.getString(index) || '' : '';
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
const safeGetNumber = (col: string) => {
|
|
|
const index = rs.getColumnIndex(col);
|
|
|
return index >= 0 ? rs.getDouble(index) || 0 : 0;
|
|
|
@@ -529,7 +529,7 @@ export default class MediaTable {
|
|
|
safeGet(DB_COLUMNS.ALBUM),
|
|
|
safeGet(DB_COLUMNS.FILE_NAME)
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
// 设置额外属性,添加安全检查
|
|
|
item.isFav = safeGetNumber(DB_COLUMNS.IS_FAV);
|
|
|
item.duration = safeGet(DB_COLUMNS.DURATION);
|