|
|
@@ -1875,22 +1875,11 @@ export struct LocalMusic {
|
|
|
this.refreshLazyListViews(mainListUpdated, playlistUpdated);
|
|
|
}
|
|
|
|
|
|
- private closeLoadingDialog(): void {
|
|
|
- if (!this.loadingDialogId) {
|
|
|
- return;
|
|
|
- }
|
|
|
- DialogHelper.closeDialog(this.loadingDialogId);
|
|
|
- this.loadingDialogId = '';
|
|
|
- }
|
|
|
|
|
|
- private closeLoadingProgressDialog(): void {
|
|
|
- DialogHelper.closeLoading();
|
|
|
- this.loadingProgressDialogId = '';
|
|
|
- }
|
|
|
|
|
|
private handleEditMusicResult(result: WorkerEditMusicResult): void {
|
|
|
// 关闭进度条
|
|
|
- this.closeLoadingDialog();
|
|
|
+ DialogHelper.closeDialog(this.loadingDialogId)
|
|
|
|
|
|
if (result.success) {
|
|
|
console.log("heanup 编辑信息成功,数据库已同步");
|
|
|
@@ -2956,14 +2945,13 @@ export struct LocalMusic {
|
|
|
|
|
|
// 初始化进度条
|
|
|
this.progress = 0;
|
|
|
- DialogHelper.showLoadingProgress({
|
|
|
+ this.loadingProgressDialogId = DialogHelper.showLoadingProgress({
|
|
|
progress: this.progress,
|
|
|
backCancel: false,
|
|
|
autoCancel: false,
|
|
|
loadColor: $r('app.color.title_bar_bg'),
|
|
|
fontColor: $r('app.color.title_bar_bg')
|
|
|
});
|
|
|
- this.loadingProgressDialogId = '';
|
|
|
|
|
|
// 计算处理总数用于进度计算
|
|
|
const totalItems = uris.length;
|
|
|
@@ -2991,18 +2979,18 @@ export struct LocalMusic {
|
|
|
// 更新进度
|
|
|
processedItems++;
|
|
|
this.progress = Math.floor((processedItems / totalItems) * 100);
|
|
|
- DialogHelper.updateLoading(` 正在处理 ${this.progress}%`, this.progress);
|
|
|
+ DialogHelper.updateLoading(this.loadingProgressDialogId,` 正在处理 ${this.progress}%`, this.progress);
|
|
|
|
|
|
} catch (error) {
|
|
|
Logger.error(TAG, 'saveVideoDatas failed with err: ' + JSON.stringify(error));
|
|
|
// 即使出错也更新进度
|
|
|
processedItems++;
|
|
|
this.progress = Math.floor((processedItems / totalItems) * 100);
|
|
|
- DialogHelper.updateLoading(` 正在处理 ${this.progress}%`, this.progress);
|
|
|
+ DialogHelper.updateLoading(this.loadingProgressDialogId,` 正在处理 ${this.progress}%`, this.progress);
|
|
|
}
|
|
|
}
|
|
|
// 关闭进度条
|
|
|
- this.closeLoadingProgressDialog();
|
|
|
+ DialogHelper.closeDialog(this.loadingProgressDialogId)
|
|
|
this.isZero = false
|
|
|
// 删除目标路径缓存
|
|
|
setTimeout(() => {
|
|
|
@@ -3019,14 +3007,13 @@ export struct LocalMusic {
|
|
|
|
|
|
let newUris: string[] = [];
|
|
|
this.progress = 0
|
|
|
- DialogHelper.showLoadingProgress({
|
|
|
+ this.loadingProgressDialogId = DialogHelper.showLoadingProgress({
|
|
|
progress: this.progress,
|
|
|
backCancel: false,
|
|
|
autoCancel: false,
|
|
|
loadColor: this.themeColor,
|
|
|
fontColor: this.themeColor
|
|
|
});
|
|
|
- this.loadingProgressDialogId = '';
|
|
|
// 计算所有文件的总大小
|
|
|
let totalSize = 0;
|
|
|
for (let uri of uris) {
|
|
|
@@ -3058,7 +3045,7 @@ export struct LocalMusic {
|
|
|
|
|
|
// 计算总进度
|
|
|
this.progress = Math.floor((totalRead / totalSize) * 100);
|
|
|
- DialogHelper.updateLoading(`正在导入 ${this.progress}%`, this.progress);
|
|
|
+ DialogHelper.updateLoading( this.loadingProgressDialogId,`正在导入 ${this.progress}%`, this.progress);
|
|
|
|
|
|
len = await fileIo.read(sourceFile.fd, buffer);
|
|
|
}
|
|
|
@@ -3088,16 +3075,10 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- this.closeLoadingProgressDialog()
|
|
|
+ DialogHelper.closeDialog(this.loadingProgressDialogId);
|
|
|
this.isZero = false
|
|
|
- this.loadingProgressDialogId = ''
|
|
|
|
|
|
- // setTimeout(() => {
|
|
|
- // // 删除目标路径缓存
|
|
|
- // this.cache.delete(this.currentPath);
|
|
|
- // this.getSortedFiles(this.currentPath,true,destPath,isOpen)
|
|
|
- // }, 500);
|
|
|
+
|
|
|
|
|
|
|
|
|
Logger.info(TAG, 'scan select video result:' + newUris)
|
|
|
@@ -7419,8 +7400,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
//内嵌音乐标签不能开启监听
|
|
|
// this.deletionWatcher?.stop();
|
|
|
- DialogHelper.showLoadingDialog()
|
|
|
- this.loadingDialogId = 'loading_dialog'
|
|
|
+ this.loadingDialogId = DialogHelper.showLoadingDialog()
|
|
|
await PermissionUtil.activatePermission(item.filePath)
|
|
|
let tempOutPath = ''
|
|
|
// 如果不是 packName 包下的文件,则直接路径用this.currentPath
|
|
|
@@ -7531,13 +7511,12 @@ export struct LocalMusic {
|
|
|
console.error(" onecold 编辑信息数据库失败 ");
|
|
|
}
|
|
|
// 关闭进度条
|
|
|
- this.closeLoadingDialog();
|
|
|
-
|
|
|
+ DialogHelper.closeDialog(this.loadingDialogId)
|
|
|
|
|
|
|
|
|
}).catch((error: Error) => {
|
|
|
// 关闭进度条
|
|
|
- this.closeLoadingDialog();
|
|
|
+ DialogHelper.closeDialog(this.loadingDialogId)
|
|
|
console.error('onecold Subtitle sync failed:', error);
|
|
|
});
|
|
|
|
|
|
@@ -7546,7 +7525,7 @@ export struct LocalMusic {
|
|
|
|
|
|
} else {
|
|
|
// 关闭进度条
|
|
|
- this.closeLoadingDialog();
|
|
|
+ DialogHelper.closeDialog(this.loadingDialogId)
|
|
|
ToastUtil.showToast('内嵌音乐标签失败')
|
|
|
console.log('onecold 内嵌音乐标签失败');
|
|
|
}
|
|
|
@@ -7581,7 +7560,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- this.closeLoadingDialog();
|
|
|
+ DialogHelper.closeDialog(this.loadingDialogId)
|
|
|
}
|
|
|
|
|
|
@Builder
|