Last active
June 6, 2020 05:00
Inspects the music properties of .mp3 files in the music directory
This file contains 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
#r "nuget: Microsoft.Windows.Sdk.NET, 10.0.18362.3-preview" | |
open System | |
open Windows.Storage | |
let asyncGetFiles() = | |
async { | |
let! files = KnownFolders.MusicLibrary.GetFilesAsync().AsTask() |> Async.AwaitTask | |
return files |> Seq.take 5 | |
} | |
async { | |
let! files = asyncGetFiles() | |
for file in files do | |
let! musicProps = file.Properties.GetMusicPropertiesAsync().AsTask() |> Async.AwaitTask | |
printfn "%s - %s" musicProps.Title musicProps.Album | |
} |> Async.RunSynchronously |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment