Пример #1
0
        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()}");
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 static string getPath(string videoId, int streamId, DateTime time)
 {
     return(Path.Combine(GlobalData.VideoPath(videoId, streamId), GlobalProcess.FolderPath(time), GlobalProcess.FileNameFromTime(time) + GlobalProcess.RecFormat()));
 }