public static IEnumerable <Recording> ParseMetadata(this IEnumerable <string> files) { var ordinal = new Ordinal(); var shellReader = new ShellReader(); ordinal = shellReader.GetFileHeaders(files.GetFirstFile()).PopulateOrdinals(); var recordings = files.Select(p => p.GetHeaderValues(ordinal)); return(recordings); }
public static Recording GetHeaderValues(this string filePath, Ordinal ordinal) { ShellReader shellReader = new ShellReader(); Folder folder = shellReader.GetShellFolderObject(filePath); FolderItem folderItem = shellReader.GetShellFolderItem(filePath); Recording recording = new Recording() { Size = folder.GetDetailsOf(folderItem, ordinal.Size).SanitizeString(), DateModified = folder.GetDetailsOf(folderItem, ordinal.DateModified).SanitizeString(), PerceivedType = folder.GetDetailsOf(folderItem, ordinal.PerceivedType).SanitizeString(), Genre = folder.GetDetailsOf(folderItem, ordinal.Genre).SanitizeString(), Rating = folder.GetDetailsOf(folderItem, ordinal.Rating).SanitizeString(), Title = folder.GetDetailsOf(folderItem, ordinal.Title).SanitizeString(), Length = folder.GetDetailsOf(folderItem, ordinal.Length).SanitizeString(), ProtectedRecording = folder.GetDetailsOf(folderItem, ordinal.ProtectedRecording).SanitizeString(), FileName = folder.GetDetailsOf(folderItem, ordinal.FileName).SanitizeString(), FolderName = folder.GetDetailsOf(folderItem, ordinal.FolderName).SanitizeString(), FilePath = folder.GetDetailsOf(folderItem, ordinal.FilePath).SanitizeString(), TypeRecording = folder.GetDetailsOf(folderItem, ordinal.TypeRecording).SanitizeString(), DateReleased = folder.GetDetailsOf(folderItem, ordinal.DateReleased).SanitizeString(), Subtitle = folder.GetDetailsOf(folderItem, ordinal.Subtitle).SanitizeString(), ParentalRating = folder.GetDetailsOf(folderItem, ordinal.ParentalRating).SanitizeString(), ParentalRatingReason = folder.GetDetailsOf(folderItem, ordinal.ParentalRatingReason).SanitizeString(), ChannelNumber = folder.GetDetailsOf(folderItem, ordinal.ChannelNumber).SanitizeString(), EpisodeName = folder.GetDetailsOf(folderItem, ordinal.EpisodeName).SanitizeString(), Rerun = folder.GetDetailsOf(folderItem, ordinal.Rerun).SanitizeString(), BroadcastDate = folder.GetDetailsOf(folderItem, ordinal.BroadcastDate).SanitizeString(), ProgramDescription = folder.GetDetailsOf(folderItem, ordinal.ProgramDescription).SanitizeString(), RecordingTime = folder.GetDetailsOf(folderItem, ordinal.RecordingTime).SanitizeString(), StationCallSign = folder.GetDetailsOf(folderItem, ordinal.StationCallSign).SanitizeString(), StationName = folder.GetDetailsOf(folderItem, ordinal.StationName).SanitizeString(), }; return(recording); }