aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/netease-music-convert/Convert.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/life/netease-music-convert/Convert.ps1')
-rw-r--r--store/works/life/netease-music-convert/Convert.ps115
1 files changed, 15 insertions, 0 deletions
diff --git a/store/works/life/netease-music-convert/Convert.ps1 b/store/works/life/netease-music-convert/Convert.ps1
new file mode 100644
index 0000000..4797080
--- /dev/null
+++ b/store/works/life/netease-music-convert/Convert.ps1
@@ -0,0 +1,15 @@
+$musicDirectory = 'D:\CloudMusic'
+$ncmdumpPath = 'D:\ncmdump-windows-amd64.exe'
+
+pushd $musicDirectory
+Write-Host "Enter $musicDirectory"
+
+foreach ($file in Get-ChildItem $musicDirectory) {
+ if (($file.Extension -eq '.ncm') -and (Get-ChildItem $musicDirectory | Where-Object { ($_.BaseName -eq $file.BaseName) -and ($_.Extension -eq '.mp3' -or $_.Extension -eq '.flac') }).Length -eq 0) {
+ Write-Host "Convert $($file.Name) ..."
+ & $ncmdumpPath $file.Name
+ }
+}
+
+Write-Host "Exit $musicDirectory"
+popd