private static List<DatedPlaylistFile> GetExistingPlaylistWithDates(List<PlaylistFile> existingPlaylist) { var datedPlaylist = new List<DatedPlaylistFile>(); foreach(var entry in existingPlaylist) { var datedPlaylistFile = new DatedPlaylistFile() { File = entry.File, Length = entry.Length, Title = entry.Title }; datedPlaylistFile.PublishDate = FileNameParsing.GetDateFromFilePath(entry.File); datedPlaylist.Add(datedPlaylistFile); } return datedPlaylist; }
private static List<DatedPlaylistFile> GetNewPlaylistWithDates(List<DKRPodcastFileToProcess> mp3sForPlaylist) { var datedPlaylist = new List<DatedPlaylistFile>(); foreach (var entry in mp3sForPlaylist) { var datedPlaylistFile = new DatedPlaylistFile() { File = entry.DestinationPathForMp3, Length = SecondsInMp3(entry.DestinationPathForMp3), Title = Path.GetFileName(entry.DestinationPathForMp3) }; datedPlaylistFile.PublishDate = entry.ReleaseDateOfPodcastFile; datedPlaylist.Add(datedPlaylistFile); } return datedPlaylist; }