Esempio n. 1
0
        public DownloadParameters(TwitchVideo video, TwitchVideoQuality resolution, VodAuthInfo vodAuthInfo, string folder, string filename)
        {
            if (video == null)
            {
                throw new ArgumentNullException(nameof(video));
            }

            if (resolution == null)
            {
                throw new ArgumentNullException(nameof(resolution));
            }

            if (vodAuthInfo == null)
            {
                throw new ArgumentNullException(nameof(vodAuthInfo));
            }

            if (string.IsNullOrWhiteSpace(folder))
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            this.video       = video;
            this.resolution  = resolution;
            this.vodAuthInfo = vodAuthInfo;
            this.folder      = folder;
            this.filename    = filename;

            this.CropEndTime = video.Length;
        }
Esempio n. 2
0
        public DownloadParameters(TwitchVideo video, VodAuthInfo vodAuthInfo, TwitchVideoQuality quality,
                                  string folder, string filename, bool disableConversion, bool autoSplitUse, TimeSpan autoSplitTime, int autoSplitOverlap)
        {
            if (string.IsNullOrWhiteSpace(folder))
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            _video       = video ?? throw new ArgumentNullException(nameof(video));
            _vodAuthInfo = vodAuthInfo ?? throw new ArgumentNullException(nameof(vodAuthInfo));

            //null mean that user should manually select quality. Don't worry, validation check will mark this issue
            _quality = quality;// ?? throw new ArgumentNullException(nameof(quality));

            _folder            = folder;
            _filename          = filename;
            _disableConversion = disableConversion;

            _autoSplitTime    = autoSplitTime;
            _autoSplit        = autoSplitUse && (autoSplitTime.TotalSeconds > Preferences.MinSplitLength && autoSplitTime.TotalSeconds < video.Length.TotalSeconds + Preferences.MinSplitLength);
            _autoSplitOverlap = autoSplitOverlap;

            _cropEndTime = video.Length;
        }
        public DownloadParameters(TwitchVideo video, VodAuthInfo vodAuthInfo, TwitchVideoQuality quality, string folder, string filename)
        {
            if (string.IsNullOrWhiteSpace(folder))
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            _video       = video ?? throw new ArgumentNullException(nameof(video));
            _quality     = quality ?? throw new ArgumentNullException(nameof(quality));
            _vodAuthInfo = vodAuthInfo ?? throw new ArgumentNullException(nameof(vodAuthInfo));

            _folder   = folder;
            _filename = filename;

            _cropEndTime = video.Length;
        }
        public DownloadParameters(TwitchVideo video, VodAuthInfo vodAuthInfo, TwitchVideoQuality quality, String folder, String filename, Boolean disableConversion)
        {
            if (String.IsNullOrWhiteSpace(folder))
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (String.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            this.Video       = video ?? throw new ArgumentNullException(nameof(video));
            this._quality    = quality ?? throw new ArgumentNullException(nameof(quality));
            this.VodAuthInfo = vodAuthInfo ?? throw new ArgumentNullException(nameof(vodAuthInfo));

            this._folder            = folder;
            this._filename          = filename;
            this._disableConversion = disableConversion;

            this._cropEndTime = video.Length;
        }