private static void addErrorFile(string videoId, int streamId, DateTime date) { string path = Path.Combine(GlobalData.Path, $"{videoId}_{streamId}", GlobalProcess.FolderPath(date)); Directory.CreateDirectory(path); writeError(path, $"{GlobalProcess.FileNameFromDate(date)}235959999{GlobalProcess.IndexesFormat()}"); writeError(path, $"{GlobalProcess.FileNameFromDate(date)}235959999{GlobalProcess.RecFormat()}"); }
static long getAllSize(string folderPath, int headerLength) { DirectoryInfo dir = new DirectoryInfo(folderPath); FileInfo[] files = dir.GetFiles("*" + GlobalProcess.RecFormat()); long length = files.Sum(_ => getStreamSize(_, headerLength)); return(length); }
static long getValidSize(string folderPath, DateTime beginTime, DateTime endTime, int headerLength) { DirectoryInfo dir = new DirectoryInfo(folderPath); FileInfo[] files = dir.GetFiles("*" + GlobalProcess.RecFormat()); long length = 0; foreach (var file in files) { length += getSize(file, beginTime, endTime, headerLength); } return(length); }
static string getPath(string videoId, int streamId, DateTime time) { return(Path.Combine(GlobalData.VideoPath(videoId, streamId), GlobalProcess.FolderPath(time), GlobalProcess.FileNameFromTime(time) + GlobalProcess.RecFormat())); }