|
|
@@ -60,7 +60,10 @@ export default class RdbUtils {
|
|
|
' lyricContent TEXT,\n' +
|
|
|
' mimeType TEXT' +
|
|
|
')',
|
|
|
- columns: ['id', 'name', 'filePath','mtype', 'videoSize', 'cTime','size', 'artist', 'album','fileName','parentPath','isFav','pixelMapPath','pixelMapToString', 'duration', 'mimeType', 'trackCount', 'sampleRate', 'lastPlayedStr', 'playCount', 'lyricContent']
|
|
|
+ columns: ['id', 'name', 'filePath','mtype', 'videoSize', 'cTime','size', 'artist', 'album',
|
|
|
+ 'fileName','parentPath','isFav','pixelMapPath','pixelMapToString',
|
|
|
+ 'duration', 'sampleRate','playCount', 'lastPlayedStr', 'trackCount',
|
|
|
+ 'lyricContent','mimeType']
|
|
|
};
|
|
|
|
|
|
constructor(tableName: string, sqlCreateTable: string, columns: Array<string>) {
|
|
|
@@ -301,29 +304,24 @@ export default class RdbUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
query(predicates: relationalStore.RdbPredicates, callback: Function = () => {
|
|
|
}) {
|
|
|
if (!callback || typeof callback === 'undefined' || callback === undefined) {
|
|
|
Logger.info(RdbUtils.RDB_TAG, 'query() has no callback!');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
if (this.rdbStore) {
|
|
|
- // 使用安全的列集合查询
|
|
|
- // 首先仅查询基本列(确保100%存在)
|
|
|
- const safeColumns = ['id', 'name', 'filePath', 'mtype', 'videoSize', 'cTime',
|
|
|
- 'size', 'artist', 'album', 'fileName', 'parentPath',
|
|
|
- 'isFav', 'pixelMapPath', 'pixelMapToString'];
|
|
|
-
|
|
|
- this.rdbStore.query(predicates, safeColumns, (err, resultSet) => {
|
|
|
+ this.rdbStore.query(predicates, this.columns, (err, resultSet) => {
|
|
|
if (err) {
|
|
|
- Logger.error(RdbUtils.RDB_TAG, `query() failed, err: ${err}`);
|
|
|
- callback(null);
|
|
|
+ Logger.error(RdbUtils.RDB_TAG, `query() failed, err: ${err}`);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ // Logger.info(RdbUtils.RDB_TAG, 'query() finished.');
|
|
|
callback(resultSet);
|
|
|
+ resultSet.close();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|