|
@@ -526,14 +526,10 @@ async function scanDirectoryTask(context: Context, dirPath: string,
|
|
|
if (FileUtil.isDirectory(fPath)) {
|
|
if (FileUtil.isDirectory(fPath)) {
|
|
|
stack.push(fPath); // 使用栈结构代替递归
|
|
stack.push(fPath); // 使用栈结构代替递归
|
|
|
} else {
|
|
} else {
|
|
|
- if (fPath.endsWith('.lrc') || fPath.endsWith('.srt')|| fPath.endsWith('.cue')) return;
|
|
|
|
|
|
|
+ if (fPath.endsWith('.lrc') || fPath.endsWith('.srt')) return;
|
|
|
// console.info('onecold scanDirectoryTask fPath2 = ' + fPath)
|
|
// console.info('onecold scanDirectoryTask fPath2 = ' + fPath)
|
|
|
if (Utility.isMeidaByExtension(fPath)) {
|
|
if (Utility.isMeidaByExtension(fPath)) {
|
|
|
- const mediaItem = await Utility.uriGetMusicAssetsFromFile(
|
|
|
|
|
- context, fPath, CommonConstants.TYPE_LOCAL, autoParseMusicName
|
|
|
|
|
- );
|
|
|
|
|
insertCount++
|
|
insertCount++
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
// console.info('onecold scanDirectoryTask fPath = ' + fPath)
|
|
// console.info('onecold scanDirectoryTask fPath = ' + fPath)
|
|
|
// console.info('onecold scanDirectoryTask insertCount = ' + insertCount)
|
|
// console.info('onecold scanDirectoryTask insertCount = ' + insertCount)
|
|
@@ -542,6 +538,10 @@ async function scanDirectoryTask(context: Context, dirPath: string,
|
|
|
let err = error as BusinessError;
|
|
let err = error as BusinessError;
|
|
|
console.warn( `onecold sendData failed, code=${err.code}, message=${err.message}`);
|
|
console.warn( `onecold sendData failed, code=${err.code}, message=${err.message}`);
|
|
|
}
|
|
}
|
|
|
|
|
+ const mediaItem = await Utility.uriGetMusicAssetsFromFile(
|
|
|
|
|
+ context, fPath, CommonConstants.TYPE_LOCAL, autoParseMusicName
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
table.insert(mediaItem, (id: number) => {
|
|
table.insert(mediaItem, (id: number) => {
|
|
|
|
|
|
|
|
},cover_api);
|
|
},cover_api);
|