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
|
||||
$filePaths = Get-Content -Path $args[0]
|
||||
$files = @()
|
||||
foreach ($filePath in $filePaths) {
|
||||
$files += Get-Item -Path "$($filePath)" -Force
|
||||
}
|
||||
|
||||
# Save to output folder "Output"
|
||||
$destination = "Output"
|
||||
@ -19,20 +20,31 @@ foreach ($file in $files) {
|
||||
}
|
||||
#>
|
||||
|
||||
$prefix = "Z:\Music-HQ\"
|
||||
$files | ForEach-Object -Parallel {
|
||||
$oldLocation = $_.FullName
|
||||
$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\"
|
||||
|
||||
|
||||
|
||||
$oldLocation = $file.FullName
|
||||
# Remove the prefix
|
||||
$newLocation = $oldLocation.Substring($prefix.Length)
|
||||
# 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
|
||||
if (-not (Test-Path -Path $destination\$newLocation)) {
|
||||
New-Item -Path $destination\$newLocation -ItemType Directory
|
||||
}
|
||||
$destinationPath = $destination + "\" + $newLocation + $file.Name
|
||||
|
||||
$destinationPath = $destination + "\" + $newLocation + $_.Name
|
||||
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