Todo
This commit is contained in:
parent
f4386b1785
commit
4dfbef6470
4
hq2cd-ps1/TODO.txt
Normal file
4
hq2cd-ps1/TODO.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Need to normalize file names on server, no stupid "’" and "'" shenanigans
|
||||||
|
https://apps.timwhitlock.info/unicode/inspect?s=%E2%80%99%27
|
||||||
|
|
||||||
|
either that or get child item to not print out something different than what is actually there
|
@ -1,9 +1,10 @@
|
|||||||
|
# Delete output folder if it exists
|
||||||
|
if (Test-Path -Path "Output") {
|
||||||
|
Remove-Item -Path "Output" -Recurse -Force
|
||||||
|
}
|
||||||
|
|
||||||
# Read each line in the file
|
# Read each line in the file
|
||||||
$filePaths = Get-Content -Path $args[0]
|
$filePaths = Get-Content -Path $args[0]
|
||||||
$files = @()
|
|
||||||
foreach ($filePath in $filePaths) {
|
|
||||||
$files += Get-Item -Path "$($filePath)" -Force
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save to output folder "Output"
|
# Save to output folder "Output"
|
||||||
$destination = "Output"
|
$destination = "Output"
|
||||||
@ -19,20 +20,31 @@ foreach ($file in $files) {
|
|||||||
}
|
}
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
$filePaths | ForEach-Object -Parallel {
|
||||||
|
# Stupid apostrophe in the file name
|
||||||
|
# Intentional, as this is how Picard names files with apostrophes
|
||||||
|
$path = $_.Replace("'", "’")
|
||||||
|
|
||||||
|
$file = Get-Item -LiteralPath $path
|
||||||
|
|
||||||
|
$destination = "Output"
|
||||||
$prefix = "Z:\Music-HQ\"
|
$prefix = "Z:\Music-HQ\"
|
||||||
$files | ForEach-Object -Parallel {
|
|
||||||
$oldLocation = $_.FullName
|
|
||||||
|
|
||||||
|
$oldLocation = $file.FullName
|
||||||
# Remove the prefix
|
# Remove the prefix
|
||||||
$newLocation = $oldLocation.Substring($prefix.Length)
|
$newLocation = $oldLocation.Substring($prefix.Length)
|
||||||
# Remove the name of the file for folder creation
|
# Remove the name of the file for folder creation
|
||||||
$newLocation = $newLocation.Substring(0, $newLocation.IndexOf($_.Name))
|
$newLocation = $newLocation.Substring(0, $newLocation.IndexOf($file.Name))
|
||||||
|
|
||||||
# Create the folder if it doesn't exist
|
# Create the folder if it doesn't exist
|
||||||
if (-not (Test-Path -Path $destination\$newLocation)) {
|
if (-not (Test-Path -Path $destination\$newLocation)) {
|
||||||
New-Item -Path $destination\$newLocation -ItemType Directory
|
New-Item -Path $destination\$newLocation -ItemType Directory
|
||||||
}
|
}
|
||||||
|
$destinationPath = $destination + "\" + $newLocation + $file.Name
|
||||||
|
|
||||||
$destinationPath = $destination + "\" + $newLocation + $_.Name
|
|
||||||
Write-Host $destinationPath
|
Write-Host $destinationPath
|
||||||
# ffmpeg -i $_.FullName -c:a flac -sample_fmt s16 -ar 44100 $destinationPath
|
|
||||||
|
ffmpeg -i $_.FullName -c:a flac -sample_fmt s16 -ar 44100 $destinationPath
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user