I had been playing around with PowerShell off and on since I last posted on this thread, and I’ve managed to write a couple of metadata functions.
Assuming I’ve done this right, clicking on the above link should let you download a .zip file with two PowerShell script files:
Function-Get-ExtensionAttribute.ps1
Function-Get-MusicData.ps1
You need to put those in your default PowerShell folder. You also need to install the ID3 module from the PowerShell gallery
Now dot-source Get-MusicData:
> . .\Function-Get-MusicData.ps1
You now have access to two functions:
Get-Tracklist
Get-MusicData
Get-Tracklist looks at all the mp3 files in a directory and produces a tracklist
> Get-Tracklist "C:\Users\Bill\OneDrive\New Music\First Listen\~S~\Simon & Garfunkel\Simon and Garfunkel's Greatest Hits"
Produces the output:
Track Artist Title Length
----- ------ ----- ------
1 Simon & Garfunkel Mrs. Robinson 03:52
2 Simon & Garfunkel For Emily, Whenever I May Find Her 02:24
3 Simon & Garfunkel The Boxer 05:10
4 Simon & Garfunkel The 59th Street Bridge Song (Feelin' Groovy) 01:50
5 Simon & Garfunkel The Sound of Silence 03:06
6 Simon & Garfunkel I Am a Rock 02:52
7 Simon & Garfunkel Scarborough Fair / Canticle 03:09
8 Simon & Garfunkel Homeward Bound 02:42
9 Simon & Garfunkel Bridge Over Troubled Water 04:52
10 Simon & Garfunkel America 03:33
11 Simon & Garfunkel Kathy's Song 03:23
12 Simon & Garfunkel El cóndor pasa (If I Could) 03:07
13 Simon & Garfunkel Bookends 01:20
14 Simon & Garfunkel Cecilia 02:53
Get-MusicTags gets all the available tags from mp3 files;
> Get-MusicTags "C:\Users\Bill\OneDrive\New Music\First Listen\~S~\Simon & Garfunkel\Simon and Garfunkel's Greatest Hits\01 - Simon & Garfunkel - Mrs. Robinson.mp3"
Will get this:
Publisher : CBS
Length : 00:03:52
StartTag : TagLib.NonContainer.StartTag
EndTag : TagLib.NonContainer.EndTag
TagTypes : Id3v1, Id3v2
Tags : {5d02f264-e225-41ff-83f7-d9b1f0b1874a, }
Title : Mrs. Robinson
Performers : {Simon & Garfunkel}
PerformersSort : {Simon & Garfunkel}
AlbumArtistsSort : {Simon & Garfunkel}
AlbumArtists : {Simon & Garfunkel}
Composers : {Paul Simon}
ComposersSort : {Simon, Paul}
TitleSort :
AlbumSort :
Album : Simon and Garfunkel's Greatest Hits
Comment :
Genres : {Am Pop}
Year : 1990
Track : 1
TrackCount : 14
Disc : 1
DiscCount : 1
Lyrics :
Grouping :
BeatsPerMinute : 0
Conductor :
Copyright :
MusicBrainzArtistId : 5d02f264-e225-41ff-83f7-d9b1f0b1874a
MusicBrainzReleaseId : cb74585e-34f1-477e-8e40-8fdf6c116483
MusicBrainzReleaseArtistId : 5d02f264-e225-41ff-83f7-d9b1f0b1874a
MusicBrainzTrackId : df569676-9c08-4bec-8137-daa122c04ca9
MusicBrainzDiscId :
MusicIpId :
AmazonId :
MusicBrainzReleaseStatus : official
MusicBrainzReleaseType : album/compilation
MusicBrainzReleaseCountry : XE
Pictures : {}
IsEmpty : False
Artists : {Simon & Garfunkel}
FirstArtist : Simon & Garfunkel
FirstAlbumArtist : Simon & Garfunkel
FirstAlbumArtistSort : Simon & Garfunkel
FirstPerformer : Simon & Garfunkel
FirstPerformerSort : Simon & Garfunkel
FirstComposerSort : Simon, Paul
FirstComposer : Paul Simon
FirstGenre : Am Pop
JoinedArtists : Simon & Garfunkel
JoinedAlbumArtists : Simon & Garfunkel
JoinedPerformers : Simon & Garfunkel
JoinedPerformersSort : Simon & Garfunkel
JoinedComposers : Paul Simon
JoinedGenres : Am Pop
With this function, you can do various things, like creating a .csv tracklist:
> Get-ChildItem *.mp3 | Get-MusicTags | sort Track | select Track,JoinedArtists,Title,Length | Export-Csv .\SGGreatest.csv -Encoding utf8 -NoTypeInformation