Пример #1
0
        public EmptyResult Edit(SeriesModel seriesModel)
        {
            var series = _seriesProvider.GetSeries(seriesModel.SeriesId);
            series.Monitored = seriesModel.Monitored;
            series.SeasonFolder = seriesModel.SeasonFolder;
            series.QualityProfileId = seriesModel.QualityProfileId;

            var oldPath = series.Path;

            series.Path = seriesModel.Path;
            series.BacklogSetting = (BacklogSettingType)seriesModel.BacklogSetting;

            if (!String.IsNullOrWhiteSpace(seriesModel.CustomStartDate))
                series.CustomStartDate = DateTime.Parse(seriesModel.CustomStartDate, null, DateTimeStyles.RoundtripKind);

            else
                series.CustomStartDate = null;

            _seriesProvider.UpdateSeries(series);

            if(oldPath != series.Path)
                _jobProvider.QueueJob(typeof(DiskScanJob), new {SeriesId = series.SeriesId});

            return new EmptyResult();
        }
Пример #2
0
        public EmptyResult SaveSingleSeriesEditor(SeriesModel seriesModel)
        {
            var series = _seriesProvider.GetSeries(seriesModel.SeriesId);
            series.Monitored = seriesModel.Monitored;
            series.SeasonFolder = seriesModel.SeasonFolder;
            series.QualityProfileId = seriesModel.QualityProfileId;
            series.Path = seriesModel.Path;
            series.BacklogSetting = (BacklogSettingType)seriesModel.BacklogSetting;

            _seriesProvider.UpdateSeries(series);

            return new EmptyResult();
        }