Пример #1
0
        public void AddDownload(FileDownload download)
        {
            try
            {
                log.Debug("Adding download to job: " + this.jobToken);
                this.status   = "Downloading";
                this.download = download;


                DirectoryInfo di = Directory.CreateDirectory(this.WorkingDir);

                foreach (var file in di.GetFiles())
                {
                    file.Delete();
                }

                if (File.Exists(FFRest.config["workingdir"] + download.Destination))
                {
                    File.Move(FFRest.config["workingdir"] + download.Destination, this.WorkingDir + Download.Destination);
                }

                results = new List <TranscoderResult>();
                if (!this.failed)
                {
                    taskSet.EnqueSimpleTask(download);
                }
            }
            catch (Exception ex)
            {
                log.Error("An error occured AddDownload: " + this.jobToken, ex);
            }
        }