Fixed a bug with converting default quality profile from config when adding a new series.

Re-enabled the RssSyncTimer so it will run an RSS Sync when fired.
pull/3113/head
markus101 14 years ago
parent da79ad147e
commit 735668f7b3

@ -74,7 +74,7 @@ namespace NzbDrone.Core.Providers
if (IsSeasonIgnored(episode))
return false;
if (!_series.QualityWanted(episode.SeriesId, episode.Quality))
{
Logger.Debug("Quality [{0}] is not wanted for: {1}", episode.Quality, episode.SeriesTitle);
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Providers
episode.EpisodeId = dbEpisode.EpisodeId;
var epWithFiles = _sonicRepo.Single<Episode>(c => c.EpisodeId == episode.EpisodeId && c.Files.Count > 0);
if (epWithFiles != null)
{
//If not null we need to see if this episode has the quality as the download (or if it is better)
@ -104,7 +104,7 @@ namespace NzbDrone.Core.Providers
return false;
}
throw new NotImplementedException();
return true;
}
public void RefreshEpisodeInfo(int seriesId)

@ -108,7 +108,7 @@ namespace NzbDrone.Core.Providers
repoSeries.Path = path;
repoSeries.CleanTitle = Parser.NormalizeTitle(series.SeriesName);
repoSeries.Monitored = true; //New shows should be monitored
repoSeries.QualityProfile = (QualityProfile) Enum.Parse(typeof (QualityProfile), _config.GetValue("Quality", 1, true));
repoSeries.QualityProfile = _quality.Find(Convert.ToInt32(_config.GetValue("Quality", 1, true)));
_sonioRepo.Add(repoSeries);
}

@ -36,7 +36,7 @@ namespace NzbDrone.Core.Providers
public void ResetRssSyncTimer()
{
double interval = _rssSyncTimer.Interval;
_rssSyncTimer .Interval= interval;
_rssSyncTimer.Interval = interval;
}
public void StartRssSyncTimer()
@ -47,7 +47,7 @@ namespace NzbDrone.Core.Providers
throw new InvalidOperationException("RSS Sync Frequency Invalid");
}
_rssSyncTimer.Elapsed +=new ElapsedEventHandler(RunRssSync);
_rssSyncTimer.Elapsed += new ElapsedEventHandler(RunRssSync);
_rssSyncTimer.Start();
_rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval);
}
@ -59,7 +59,7 @@ namespace NzbDrone.Core.Providers
public void SetRssSyncTimer(int minutes)
{
long ms = minutes*60*1000;
long ms = minutes * 60 * 1000;
_rssSyncTimer.Interval = ms;
}
@ -89,7 +89,7 @@ namespace NzbDrone.Core.Providers
private void RunRssSync(object obj, ElapsedEventArgs args)
{
_rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval);
//_rssSyncProvider.Begin();
_rssSyncProvider.Begin();
}
private void MinuteTimer_Elapsed(object obj, ElapsedEventArgs args)

@ -144,8 +144,8 @@ namespace NzbDrone.Web.Controllers
var profiles = _qualityProvider.GetAllProfiles().ToList();
var defaultQualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", profiles[0].ProfileId, true));
var selectList = new SelectList(profiles, "ProfileId", "Name");
return new QualityModel {DefaultProfileId = defaultQualityProfileId, SelectList = selectList};
return new QualityModel { DefaultProfileId = defaultQualityProfileId, SelectList = selectList };
}
[HttpPost]
@ -157,7 +157,7 @@ namespace NzbDrone.Web.Controllers
return Content(_settingsSaved);
}
return Content(_settingsFailed);
return Content(_settingsFailed);
}
[HttpPost]
@ -167,10 +167,7 @@ namespace NzbDrone.Web.Controllers
{
//Todo: Only allow indexers to be enabled if user information has been provided
foreach (var indexer in data.Indexers)
{
indexer.ApiUrl = String.Empty; //TODO: Remove this and use a Real API URL
_indexerProvider.Update(indexer);
}
_configProvider.SetValue("NzbMatrixUsername", data.NzbMatrixUsername);
_configProvider.SetValue("NzbMatrixApiKey", data.NzbMatrixApiKey);
@ -190,18 +187,18 @@ namespace NzbDrone.Web.Controllers
{
if (ModelState.IsValid)
{
_configProvider.SetValue("SyncFrequency", data.SyncFrequency.ToString());
_configProvider.SetValue("DownloadPropers", data.DownloadPropers.ToString());
_configProvider.SetValue("Retention", data.Retention.ToString());
_configProvider.SetValue("SabHost", data.SabHost);
_configProvider.SetValue("SabPort", data.SabPort.ToString());
_configProvider.SetValue("SabApiKey", data.SabApiKey);
_configProvider.SetValue("SabUsername", data.SabUsername);
_configProvider.SetValue("SabPassword", data.SabPassword);
_configProvider.SetValue("SabCategory", data.SabCategory);
_configProvider.SetValue("SabPriority", data.SabPriority.ToString());
_configProvider.SetValue("SyncFrequency", data.SyncFrequency.ToString());
_configProvider.SetValue("DownloadPropers", data.DownloadPropers.ToString());
_configProvider.SetValue("Retention", data.Retention.ToString());
_configProvider.SetValue("SabHost", data.SabHost);
_configProvider.SetValue("SabPort", data.SabPort.ToString());
_configProvider.SetValue("SabApiKey", data.SabApiKey);
_configProvider.SetValue("SabUsername", data.SabUsername);
_configProvider.SetValue("SabPassword", data.SabPassword);
_configProvider.SetValue("SabCategory", data.SabCategory);
_configProvider.SetValue("SabPriority", data.SabPriority.ToString());
return Content(_settingsSaved);
return Content(_settingsSaved);
}
return Content(_settingsFailed);

Loading…
Cancel
Save