예제 #1
0
        static async Task <string> GetOutputCached(string path, Process process)
        {
            long      filesize = IoUtils.GetFilesize(path);
            QueryInfo hash     = new QueryInfo(path, filesize, process.StartInfo.Arguments);

            if (filesize > 0 && CacheContains(hash, ref cmdCache))
            {
                Logger.Log($"GetVideoInfo: '{process.StartInfo.FileName} {process.StartInfo.Arguments}' cached, won't re-run.", true, false, "ffmpeg");
                return(GetFromCache(hash, ref cmdCache));
            }

            Logger.Log($"GetVideoInfo: '{process.StartInfo.FileName} {process.StartInfo.Arguments}' not cached, running.", true, false, "ffmpeg");
            string output = await OsUtils.GetOutputAsync(process);

            cmdCache.Add(hash, output);
            return(output);
        }