public static string FindArtworkUri(DirectoryInfo aInfo, IVirtualFileSystem aVirtualFileSystem) { string[] kImageSearchExt = { ".jpg", ".png" }; string[] kImageSearchName = { "folder", "cover" }; try { foreach (string s in kImageSearchExt) { foreach (string n in kImageSearchName) { string filename = Path.Combine(aInfo.FullName, string.Format("{0}{1}", n, s)); if (System.IO.File.Exists(filename)) { return(aVirtualFileSystem.Uri(filename)); } } } } catch { } //ignore path errors return(null); }