public dynamic EastAtlantic(int count = 20, bool isCompressed = true) { FileInfo f = null; DateTime sTime = DateTime.Now; string fileName = baseDir("videos\\"); var dinfo = new DirectoryInfo(baseDir(east_atl_path)); var files = dinfo.GetLatestFiles(count); if (files.Length > 1) { fileName += files[0].Name.Replace(".jpg", "") + "_" + files[files.Length-1].Name.Replace(".jpg", "") + ".avi"; if (File.Exists(fileName)) { f = new FileInfo(fileName); f.LastAccessTime = DateTime.Now; } else { CreateVideo(fileName, files, isCompressed); } } if (f == null) f = new FileInfo(fileName); dynamic obj = new ExpandoObject(); obj.Time = sTime.Diff(); obj.File = FileDetails(f); return Json(obj); }
private static List<string> readDir(string path, int count) { var result = new List<string>(); var dinfo = new DirectoryInfo(baseDir(path)); foreach (var file in dinfo.GetLatestFiles(count)) result.Add(file.Name); return result; }