Last active
December 22, 2020 03:16
-
-
Save khaosx/068f6e811cc67219f809661b52f5ca76 to your computer and use it in GitHub Desktop.
Verifies that all media in source dir has been transcoded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # verify-media.ps1 | |
| # | |
| # Copyright 2020 - K. Austin Newman | |
| # Version: 1.0 | |
| # Verifies that all media in source dir has been transcoded | |
| # Usage: verify-media <path> | |
| if ( $args.count -eq 0 ) { | |
| write-warning "No source specified. Exiting." | |
| exit | |
| } | |
| else { | |
| $dirSource = Resolve-Path -LiteralPath "$args" | |
| } | |
| write-host "Getting all MKV files for processing" | |
| write-host "Source dir is $dirSource" | |
| $fPrepArray = Get-ChildItem -recurse $dirSource -include *.mkv -File | |
| $outputCSV = "movie_compare.csv" | |
| New-Item -Force -Path d:\ -Name $outputCSV -ItemType "file" | |
| "Movie Name,Status,Transcoded Date" | add-content -path d:\$outputCSV | |
| foreach ( $element in $fPrepArray ) { | |
| $strTheFile = $element.ToString() | |
| $strFilename = (Get-Item $strTheFile).Basename | |
| $target = "M:\Encoding Logs\$strFilename.mkv.log" | |
| if ( Test-Path $target ) { | |
| $fCreation = (Get-item $target).creationtime | |
| "`"$strFilename`",Transcoded,`"$fCreation`"" | add-content -path d:\$outputCSV | |
| } | |
| else { | |
| "`"$strFilename`",MISSING,-" | add-content -path d:\$outputCSV | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment